Yamaha Network Control Plugin using HTTP

a-lurker, just sent a PM with a download link of debug log in html format.

If you search for Volume=-45.5 you will find where I sent command.

Also the following is a data capture from the Android Yamaha app of the command sent for Volume.

Ok that all helped.

Minor problem in one of your scenes: You are using Zone=‘Main’ instead of Zone=‘Main_Zone’ when calling action SetInput for Input=‘AV3’

You are also using a slightly older version of the plugin ie Version 0.54 I would appreciate it if you could download ‘L_YamahaRxHTTP1.lua’ (before overwriting with the new one in this post) and zip it up and post it here, so I can remind myself of its differences.

There is a problem with the plugin: For reasons I don’t understand Zone 4 of your unit does not report the status of its Volume or the Mute settings. All the other Zones do. Perhaps they can’t be controlled for Zone 4? Consequently this cause problems. In the plugin variables you are probably missing Zone4Mute and Zone4Volume or if there, they have no values of any use. All the other zones should be OK.

Upload the new ‘L_YamahaRxHTTP1.lua’ in the zip file attached to this post. Once unzipped and uploaded and the Luup engine and browser is restarted it will show ‘Test 1’ as the version in the list of variables (instead of 0.54).

There is now a ‘DebugEnabled’ variable which will be ‘0’. It can be set to ‘1’ to enable verbose debugging. Requires a Luup engine and browser restart if changed.

See how it all goes.L_YamahaRxHTTP1.zip (6.7 KB)

Thanks,

SetVolume works now for all zones Main,2 and 3 ! Not sure what is going on with Main vs Main_Zone since I have always used Main for the Main Zone and never had a problem with AV3 or any of the inputs. I will change all of the Main calls to Main_Zone anyway.

Honestly I never used Zone 4 and don’t even have it implemented in my setup and Zone 4 in the android app does not come up with any volume controls so I am assuming it does not allow volume control as strange as that may seem.

Thanks again!

John

Sounds good. What happens if you try and set the volume or mute on Zone 4 via the plugin? See any errors in the log? Do you have all the Zone 4 variables listed like the other zones?

I’ll look at Main vs MainZone.

Zone 4 yields no change for mute and volume and the buttons for zone 4 on the official Yamaha web app the buttons come up blank for both so either its not supported or there is a problem with the app, firmware or both.

All the Zone 4 variables are there like for other Zones.

BTW you may have noticed in the log that there is a setHDMI variable. I had added that myself years ago since I needed the ability to turn off HDMI output on Zone 2 to off when my TV was off since the audio was cutting out intermittently when HDMI output was on when the TV was off. It did not seem to be a problem on the Main Zone but I implemented for Main as well anyway.

The attached shows the log for a Zone 4 Volume change.

a-lurker

What would be the HTTP request for this?

local YAMAHA_ID = your_unit_id_goes_here
local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”
luup.call_action(YAMAHA_SID, “SetVolume”, {Zone=‘1’, Volume=‘0’}, YAMAHA_ID)
return true

Thanks in advance.

On the Main Vs Main_Zone. Turns out I defaulted any zone naming the plugin doesn’t understand to Main_Zone.

If you have variables Zone4Mute and Zone4Volume you can delete them (AltUI makes that easy to do) and they probably won’t return. However they do no harm if they stay.

This URL may work: need to replace ‘Veras_ip_address’ and ‘Your_Device_Number_Here’ with the correct values.

http://Veras_ip_address:3480/data_request?id=lu_action&serviceId=urn:a-lurker-com:serviceId:YamahaRxHTTP1&action=SetVolume&Zone=1&Volume=0&DeviceNum=Your_Device_Number_Here

I don’t have the variables Zone4Mute and Zone4Volume, just Zone4Input and Zone4Power.

Thanks the HTTP request works.

I’m not sure if this is plugin is still being monitored but I am having an issue with the SetPower command. I’ve tried switching zones and volume levels which work fine.

Here is an example of the LUA code I ran in the debug window:

local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”
local YAMAHA_ID = 599
luup.call_action(YAMAHA_SID, “SetVolume”, {Zone=‘1’, Volume=‘-40’}, YAMAHA_ID)
luup.call_action(YAMAHA_SID, “SetInput”, {Zone=‘1’, Input=‘HDMI4’}, YAMAHA_ID)
luup.call_action(YAMAHA_SID, “SetPower”, {Zone = ‘Main_Zone’, ‘Standby’}, YAMAHA_ID)
return true

All the functions work except SetPower. I pulled the SetPower command out separately and get the following error in the log file
When I try to send the SetPower command I get the following error:

08 12/30/19 18:35:07.793 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x7111b520>
08 12/30/19 18:35:07.794 JobHandler_LuaUPnP::HandleActionRequest argument id=lu_action <0x7111b520>
08 12/30/19 18:35:07.794 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x7111b520>
08 12/30/19 18:35:07.794 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x7111b520>
08 12/30/19 18:35:07.794 JobHandler_LuaUPnP::HandleActionRequest argument Code=local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”
local YAMAHA_ID = 599
luup.call_action(YAMAHA_SID, “SetPower”, {Zone = ‘’, ‘On’}, YAMAHA_ID)
return true <0x7111b520>
01 12/30/19 18:35:07.795 LuaInterface::StartEngine failed run: 0 invalid key to ‘next’ <0x7111b520>
01 12/30/19 18:35:07.795 JobHandler_LuaUPnP::RunLua failed: local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”
local YAMAHA_ID = 599
luup.call_action(YAMAHA_SID, “SetPower”, {Zone = ‘’, ‘On’}, YAMAHA_ID)
return true <0x7111b520>

I know the receiver supports the command as I am using a separate python script to control the receiver and the SetPower command works.

My Lua skills are limited so despite trying to comb through the code I’m confused.

Any help appreciated.

Hi there.

I’m not near my PC stuff, due to the New Year. However, you need to post the log once the variable “DebugEnabled” is set to one. Need to do a Luup engine restart after setting it. Also need to know the model of your AVR.