Welcome to Smart Home Forum by FIBARO
Search the Community
Showing results for tags 'virtual device;'.
HI, Been wrestling with this for some time now so time to ask for help I'm trying to control my Yamaha Amp, no problem switching input sorces, scenes, on/off etc but when it comes to setting (and later reading) the volume I simply can't get it to work. I'm using a virtual device with a slider. In the LUA-code for the slider I've wrote the script below. When I change the slider the scripts works one in five times, the rest nothing happens. As far as I can tell it reads the slider value OK, the command sent is correct etc. To me it feels like I need to send some end command to the Yamaha but can't figure out how to do it. Any help or feedback is appreciated. Here is the script: local IPYamaha = "192.168.1.67" local pYamaha local cmdYamaha local YamahaValue YamahaValue = 8 * tonumber(_sliderValue_) YamahaValue = YamahaValue - 800 fibaro:log(tostring(YamahaValue)) cmdYamaha = '<YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Lvl><Val>' .. tostring(YamahaValue) .. '</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>' pYamaha = Net.FHttp(IPYamaha,80) response ,status, errorCode = pYamaha:POST('/YamahaRemoteControl/ctrl', cmdYamaha) fibaro:sleep(1000) if errorCode == 0 then fibaro:log('status'..status) else fibaro:log("error") end