Yamaha Network Control Plugin using HTTP

A Yamaha Network Control Plugin using HTTP to try out - it uses URL calls rather than a fixed socket connection to operate the AVR.

This plugin has the prime advantage of not requiring a Luup engine restart, if the Yamaha AVR loses mains power. Direct socket connections (as I understand it) cannot recover from a power loss of the remote device - apparently due to the design of the firmware, when using the functions in the luup io module: as of Vera Firmware Version 1.5.622 - Feb 2014.

Ver 0.51
This plugin has been tested using the Vera U15 interface and Firefox 26 only.

Installation for U15:
Go to U15–>APPS–>Develop Apps–>Luup files and upload the five files (ensuring to exclude the associated PDF).

Select the “Create device” button on the same page. Enter ‘D_YamahaRxHTTP1.xml’ into the ‘Upnp Device Filename’ entry box and select the ‘Create device’ button immediately below.

Do a reload(s) of the engine and the browser and once the device is established, go to the Advanced Tab and enter the IP address of the receiver. Do some more reload(s) of the engine and the browser!

Ver 0.52
This fixes a bug whereby the zone count would soon contain incorrect values stopping the plugin from functioning.

Existing users just need to update the L_YamahaRxHTTP1.lua and D_YamahaRxHTTP1.json file. The PDF has also been updated.

A link has been added for the “vTuner internet radio guide” as used by the Yamaha AVR.

Notes:

[ul][li]The plugin functions and parameters are case sensitive.[/li]
[li]Read the PDF and look at the linked spreadsheet in the PDF.[/li][/ul]

The attached PDF has further details on usage. The attached graphic shows the Actions available and their parameters. Bug reports welcome.

Ver 0.55

[ul][li]Minor fixes and additions[/li][/ul]

This code is on GitHub here:

You can install the plugin from the ‘Alternate App Store’, which works together with ‘ALTUI’:
http://forum.micasaverde.com/index.php/topic,38102.0.html
Delete any existing ‘Vera Plugin Yamaha RX HTTP’ device before installing from the ‘Alternate App Store’.

Note that ‘ALTUI’ is highly recommended to all users.

I was able to get the device created and have reloaded several times. I am still getting a Startup Lua Failed. I already entered the ip address. The advanced tab reports back some info. How do I set up the different zones? Should there be a power button or is this mostly to enable automation control?

I’ll upload them and test it out. I don’t know if having both versions uploaded into Vera will cause any conflicts ^^ but I’d love to test it out to see if it works.

I don’t think there will be issues having both installed. They are connecting on different ports so there shouldn’t be a conflict.

Thanks for this plugin! Works great.

Can I choose and play a specific internet radio station with luup code?

Good to hear it’s working for you.

Selecting net stations gets harder. The Yamaha uses a look up service:

http://vtuner.com/setupapp/guide/asp/BrowseStations/startpage.asp

for your Yamaha bookmarks and you need an account for bookmarks. Selecting a bookmark on the Yamaha invokes the look up service with your MAC address and it returns a m3u file that contains the URL the Yamaha is meant to play. The Yamaha then plays that URL.

It would be nice if you could just give the Yamaha a URL directly and tell it to play it - but it looks like it can’t and/or won’t allow this.

Likewise it would be good if you could use the presets on the Yamaha for net radio - my model doesn’t seem to allow this but I suspect some models do. The plugin can select a preset for any input but it may not work depending on model.

You could use a Yamaha scene to save one net radio station and just invoke that scene with plugin. The documentation for the Yamaha reckons you can have 15 scenes. But I can’t figure out you can set up any more than four or even if it’s possible to have more than four.

Another method: you can set the Yamaha input to “SERVER” and then use the DLNA plugin & proxy plugin to play any radio station you want. You need to set Advanced Tab → CheckStateRate in the DLNA plugin to say 10 (minutes), so it knows if the Yamaha is off or not. If you need info on the DLNA plugin, ask in that thread, as it gets complicated.

If you can get presets working for net radio please let us know how you did it and what your model is.

