Bonjour,
J'ai un Yamaha RX-V673 et le bouton virtuel de i-magin marche très très bien !!! Merci.
Pour aller plus loin j'ai trouvé les commandes GET et PUT de Yamaha, que je joins au post pour partage.
J'ai fais un bouton pour lancer une net-radio particulière en enchaînant plusieurs actions :
--[[
%% properties
%% globals
--]]
local _deviceIp = fibaro:get(fibaro:getSelfId(), "IPAddress");
local _devicePort = fibaro:get(fibaro:getSelfId(), "TCPPort");
YAM = Net.FHttp(_deviceIp,_devicePort)
response ,status, errorCode = YAM:POST('/YamahaRemoteControl/ctrl', '<YAMAHA_AV cmd="PUT"><Main_Zone><Power_Control><Power>On</Power></Power_Control></Main_Zone></YAMAHA_AV>')
fibaro:debug("réponse :"..response..status); fibaro:sleep(3000);
response ,status, errorCode = YAM:POST('/YamahaRemoteControl/ctrl', '<YAMAHA_AV cmd="PUT"><Main_Zone><Input><Input_Sel>NET RADIO</Input_Sel></Input></Main_Zone></YAMAHA_AV>')
fibaro:debug("réponse :"..response..status); fibaro:sleep(3000);
response ,status, errorCode = YAM:POST('/YamahaRemoteControl/ctrl', '<YAMAHA_AV cmd="PUT"><NET_RADIO><List_Control><Direct_Sel>Line_1</Direct_Sel></List_Control></NET_RADIO></YAMAHA_AV>')
fibaro:debug("réponse :"..response..status); fibaro:sleep(3000);
response ,status, errorCode = YAM:POST('/YamahaRemoteControl/ctrl', '<YAMAHA_AV cmd="PUT"><NET_RADIO><List_Control><Direct_Sel>Line_1</Direct_Sel></List_Control></NET_RADIO></YAMAHA_AV>')
fibaro:debug("réponse :"..response..status); fibaro:sleep(3000);
response ,status, errorCode = YAM:POST('/YamahaRemoteControl/ctrl', '<YAMAHA_AV cmd="PUT"><NET_RADIO><List_Control><Direct_Sel>Line_2</Direct_Sel></List_Control></NET_RADIO></YAMAHA_AV>')
fibaro:debug("réponse :"..response..status); fibaro:sleep(3000);
if errorCode == 0
then
fibaro:log('status'..status)
else
fibaro:log("error")
end
Je me demande s'il n'est pas possible d'envoyer plusieurs actions en une seule requette http, est-ce que quelqu'un a poussé jusque là ?
Get_RX-V775_G.txt
Put_RX-V775_G.txt