Yamaha NetRadio binding

Hello,

I have a Yamaha RX-V477 networked receiver. I am looking for a bit of explanation as to how the netRadio binding works. The example on the openhab wiki shows a mapping in the sitemap, but how do I set this up on my receiver?

The example shows the following in the sitemap:
Selection item=Yamaha_NetRadio label="Sender" mappings=[1="N Joy", 2="Radio Sport", 3="RDU", 4="91ZM", 5="Hauraki"]

Presumably, the numbers correspond to bookmarked stations on my receiver. On the receiver, I select Bookmarks > My_favorites and then there is a list of my favorite stations. But selecting a station in OpenHAB doesn’t appear to have any effect on the receiver. What am I doing wrong?

Thanks for your time.

1 Like

If you change the NetRadio Stations from within your Yamaha, do you see any logs belonging to? For example, if I set the Input from mine, I see this:

2016-04-20 16:45:32 - Yamaha_Input state updated to HDMI2

As I don’t use NetRadio at all, I don’t know, but expect something similar for this feature. Once you know, what the Yamaha binding transmitted, you can try to send this to your Yamaha Receiver.

Starting with the receiver off and turning it on via openhab sitemap:

13:12:57.383 [INFO ] [runtime.busevents :26 ] - Yamaha_Power state updated to OFF 13:12:57.391 [INFO ] [runtime.busevents :26 ] - Yamaha_Mute state updated to OFF 13:12:57.399 [INFO ] [runtime.busevents :26 ] - Yamaha_Input state updated to NET RADIO 13:12:57.407 [INFO ] [runtime.busevents :26 ] - Yamaha_Surround state updated to 5ch Stereo 13:13:14.182 [INFO ] [runtime.busevents :22 ] - Yamaha_Power received command ON 13:13:14.186 [DEBUG] [.o.b.y.i.YamahaReceiverBinding:166 ] - YamahaReceiverBinding processing command 'ON' of type 'OnOffType' for item 'Yamaha_Power'

Then changing the station via the sitemap:
13:13:27.004 [INFO ] [runtime.busevents :22 ] - Yamaha_NetRadio received command 1 13:13:27.008 [DEBUG] [.o.b.y.i.YamahaReceiverBinding:166 ] - YamahaReceiverBinding processing command '1' of type 'DecimalType' for item 'Yamaha_NetRadio'

I get no status updates from the receiver for item Yamaha_NetRadio, which is defined thusly:

Number Yamaha_NetRadio "Net Radio" (receiver) { yamahareceiver="uid=living, zone=main, bindingType=netRadio" }

Evidently, the netRadio bound item is not being updated from the receiver. I think that something must be wrong in the Yamaha Receiver binding source code. Changing the station on the receiver itself produces no output in the logs, so it is not connected to the Yamaha_NetRadio item.

Did a little more digging:

In the source code for the Yamaha Receiver Binding on github (here), specifically this file. the function setNetRadio (line 93) has the following definition:
public void setNetRadio(int lineNo) throws IOException { /* Jump to specified line in preset list */ postAndGetResponse( "<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><Play_Control><Preset><Preset_Sel>" + lineNo + "</Preset_Sel></Preset></Play_Control></NET_RADIO></YAMAHA_AV>"); }

I used a packet sniffer on my phone along with the Yamaha app to see what the Yamaha app sends to the receiver. It sends:

<YAMAHA_AV cmd="PUT"><NET_RADIO><List_Control><Direct_Sel>Line_2</Direct_Sel></List_Control></NET_RADIO></YAMAHA_AV>

So, at least for my receiver, it should send <List_Control><Direct_Sel>Line_2</Direct_Sel></List_Control> instead of `<Play_Control><Preset_Sel>"

  • lineNo + "</Preset_Sel></Play_Control>`

Any tips on how I can test this? I have looked into compiling my own binding for openhab 1.8, but I am not sure where the correct information is. Any help there would be appreciated.

Any thoughts here, @ben_jones12?

It looks like there might be different formats for different Yamaha
devices. Someone else had some issues with this from memory, way back
when this binding was first added.

I personally don’t use NetRadio on mine so have never tested it (RX-A2020).

Sorry I can’t be of more help - I am very much time constrained these
days with a 7 week old baby taking up all my spare time!!

I’d say your hands are full! Congrats to you and the mother!

Congrats Ben!

I can put a little more work into. After doing some more packet sniffing between the Yamaha Android app and the RX-V477, it appears the new commands I posted are relative to a menu structure. So the app queries a menu tree and selects different line numbers to navigate through. I am not sure if there is a direct command to change the station from any starting state of the receiver. As far as I know, Yamaha have not released an API detailing how this works.

It is also a bit scary that I can send packets from any computer in my network and change, well, anything on the receiver. I don’t even have to spoof the App in any way. Just sent them from my Windows PC using “Packet Sender.” Now it is just a matter of figuring out the best way to do this in OpenHAB. It seems a bit clunky and inelegant to navigate through the menus using SendHTTPRequestPost to get to the “favorite stations” menu.

Hello, I have the same problem.
I saw that the yamaha bindings for openhab2 has changed a lot, but I can not install openhab2 on my Qnap Nas.
So I’m looking for this solutions to continue using version 1.8.
Can you tell me, please, how you sends packet to yamaha to change the status of NetRadio via http ???
Or if you’ve find a solution for yamahabinding???

Hi,

I’ve enhanced the Yamaha Binding to support menu-based netradio navigation. Here’s the pull request. Hope you like it.

Hi Dennis,

I have the current/beta4 Yamaha binding working perfectly on my rpi3/offlineOH2/RX-A730 installation… except for the Netradio selection. I’m no programmer so I’m not well versed in github, and how ultimately your code will arrive on my installation. From your code I understand I’ll have to define extra channels/items, really easy :slight_smile:
Is there some way I can import your menubased navigation NOW, or do I have to wait for beta5, or wait for the other people who initiated/contributed the binding to accept your enhancements ?

For my personal interest, why is there no binding for “FM radio” selection. It is yet another source on the yamaha, maybe because yamaha have no api implemented.

thx for any pointers (from anybody)
Ward

Here you can find the documentation of Yamahas Musiccast API:

https://jayvee.com.au/downloads/commands/yamaha/YXC_API_Spec_Basic.pdf

chris

Hello dfrommi,

do you have a compiled jar for us, until its merged?

Many thanks,

Herbert

Hey all,

I have finally reviewed all yamaha receiver pull requests and hopefully the authors can quickly respond to my change requests and the changes can be made available for the public.

Thanks,
David

1 Like

Anyone got this working?
I’d like to be able to select NetRadio stations from my OH install / Bookmarks (pretty please tell me you have)

Hey Alan,

I do not use NET RADIO myself, but you should be able to change the stations using the preset channel. For an example how to use the preset for TUNER see here.

Just as heads up, there is a bug 2758 in 2.2.0 that might not handle the preset channel properly due to NET RADIO to NET_RADIO forced conversion. I have a fix for this and will file a PR in few weeks. Nevertheless, give it a try on your version and let me know.

What is your OH version and what is your config (.items, .sitemap)?

Thanks Tomasz I’ll ping an update tmrw - I was on 2.2(1050) and updated to try get past this - but had issues with the 2.3.0 snapshot - rolled back to a newer 2.2.0 - but haven’t resolved this yet.

I’m not too bothered about the site map - since pretty much everything is voice (alexa / HomeKit) or fully automated based on sensors / timers.

So all I need is ‘trigger this change to get item playing on net radio.

For now, all I can do is play the last netradio source (but I have several stations I’d like to make accessible)