Greetings a-lurker. I am curious if this method using a browser works remotely? I was asking on another thread if anyone had gotten the Yamaha receiver plugin to work from Vera Mobile and one person mentioned this method. I can’t tell if this is for remote use or not? I can use the Vera console to control it and the Yamaha app when local but nothing when I’m away. If it does work remotely, I suspect you have to do port forwarding? I’m hoping to not have to do that, though.

Thank you in advance for your response.

With the mobile apps, the app writer has to support the plugin. Typically the more generic stuff is supported eg on/of swiches, dimmers, etc. You might be able to set a scene to do what you want and then execute the scene with the mobile app. Hope that helps.

Thank you for your reply. Yeah, I can’t seem to do anything with Vera mobile. I have created a scene, however, that turns it on and sets it to Pandora and can run that from mobile. Thank you, again.

Thank you! Thank you! Thank you!

I was messing around with the other Yamaha plugin for days with no luck on my RX-v577.

I followed your instructions to a T and everything is working perfectly!!!

Any chance of adding this to the official App store so that we can get automatic updates?

I must be dense. Installed version 0.52 but it does not seem the service is running as per the log below. What am I missing?

01 08/10/14 19:02:49.851 JobHandler_LuaUPnP::HandleActionRequest can't find urn:alurkercom:serviceId:YamahaRxHTTP1 <0x307b1680> 02 08/10/14 19:02:49.851 JobHandler_LuaUPnP::RunAction device 88 action urn:alurkercom:serviceId:YamahaRxHTTP1/SetMute failed with 401/Invalid Service <0x307b1680>

One of my 2 Yamaha receivers is having a not too stable wireless connection so I wanted to try this plugin out on that one to stope having to reload the LUUP engine.

I get the same ‘ERROR: Invalid service’ when I try to access it using the URL from the PDF.

Receiver is a RX-V575 that works fine with the other plug-in I can get to it’s internal website and I can also control it via the other plugin.

Update: When copying the URL out of the PDF, it lost the ‘-’ in the service ID. Duh!
Nice job. Thanks!

Greetings

Just checking to see if anybody has done anything to make this plugin work on UI7.

I wrote this for U15. No idea whether it works with U17. It probably should but there may be web page layout problems? May be someone who has tried it on U17 can let us know the result.

Could u please add power on and off to it? It would be great if I could control the power from remote, and use sonos+tts to yell on my dog or something funny when not home

@jolerius

This is plugin is primarily designed to be used by scenes and it pretty much allows full control of any of the models, over any number of zones.

So you can go back and forth between Standby and Power by using scenes. Refer to the PDF in the first post in this thread.

Make a “Yamaha On” scene and place this in the LUUP section of the scene, replacing “the_ID_of_you_Yamaha_plugin” with the appropriate number:

[code]local YAMAHA_ID = the_ID_of_you_Yamaha_plugin
local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”

luup.call_action(YAMAHA_SID, “SetPower”, {Zone=“1”, Power=“On”}, YAMAHA_ID)

return false[/code]

An a “Yamaha to Standby” scene: place this in the LUUP section of the scene:

[code]local YAMAHA_ID = the_ID_of_you_Yamaha_plugin
local YAMAHA_SID = “urn:a-lurker-com:serviceId:YamahaRxHTTP1”

luup.call_action(YAMAHA_SID, “SetPower”, {Zone=“1”, Power=“Standby”}, YAMAHA_ID)

return false[/code]

Run the scenes as needed.

this doesnt work in UI7. Can’t find the device when trying to create a scene

I can confirm the plugin is indeed compatible with UI7. AsI have 2 Yamaha’s I control via this plugin in Ui7 without issues. The plugin has to be manually loaded and then you have to create the devices. There is no automated device creation as the plugin at this time is not available via the app store.

I did create the device… And the device seems to be working… But I cant pick the decice when creating a scene…it isn’t there to be picked…

But are all the events available when creating or editing scenes? In the scene editor GUI or advanced tab?

Now it’s working. Just me who haven’t figured out UI7 completely yet.

But is it possible to make like a drop down menu to select things in scene creation. I mean like inputs and other things so we don’t have to write it manually?