17.05.2017, 15:51
Maybe this? I made this script to mute my receiver when i go out:
Just change IP to your receiver and put the script in a event.
Code:
http = require("socket.http")
url_string = "http://192.168.0.43:80/YamahaRemoteControl/ctrl"
http.TIMEOUT = 5
value = event.getvalue()
if (value == false) then
post_request_body ='<?xml version="1.0" encoding="UTF-8"?><YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Mute>Off</Mute></Volume></Main_Zone></YAMAHA_AV>'
elseif (value == true) then
post_request_body ='<?xml version="1.0" encoding="UTF-8"?><YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Mute>On</Mute></Volume></Main_Zone></YAMAHA_AV>'
end
http.request(url_string, post_request_body)
Just change IP to your receiver and put the script in a event.