Yamahareceiver zone discovery not working with RX-V3900

Sorry, I don’t entirely follow your example.

I looked at the device descriptor I have for RX-V3900 and it doesn’t have NET RADIO but instead something like NET_USB, which is not anywhere in the binding. Threrfore, you would have to provide the value of NET USB for the input channel. Aside from that, inputs that seem to give playback options are Bluetooth, iPod.

Furthermore, form the descriptor, the play/pause/next/prev commands have a different structure (yet another difference) and will require another compatibility detection added to the addon to make it work.

We will have to do some back and forth testing to add basic support for playback. Please provide me with your responses for these commands. I will try to prepare a new version.

<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><NET_USB><Play_Info>GetParam</Play_Info></NET_USB></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Bluetooth><Play_Info>GetParam</Play_Info></Bluetooth></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><iPod><Play_Info>GetParam</Play_Info></iPod></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Main_Zone><Input><Input_Sel_Item>GetParam</Input_Sel_Item></Input></Main_Zone></YAMAHA_AV>

here you are:

<YAMAHA_AV rsp="GET" RC="0"><NET_USB><Play_Info><SubInput>NET RADIO</SubInput><Status>Stop</Status><Play_Mode><Repeat>All</Repeat><Shuffle>Off</Shuffle></Play_Mode><Title><Artist></Artist><Album></Album><Song></Song></Title></Play_Info></NET_USB></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"><Bluetooth><Play_Info><Status>Not Connected</Status></Play_Info></Bluetooth></YAMAHA_AV>```
<YAMAHA_AV rsp="GET" RC="0"><iPod><Play_Info><Status>Not Connected</Status><Play_Mode><Control>Normal</Control><Repeat>Off</Repeat><Shuffle>Off</Shuffle></Play_Mode><Title><Artist></Artist><Album></Album><Song></Song></Title></Play_Info></iPod></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"><Main_Zone><Input><Input_Sel_Item><Item_1><Param>NET RADIO</Param><RW>RW</RW><Title>NET RADIO</Title><Icon><On>/YamahaRemoteControl/Icons/icon39.png</On><Off>/YamahaRemoteControl/Icons/icon38.png</Off></Icon><Src_Name>NET_USB</Src_Name><Src_Number>1</Src_Number></Item_1><Item_2><Param>PC/MCX</Param><RW>RW</RW><Title>PC/MCX</Title><Icon><On>/YamahaRemoteControl/Icons/icon37.png</On><Off>/YamahaRemoteControl/Icons/icon36.png</Off></Icon><Src_Name>NET_USB</Src_Name><Src_Number>1</Src_Number></Item_2><Item_3><Param>DOCK</Param><RW>W</RW><Title>DOCK</Title><Icon><On>/YamahaRemoteControl/Icons/icon25.png</On><Off>/YamahaRemoteControl/Icons/icon24.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_3><Item_4><Param>iPod</Param><RW>R</RW><Title>iPod</Title><Icon><On>/YamahaRemoteControl/Icons/icon33.png</On><Off>/YamahaRemoteControl/Icons/icon32.png</Off></Icon><Src_Name>iPod</Src_Name><Src_Number>1</Src_Number></Item_4><Item_5><Param>Bluetooth</Param><RW>R</RW><Title>Bluetooth</Title><Icon><On>/YamahaRemoteControl/Icons/icon35.png</On><Off>/YamahaRemoteControl/Icons/icon34.png</Off></Icon><Src_Name>Bluetooth</Src_Name><Src_Number>1</Src_Number></Item_5><Item_6><Param>USB</Param><RW>RW</RW><Title>USB</Title><Icon><On>/YamahaRemoteControl/Icons/icon41.png</On><Off>/YamahaRemoteControl/Icons/icon40.png</Off></Icon><Src_Name>NET_USB</Src_Name><Src_Number>1</Src_Number></Item_6><Item_7><Param>TUNER</Param><RW>RW</RW><Title>TUNER</Title><Icon><On>/YamahaRemoteControl/Icons/icon01.png</On><Off>/YamahaRemoteControl/Icons/icon00.png</Off></Icon><Src_Name>Tuner</Src_Name><Src_Number>1</Src_Number></Item_7><Item_8><Param>CBL/SAT</Param><RW>RW</RW><Title>CBL/SAT</Title><Icon><On>/YamahaRemoteControl/Icons/icon17.png</On><Off>/YamahaRemoteControl/Icons/icon16.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_8><Item_9><Param>BD/HD DVD</Param><RW>RW</RW><Title>BD/HD DVD</Title><Icon><On>/YamahaRemoteControl/Icons/icon13.png</On><Off>/YamahaRemoteControl/Icons/icon12.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_9><Item_10><Param>V-AUX</Param><RW>RW</RW><Title>VIDEO AUX</Title><Icon><On>/YamahaRemoteControl/Icons/icon23.png</On><Off>/YamahaRemoteControl/Icons/icon22.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_10><Item_11><Param>DVD</Param><RW>RW</RW><Title>DVD</Title><Icon><On>/YamahaRemoteControl/Icons/icon15.png</On><Off>/YamahaRemoteControl/Icons/icon14.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_11><Item_12><Param>CD</Param><RW>RW</RW><Title>CD</Title><Icon><On>/YamahaRemoteControl/Icons/icon07.png</On><Off>/YamahaRemoteControl/Icons/icon06.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_12><Item_13><Param>DVR</Param><RW>RW</RW><Title>DVR</Title><Icon><On>/YamahaRemoteControl/Icons/icon19.png</On><Off>/YamahaRemoteControl/Icons/icon18.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_13><Item_14><Param>TV</Param><RW>RW</RW><Title>TV</Title><Icon><On>/YamahaRemoteControl/Icons/icon09.png</On><Off>/YamahaRemoteControl/Icons/icon08.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_14><Item_15><Param>VCR</Param><RW>RW</RW><Title>VCR</Title><Icon><On>/YamahaRemoteControl/Icons/icon21.png</On><Off>/YamahaRemoteControl/Icons/icon20.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_15><Item_16><Param>PHONO</Param><RW>RW</RW><Title>PHONO</Title><Icon><On>/YamahaRemoteControl/Icons/icon05.png</On><Off>/YamahaRemoteControl/Icons/icon04.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_16><Item_17><Param>MD/CD-R</Param><RW>RW</RW><Title>MD/CD-R</Title><Icon><On>/YamahaRemoteControl/Icons/icon11.png</On><Off>/YamahaRemoteControl/Icons/icon10.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_17><Item_18><Param>MULTI CH</Param><RW>RW</RW><Title>MULTI CH</Title><Icon><On>/YamahaRemoteControl/Icons/icon03.png</On><Off>/YamahaRemoteControl/Icons/icon02.png</Off></Icon><Src_Name></Src_Name><Src_Number>1</Src_Number></Item_18></Input_Sel_Item></Input></Main_Zone></YAMAHA_AV>

What I meant was that (when looking at wireshark trace while testing with yamaha web ui) playback controls to both NET_RADIO and USB are the same. They both are using NET_USB and not the input name (NET_RADIO or USB) in the commands. Something else might work also, but that is what their own UI is doing. I don’t have iPod dock anymore nor bluetooth module so I cannot test those.

I made more changes for RX-V3900:

  • For NET RADIO and USB inputs it will use the underlying NET_USB.
  • Basic playback Play, Stop, Pause, Previous, Next should work. I noticed on my AVR that Pause has no effect on NET RADIO but works for Spotify input.
  • The track title should come as well

Also, I added the album URL to NET RADIO input, but it is not supported by RX-V3900.

Please give it a try and let me know.

I tested with NET RADIO and it works as it should. Title shows the name of played station and also Track picture url has something that looks like jpeg data stream. Here is the begining of it:

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD//gBKRmlsZSBzb3VyY2U6IGh0dHBzOi

Play and stop work as they should. To test other things I need dig up some old mp3 files and put them on USB stick, no spotify on this old warhorse.

What does not work is presets. It tries to send preset change o NET_RADIO in stead of NET_USB. Changing preset does not work in TUNER input either so I guess there is something different here for v3900 also. Also in tuner mode Station text field is empty, is it populated in newer receivers?

Thanks for testing this.

The provided picture URL is actually an embedded default picture which is assigned when the tuner does not provide song pictures (e.g RX-V3900).

Regarding the tuner preset and song, it is a bit strange as I don’t see any incompatibility. Also, your model has band selection AM/FM, but the tuner_band channel is not handled for RX-V3900 - it works for DAB+ enabled models which I use. I would have to add support for the band channel for you.

Can you put some tuner radio on, make sure you have at least two presets, and then send the response for these requests:

<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Tuner><Play_Info>GetParam</Play_Info></Tuner></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Tuner><Play_Control>GetParam</Play_Control></Tuner></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Tuner><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></Tuner></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><Tuner><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></Tuner></YAMAHA_AV>

Also please put some net radio on, you have at least two presets defined and post these:

<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><NET_USB><Play_Info>GetParam</Play_Info></NET_USB></YAMAHA_AV>

(^ for this one you sent me the response earlier, but your Yamaha was not in net radio mode, so it was pretty much empty)

<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><NET_USB><Play_Control>GetParam</Play_Control></NET_USB></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><NET_USB><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></NET_USB></YAMAHA_AV>
<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="GET"><NET_USB><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></NET_USB></YAMAHA_AV>

Once I have that, I will prep another set of changes.

EDIT2:

I think we are left with two issues for RX-V3900 which I can further improve:

  • Fix the preset for tuner on RX-V3900.
  • Add capability for tuner_band channel (right now it is only supported for DAB+ enabled tuners which RX-V3900 is not). The question is are any users toggling between AM and FM these days.

EDIT3:

Added more XMLs above.

Here you are, responses in same order. First Tuner:

<YAMAHA_AV rsp="GET" RC="0"><Tuner><Play_Info><Search_Mode>Preset</Search_Mode><Preset>A1</Preset><Preset_Sel_Title>FM 98.10MHz</Preset_Sel_Title><Tuning><Band>FM</Band><Freq><Val>9810</Val><Exp>2</Exp><Unit>MHz</Unit></Freq></Tuning><Stereo_Mono>Auto</Stereo_Mono><Receive_Status><Tuned>Assert</Tuned><Stereo>Assert</Stereo></Receive_Status><RDS><Program_Type>POP_M</Program_Type><Program_Service>SUOMIPOP</Program_Service><Radio_Text_A></Radio_Text_A><Radio_Text_B></Radio_Text_B><Clock_Time>0:0</Clock_Time><EON>Assert</EON></RDS></Play_Info></Tuner></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="2"></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"><Tuner><Play_Control><Preset><Preset_Sel_Item><Item_1><Param>Not Used</Param><RW>R</RW><Title></Title></Item_1><Item_2><Param>A1</Param><RW>RW</RW><Title>A1</Title></Item_2><Item_3><Param>A2</Param><RW>RW</RW><Title>A2</Title></Item_3><Item_4><Param>A3</Param><RW>RW</RW><Title>A3</Title></Item_4><Item_5><Param>A4</Param><RW>RW</RW><Title>A4</Title></Item_5><Item_6><Param>A5</Param><RW>RW</RW><Title>A5</Title></Item_6><Item_7><Param>A6</Param><RW>RW</RW><Title>A6</Title></Item_7><Item_8><Param>A7</Param><RW>RW</RW><Title>A7</Title></Item_8><Item_9><Param>A8</Param><RW>RW</RW><Title>A8</Title></Item_9><Item_10><Param>B1</Param><RW>RW</RW><Title>B1</Title></Item_10><Item_11><Param>B2</Param><RW>RW</RW><Title>B2</Title></Item_11><Item_12><Param>B3</Param><RW>RW</RW><Title>B3</Title></Item_12><Item_13><Param>B4</Param><RW>RW</RW><Title>B4</Title></Item_13><Item_14><Param>B5</Param><RW>RW</RW><Title>B5</Title></Item_14><Item_15><Param>B6</Param><RW>RW</RW><Title>B6</Title></Item_15><Item_16><Param>B7</Param><RW>RW</RW><Title>B7</Title></Item_16><Item_17><Param>B8</Param><RW>RW</RW><Title>B8</Title></Item_17></Preset_Sel_Item></Preset></Play_Control></Tuner></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"><Tuner><Play_Control><Preset><Preset_Sel>A1</Preset_Sel></Preset></Play_Control></Tuner></YAMAHA_AV>

and then NET_RADIO:

<YAMAHA_AV rsp="GET" RC="0"><NET_USB><Play_Info><SubInput>NET RADIO</SubInput><Status>Play</Status><Play_Mode><Repeat>All</Repeat><Shuffle>Off</Shuffle></Play_Mode><Title><Artist></Artist><Album></Album><Song>SuomiPOP 98.1</Song></Title></Play_Info></NET_USB></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="2"></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"><NET_USB><Play_Control><Preset><Preset_Sel_Item><Item_1><Param>B1</Param><RW>W</RW><Title>1 :NET RADIO</Title></Item_1><Item_2><Param>B2</Param><RW>W</RW><Title>2 :NET RADIO</Title></Item_2><Item_3><Param>B3</Param><RW>W</RW><Title>3 :NET RADIO</Title></Item_3><Item_4><Param>B4</Param><RW>W</RW><Title>4 :NET RADIO</Title></Item_4><Item_5><Param>B5</Param><RW>W</RW><Title>5 :NET RADIO</Title></Item_5><Item_6><Param>B6</Param><RW>W</RW><Title>6 :NET RADIO</Title></Item_6></Preset_Sel_Item></Preset></Play_Control></NET_USB></YAMAHA_AV>
<YAMAHA_AV rsp="GET" RC="0"></YAMAHA_AV>

Regarding issues presets are useful issue to fix, but I agree that FM/AM switching is not really worth the effort. Unless someone of course proves us wrong, but I doubt that.

Thanks for this. I made the changes, please give it a try. Some things to know:

  • When in NET RADIO input the preset channel will be write only. There seem to be no way on my model and RX-V3900 to get the currently selected preset. Also I see the same behaviour in the native Yamaha AV Controller app.
  • From your XML samples, it seems that RX-V3900 names the presets like A1, A2, B1, B2 for TUNER input. This is specially tricky as the preset channel on the binding is of numeric type. To make it work for this AVR model, I had to do special handling where A1 becomes 101, A2 becomes 102, B1 becomes 201, etc. So if you want to set preset A1, send 101 number in the preset channel. The documentation on my branch has been updated. Let me know if this is clear for users how to use it.
  • For TUNER input the station name should also be visible.

I leave the tuner band selection out of scope.

My hopes are that this is the last compatibility improvement for RX-V3900 :slight_smile:

Sorry it took awhile, but here are some findings.

  • Station name is still missing for TUNER input
  • Presets do not work for TUNER input. In paperUI it correctly lists presets as A1,A2…B1 etc and gets the right preset from receiver (ie 101). When changing the preset it tries to send 2 for A1. here is the log:
2018-05-31 22:07:42.525 [ome.event.ItemCommandEvent] - Item 'RXV3900Main_Zone_Playback_channels_Preset' received command 2
2018-05-31 22:07:42.534 [vent.ItemStateChangedEvent] - RXV3900Main_Zone_Playback_channels_Preset changed from 101 to 2
2018-05-31 22:07:42.607 [hingStatusInfoChangedEvent] - 'yamahareceiver:zone:5386e9f7:Main_Zone' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Changing a value on the Yamaha AVR failed: <?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><Tuner><Play_Control><Preset><Preset_Sel>2</Preset_Sel></Preset></Play_Control></Tuner></YAMAHA_AV>

Do I need to set it up somehow or should it just work?
EDIT: sending this works as it should, only difference is A1 instead 2

<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><Tuner><Play_Control><Preset><Preset_Sel>A1</Preset_Sel></Preset></Play_Control></Tuner></YAMAHA_AV>

Also for NET_RADIO presets do not work:

2018-05-31 22:09:39.888 [ome.event.ItemCommandEvent] - Item 'RXV3900Main_Zone_Playback_channels_Preset' received command 2
2018-05-31 22:09:39.896 [vent.ItemStateChangedEvent] - RXV3900Main_Zone_Playback_channels_Preset changed from -1 to 2
2018-05-31 22:09:39.929 [hingStatusInfoChangedEvent] - 'yamahareceiver:zone:5386e9f7:Main_Zone' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Changing a value on the Yamaha AVR failed: <?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><NET_USB><Play_Control><Preset><Preset_Sel>2</Preset_Sel></Preset></Play_Control></NET_USB></YAMAHA_AV>
2018-05-31 22:09:40.208 [me.event.ThingUpdatedEvent] - Thing 'yamahareceiver:zone:5386e9f7:Main_Zone' has been updated.
2018-05-31 22:09:40.213 [vent.ItemStateChangedEvent] - RXV3900Main_Zone_Playback_channels_Preset changed from 2 to -1

EDIT: It looks like NET_RADIO presets are B1,B2, etc. I tested and this works:

 <?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd="PUT"><NET_USB><Play_Control><Preset><Preset_Sel>B1</Preset_Sel></Preset></Play_Control></NET_USB></YAMAHA_AV>

and selects the first preset, and B2 selects the second preset.

@mikkov1 my apologies to keep you waiting :wink:

Regarding Tuner and Station, are you sure the station is not populated?
My test passes based on the sample XML you provided - “SUOMIPOP” is the station name.
Maybe give it some time, as RDS needs time to arrive over FM, on top of that there is this refresh (default 60 seconds) until the addon reads any changes from the AVR. Also double check you look at the station channel.

Regarding the preset for TUNER / NET RADIO, yes this was a miss on my end. For some reason, I cannot see the zone thing in PaperUI on my installation. This should be fixed now, so please test via PaperUI.
My expectation was, that people are really using the .sitemap & .items configs, please try to test this sitemap example:

Selection	item=Yamaha_Preset mappings=[101="For A1 on Tuner",102="For A2",201="For B1"] visibility=[Yamaha_Input=="TUNER"]
Selection	item=Yamaha_Preset mappings=[101="For A1 on NET",102="For A2",201="For B1"] visibility=[Yamaha_Input=="NET RADIO"]

Please let me know your findings.

Pull request here