New bindings for Insteon Hub, Yamaha Receiver, Sharp TV, and Radio Thermostat

2581 views
Skip to first unread message

ejt...@gmail.com

unread,
Oct 18, 2013, 5:08:13 PM10/18/13
to ope...@googlegroups.com
I've implemented bindings for Insteon Hub, Yamaha Receiver, Sharp TV, and Radio Thermostat.  I am currently personally using all 4 of them.  If you are interested in trying them out, you can find the code in this repo: https://github.com/ejthill/openhab

If you find any bugs, please let me know.  Keep in mind that this code is very new and is by no means an official release.
  
For Insteon, I've tested this on Hub Version "4.8A Build Fed 08 2013".  The old API that I found online did not work with my relatively new hardware.  After some time with Wireshark I seem to have got everything working for wall switches/dimmers using the new API.



Example config:
### Yamaha Receiver ###
yamahareceiver:basement.host=10.0.0.2

### Sharp TV ###
sharptv:basement.host=10.0.0.3
sharptv:basement.port=3700
sharptv:basement.user=username
sharptv:basement.pass=password

### Radio Thermostat ###
radiothermostat:host=10.0.0.4

### Insteon Hub ###
insteonhub:host=10.0.0.5
insteonhub:user=username
insteonhub:pass=password


Example items (check the code for more... these are what I am currently using):
### Yamaha Receiver Items ###
Switch BsmtReceiver_Power "Receiver Power" <power> (Basement) { yamahareceiver = "uid=basement, bindingType=power" }
String BsmtReceiver_Input "Receiver Input" <video> (Basement) { yamahareceiver = "uid=basement, bindingType=input" }
Dimmer BsmtReceiver_VolumePercent "Volume [%.1f]" <volume> (Basement) { yamahareceiver = "uid=basement, bindingType=volumePercent" }
Switch BsmtReceiver_Mute "Mute" <mute> (Basement) { yamahareceiver = "uid=basement, bindingType=mute" }
String BsmtReceiver_SurroundProgram "Surround Program" <volume> (Basement) { yamahareceiver = "uid=basement, bindingType=surroundProgram" }

### Sharp TV Items ###
Switch BsmtTV_Power "TV Power" <power> (Basement) { sharptv = "uid=basement, bindingType=power" }
String BsmtTV_Input "TV Input" <video> (Basement) { sharptv = "uid=basement, bindingType=input" }

### Insteon Hub Items ###
Dimmer LivingRoom_CeilingLights "Living Room Ceiling Lights" <slider> (Living Room) { insteonhub = "bindingType=analog, device=11.22.AA" }
Dimmer Den_CeilingLight "Den Main Light" <slider> (Den) { insteonhub = "bindingType=analog, device=33.44.BB" }
Dimmer Kitchen_Lights "Kitchen Lights" <slider> (Kitchen) { insteonhub = "bindingType=analog, device=55.66.CC" }

### Radio Thermostat Items ###
String HVAC_FanMode "Fan Mode" <wind> (HVAC) { radiothermostat = "bindingType=fanMode" }
Number HVAC_TargetTemp "Target Temperature [%.1f]" <temperature> (HVAC) { radiothermostat = "bindingType=targetTemperature" }
String HVAC_HvacMode "HVAC Mode" <heating> (HVAC) { radiothermostat = "bindingType=hvacMode" }
Number HVAC_MeasuredTemp "Measured Temperature [%.1f]" <temperature> (HVAC) { radiothermostat = "bindingType=targetTemperature" }
Number HVAC_FanState "Fan State [%s]" <wind> (HVAC) { radiothermostat = "bindingType=fan" }
Switch HVAC_Hold "Hold" <lock> (HVAC) { radiothermostat = "bindingType=hold" }


Kai Kreuzer

unread,
Oct 19, 2013, 2:38:40 AM10/19/13
to ope...@googlegroups.com
Hi,

Cool, great stuff!
Would you mind creating one pull request for each binding?

Regards,
Kai


--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.

ejt...@gmail.com

unread,
Oct 20, 2013, 10:48:05 AM10/20/13
to ope...@googlegroups.com
Sure. No problem. I'll just make a separate branch for each one and then you can pull by branch depending what binding you want. I should have time later today or tomorrow night (USA CST time zone). Will post here when complete.

Will look like this when complete (let me know if this doesn't work for you):
master: latest clone of upstream master I'm working with
integration: master + stable state of all of my bindings (this is mostly just for my use)
insteonhub: master + Insteon Hub Binding dev
radiothermostat: master + Radio Thermostat Binding dev
sharptv: master + Sharp TV binding dev
yamahareceiver: master + Yamaha Receiver binding dev

I'm planning to buy a few more unsupported devices in the future as well, so I'll just continue to follow this workflow for new bindings in my repo... if it works for you guys, that is.

ejt...@gmail.com

unread,
Oct 20, 2013, 12:19:06 PM10/20/13
to ope...@googlegroups.com
And if you need, I'll create different pull requests as well... Not a big deal either way.

Kai Kreuzer

unread,
Oct 20, 2013, 2:35:44 PM10/20/13
to ope...@googlegroups.com
Would be wonderful, thanks :-)

Am Oct 20, 2013 um 6:19 PM schrieb ejt...@gmail.com:

> And if you need, I'll create different pull requests as well... Not a big deal either way.
>

ejt...@gmail.com

unread,
Oct 21, 2013, 6:28:56 PM10/21/13
to ope...@googlegroups.com
Created a pull request for the Insteon Hub Binding: https://github.com/openhab/openhab/pull/49

I'll do pull requests for the rest after some more testing this week.  The yamahareceiver and sharptv have a lot of different items that I haven't fully put through the paces yet.

-E

Timoh

unread,
Oct 24, 2013, 11:37:27 AM10/24/13
to ope...@googlegroups.com
Hi Eric,
Is that the Radio Thermostat as in CT30?  If so, great!  I can't wait to try it out!
Tim

Taisto Onnela

unread,
Mar 4, 2014, 1:46:25 PM3/4/14
to ope...@googlegroups.com
Hi, would like to test the Yamaha binding, where do I find it ?

best regs
Taisto Onnela

b...@benwardwell.com

unread,
Mar 9, 2014, 10:50:05 PM3/9/14
to ope...@googlegroups.com
I was looking around to see if anyone else had started a Yamaha Binding.
I can not seem to find the binding.

Udo Hartmann

unread,
Apr 12, 2014, 12:56:39 PM4/12/14
to ope...@googlegroups.com
I own a Yamaha RX-V575 and would like to know, if this model will be supported, my device can be controlled with android-app "AV CONTROLLER" (there are different Apps for different Devices)
Is there a way to get the "ready-to-use"-file
(org.openhab.binding.yamahareceiver.jar would be the name?) because I'm willing to beta-test, but not familiar with java Development...

Ben Jones

unread,
Jul 5, 2014, 8:09:40 PM7/5/14
to ope...@googlegroups.com
Hey Eric - I have just taken ownership of a Yamaha RX-A2020 so wanted to automate it using openHAB. I hope you don't mind but I have taken your code for the YamahaReceiver binding and added support for multiple zones - and created a pull request. It is pretty much all your code aside from the extra stuff to handle zone selection. Thanks for the awesome work on it, I have made sure your name remains at the top of the 'contributors' list!

Anyone else interested in this binding sing out. The only change in terms of config from what Eric detailed above is you need to also specify the 'zone=' parameter in your item bindings. I.e.;

Switch BsmtMainZoneReceiver_Power "Main Zone Power" <power> (Basement) { yamahareceiver = "uid=basement, zone="main", bindingType=power" }
Switch BsmtZone2Receiver_Power "Zone 2 Power" <power> (Basement) { yamahareceiver = "uid=basement, zone="zone2", bindingType=power" }

The binding will support up to 4 zones, which I think is the max number of zones any Yamaha receiver can have.


Cheers,
Ben

st.s...@gmail.com

unread,
Sep 22, 2014, 8:08:59 AM9/22/14
to ope...@googlegroups.com
Hi Ben,

I would like to test out the Yamaha binding with my A 3010 and openhab 1.5.1. Can I get a copy? Also, will the binding become part of the 1.6 distribution?

Regards,


Stefan

Ben Jones

unread,
Sep 22, 2014, 3:37:50 PM9/22/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Stefan,

The Yamaha binding is already in the master branch so it will be available in the nightly builds;


Just download the addons zip and pull out the bindings you want. All of those bindings will work just fine on a 1.5.1 install of openHAB.

It will also be in the 1.6 distribution.

Hope it works ok for you ;).

Cheers,
Ben

st.s...@gmail.com

unread,
Sep 23, 2014, 3:43:12 AM9/23/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

thank you so much, I was not aware of the nightly builds (I'm new to OpenHAB). I will install and test the binding in the coming days and let you know the outcome...

Regards,


Stefan

st.s...@gmail.com

unread,
Sep 23, 2014, 7:43:14 AM9/23/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

I could not wait and tried the new binding out with my 1.5.1. installation. It works perfect (including zone selection), thanks again to Eric and you.

I think the code that you posted about should be:

Switch BsmtMainZoneReceiver_Power "Main Zone Power" <power> (Basement) { yamahareceiver = "uid=basement, zone=main, bindingType=power" }

In this way, it worked for me.

I have one question: the main reason for me to use the binding will be to provide an easy way to switch my internet radio in several rooms because I found the Yamaha App to be much too technical oriented. Would it be possible to add a selection list for the internet radio channel (for example by reading the presets from the receiver and put them into a list from which you can select the channel)? That would be really cool, and from what I have understood from the Yamaha Function tree should be possible as well.

Regards,


Stefan



Am Montag, 22. September 2014 21:37:50 UTC+2 schrieb Ben Jones:

Ben Jones

unread,
Sep 23, 2014, 5:57:55 PM9/23/14
to ope...@googlegroups.com, st.s...@gmail.com
Yep - good spotting - no need for the quotes around the zone name. Not sure how they got in there in my post, they aren't in my actual config.

Unfortunately it is not possible to dynamically create items or lists in the openHAB UI (yet!). So you would have to hardcode the list of stations into a rule and use a selection widget to pick a number, which you mapped to the station URL.

I do this with my Squeezeboxes for example;

ITEMS
Number     Scene_KitchenRadio    "Kitchen Radio"      <music>          (Scenes)

SITEMAP
Selection item=Scene_KitchenRadio label="Radio" mappings=[1="Newstalk ZB", 2="Radio Sport", 3="RDU", 4="91ZM", 5="Hauraki"]

RULES
// radio station URLs
var String radioUrlNewstalkZB = "blahblah"
..etc

rule "Kitchen radio"
when
    Item Scene_KitchenRadio received command
then
    // 1="Newstalk ZB", 2="Radio Sport", 3="RDU", 4="91ZM", 5="Hauraki"
    switch (receivedCommand) {
    case 1: squeezeboxPlayUrl("kitchen", radioUrlNewstalkZB)
    case 2: squeezeboxPlayUrl("kitchen", radioUrlRadioSport)
    case 3: squeezeboxPlayUrl("kitchen", radioUrlRDU)
    case 4: squeezeboxPlayUrl("kitchen", radioUrl91ZM)
    case 5: squeezeboxPlayUrl("kitchen", radioUrlHauraki)
    }
end

This works pretty well for me.

I have just added support for the NetRadio line selector in the binding, but it is completely untested. I have attached the updated JAR for you to test so let me know how it goes. 

The new binding type is called 'netRadio' and needs to be a Number. E.g.;

Number BasmtReceiver_NetRadio  "Net Radio" { yamahareceiver="uid=basement, zone=main, bindingType=netRadio" }

This command doesn't actually use the zone since it applies to any zone with the Net Radio set as the input, but it was easier to leave in the same format as the other binding configs.

So you just need to work out which station is which number then write a rule to set the appropriate value (as bit like my rule above).

Let me know how it goes and I will create a pull request.

Cheers,
Ben


org.openhab.binding.yamahareceiver-1.6.0-SNAPSHOT.jar

st.s...@gmail.com

unread,
Sep 24, 2014, 1:12:52 PM9/24/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

great, thanks! I will test this tomorrow and let you know...

Stefan

st.s...@gmail.com

unread,
Sep 25, 2014, 11:58:51 AM9/25/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

I have set up the following:

Items

Number Kueche_NetRadio "Net Radio" <netRadio> { yamahareceiver="uid=EG, zone=main, bindingType=netRadio" }


Sitemap

Selection item=Kueche_NetRadio label="Sender" mappings=[1="N Joy", 2="Radio Sport", 3="RDU", 4="91ZM", 5="Hauraki"]

I did not define any rules so that the value of the selection item is posted directly to the Receiver (right?). Basically, the net Radio channel changes but it seems that somehow random Radio channels are selected from my favorites. Any idea, what should a rule look like?




Regards,


Stefan

Ben Jones

unread,
Sep 25, 2014, 5:20:44 PM9/25/14
to ope...@googlegroups.com, st.s...@gmail.com
Yep that looks correct - as you say a number item with a selection widget should work just fine - since you are not sending URLs but just integers to the binding.

I am not 100% how the NetRadio selection works in the Yamaha API - it just says 'Lineno_x' in the docs. So not sure how that correlates to your favourites?

Sorry but I can't test locally as am flat out with work.

Have a play around and see what you can find.

st.s...@gmail.com

unread,
Sep 26, 2014, 11:02:22 AM9/26/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

I did some testing and now I know where the issue is: the index that is sent to the receiver does not refer to the absolute position of the stream in the favorite list, but to the relative position. The favourites are apparently devided into Groups of 9 (identical to the number of entries in the On Screen Display of the receiver) and you select the nth entry of this list (n being the index you send to the Receiver). So as long as you only use the stations 1-9 from your favourite list, there is not Problem. But if you select a number that is greater than 9, say 10 (or you have used the Yamaha App to select a stream later in the list) , the next number you send will be interpreted relative to the start of the Group the stream belongs to. There must be a Cursor that has to be set to 0 (?) before you can really be sure which entry from the list you select.

Does this help?

Regards,


Stefan

st.s...@gmail.com

unread,
Sep 26, 2014, 12:46:57 PM9/26/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi,

a small correction: there are Groups of 8 streams. So you always have to set the "page number" first (index/8) to take into account that the stream can also be changed from another device and then the position on the page (index mod 8). If you find the correct function that defines the page, this should work no matter how many channels there are in the list...

Stefan

Ben Jones

unread,
Sep 28, 2014, 3:06:08 AM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Stefan,

I just spent the last hour scanning the various other implementations of the Yamaha API and can't find a definite way of handling this.

I am unable to test locally at the moment so I can't really develop this any further.

Is there any chance you can get the Yamaha binding running in the Eclipse IDE and test this in debug? And then perhaps make some changes to the code yourself? Would be much easier than me trying to guess the changes required and getting you to test. Could end up taking a very long time!

Cheers,
Ben

st.s...@gmail.com

unread,
Sep 28, 2014, 4:45:50 AM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

sorry to bother you with this, I really appreciate the time you are spending on MY problem. I think there must be a way to handle this since the Yamaha App also allows you to select the stream independent of any changes that might have been done by other instances that run concurrently.

I have honestly not done any programming in Eclipse/Java for years but I clearly want to support you here. Since  haven't had the chance to analyze the source code and map it to the API description (an excel sheet with all the HTML codes and a short description), can you send me the sources so that I can do some code analysis? I would then surely be able to give you the right hints to successfully implement this...

Thanks again,


Stefan

Ben Jones

unread,
Sep 28, 2014, 5:30:18 AM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
No worries at all Stefan - happy to help - just wish I could do more!

Here is my current code;


I can't find anything that shows a clear concise way about how this should work, and I just had a look on my A2020 and since I don't use any of the Net Radio features it wasn't clear how it should work.

Let me know what you find.

st.s...@gmail.com

unread,
Sep 28, 2014, 6:14:34 AM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben, this should do:

public void setNetRadio(int lineNo) throws IOException {

/* Set Cursor back to home */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Cursor>"
  + "5" + "</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");

/* Set Cursor to the right page */
 for (lineNo, lineNo > 8) {
 /* Move Cursor down one page */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Cursor>"
  + "1" + "</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");
 /* Reduce lineNo by length of page */
 lineNo -= 8
  }

/* Select index within page */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Direct_Sel>"
 + "Line_" + lineNo + "</Direct_Sel></List_Control></NET_RADIO></YAMAHA_AV>");

 }

Please bear with my missing Java syntax know-how but I hope the idea is clear. You have to first set the cursor to the first page and then go down the pages until your index is within the page...

Happy to test...

st.s...@gmail.com

unread,
Sep 28, 2014, 7:17:58 AM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
A small correction:

public void setNetRadio(int lineNo) throws IOException {

/* Set Cursor back to home */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Cursor>"
  + "Back to Home" + "</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");

/* Set Cursor to the right page */
 for (lineNo, lineNo > 8) {
 /* Move Cursor down one page */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Cursor>"
  + "Down" + "</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");

Ben Jones

unread,
Sep 28, 2014, 3:55:02 PM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
I have never come across these commands 'Back to Home' and 'Down'. Where did you find them specified?

st.s...@gmail.com

unread,
Sep 28, 2014, 4:23:36 PM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

please see attached reference manual for Yamaha Receivers. There you'll find many more commands to make this binding really cool...

Stefan


Am Sonntag, 28. September 2014 21:55:02 UTC+2 schrieb Ben Jones:
RX AX10 VX71 Series Function Tree.xls

Ben Jones

unread,
Sep 28, 2014, 4:26:22 PM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Well that would have been VERY handy a few months ago!! Thanks, I will look at this tonight and see how I get on.

Cheers.

st.s...@gmail.com

unread,
Sep 28, 2014, 4:36:45 PM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
I thought you'd already have it since you mentioned an API description.

Anyway, I think that my code modifications should work. It seems that the whole API just mimics the manual control of the receiver with a remote control. That makes programming it a little cumbersome. I wonder if receivers from other vendors are easier to integrate. This also make clear why the Yamaha App is so technically and not really user friendly. But with openhab and this binding, this could really become different.


Am Sonntag, 28. September 2014 22:26:22 UTC+2 schrieb Ben Jones:

Ben Jones

unread,
Sep 28, 2014, 4:40:05 PM9/28/14
to ope...@googlegroups.com, st.s...@gmail.com
Nope - never seen that doc! I had just been Googling for other implementations (via c++ and python etc) and trying to decode what they had done. This will make life MUCH easier.

st.s...@gmail.com

unread,
Sep 30, 2014, 12:01:34 PM9/30/14
to ope...@googlegroups.com, st.s...@gmail.com
If I can do any tests, please let me know...

Ben Jones

unread,
Sep 30, 2014, 3:57:58 PM9/30/14
to ope...@googlegroups.com, st.s...@gmail.com
Sorry Stefan - been flat out with work this week.

Try this version of the binding and let me know how it goes...
org.openhab.binding.yamahareceiver-1.6.0-SNAPSHOT.jar

st.s...@gmail.com

unread,
Oct 1, 2014, 7:34:50 AM10/1/14
to ope...@googlegroups.com, st.s...@gmail.com
I didn't want to push you, sorry. Thanks for the changes, but they do not work. After some Google research, I now think that the following sequence should do:

public void setNetRadio(int lineNo) throws IOException {

/* Jump to specified line in list */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Jump_Line>"
  + lineNo + "</Jump_Line></List_Control></NET_RADIO></YAMAHA_AV>");
/* Select item */
 postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Cursor>"
 + "Sel" + "</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");

 }

Regards,


Stefan

schrieb Ben Jones:

Ben Jones

unread,
Oct 1, 2014, 3:25:08 PM10/1/14
to ope...@googlegroups.com, st.s...@gmail.com
Yeah this is the problem with trying to develop without access to testing hardware!

Try this one...
org.openhab.binding.yamahareceiver-1.6.0-SNAPSHOT.jar

st.s...@gmail.com

unread,
Oct 1, 2014, 5:56:17 PM10/1/14
to ope...@googlegroups.com, st.s...@gmail.com
There is still a problem with this. It seems that if you concurrently use an App then this does not work if you browse through a list or even change to another list of radio stations (e.g. by country or style). Then the result is unforeseeable.

If you like, please try out the following:

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_Sel>"
  + lineNo + "</Preset_Sel></Play_Control></NET_RADIO></YAMAHA_AV>");
}

This should go straight to the Presets (Bookmarks) and I Hope this works now. I do not know if the receiver automaticly plays, but we will see. There is still a command that sets the status to "play" but this might not be necessary...


Stefan

Ben Jones

unread,
Oct 2, 2014, 9:57:17 PM10/2/14
to ope...@googlegroups.com, st.s...@gmail.com
Don't feel like we are making much progress here. Is there no way you can try to get the openHAB dev environment setup locally?

I have changed it to use your latest suggestion but if this doesn't work I might have to scrap this, unless someone else can test/develop it locally?
org.openhab.binding.yamahareceiver-1.6.0-SNAPSHOT.jar

st.s...@gmail.com

unread,
Oct 3, 2014, 5:33:04 AM10/3/14
to ope...@googlegroups.com, st.s...@gmail.com
You are right, I underestimated this, sorry. So what would I need to setup, is there any description?

Ben Jones

unread,
Oct 3, 2014, 5:32:02 PM10/3/14
to ope...@googlegroups.com, st.s...@gmail.com
Did that latest version not work either?

Here are the IDE setup instructions;


st.s...@gmail.com

unread,
Oct 3, 2014, 5:43:39 PM10/3/14
to ope...@googlegroups.com, st.s...@gmail.com
Hi Ben,

I have found a more efficient way for me to help you testing the HTTP commands. I am using Fiddler now to directly send the commands to the Yammi.

Did you see that you can generate text files with the commands directly from the Spreadsheet I sent you? Just go to the "Func tree ..." sheet and you'll see a button clalled "Ether". Position the Cursor on the "1" in the YNC column before the command and press the button. Then you'll get a textfile in the same directory as the Spreadsheet. Just cut and paste it to Fiddler, add the needed Parameters and post it to the Receiver. Maybe this helps you for future developments.

I have done some testing and found the solution.

 /* 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>");
}


and this works fine no matter if you have any apps running concurrently. It is interesting that the Receiver even switches to netradio if you listen to MP3's etc.

It should be noted that the command only works for the internal netradio presets which you can define using your remote control.

Can you nevertheless give me a hint what I will have to install to compile your code? I think that there are many more features of the receiver that might be worth exploring so that I would like to test myself.

Best regards,


Stefan


Am Freitag, 3. Oktober 2014 03:57:17 UTC+2 schrieb Ben Jones:

st.s...@gmail.com

unread,
Oct 3, 2014, 5:45:32 PM10/3/14
to ope...@googlegroups.com, st.s...@gmail.com
Sorry, I didn't see your reply, thanks for the Setup instructions.

Ben Jones

unread,
Oct 5, 2014, 3:22:59 PM10/5/14
to ope...@googlegroups.com, st.s...@gmail.com
Added your latest change. Try this one.
org.openhab.binding.yamahareceiver-1.6.0-SNAPSHOT.jar

st.s...@gmail.com

unread,
Oct 6, 2014, 6:22:04 AM10/6/14
to ope...@googlegroups.com, st.s...@gmail.com
This works perfect, thanks! Do you want me to write some comments on how this part of the binding works? I think it makes sense to add some information in order to clarify and avoid questions from users...

Ben Jones

unread,
Oct 6, 2014, 3:06:36 PM10/6/14
to ope...@googlegroups.com, st.s...@gmail.com
Good news! Yep, if you could update the Yamaha binding WIKI page, I will create a pull request to get this merged into core. Thanks for your patience!

Artyom

unread,
Nov 9, 2014, 4:49:59 PM11/9/14
to ope...@googlegroups.com
00:44:31.709 ERROR o.o.m.i.i.GenericItemProvider[:343] - Binding configuration of type 'yamahareceiver' of item ‘Yamaha_Power‘ could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: zone
    at org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConfig.parseZone(YamahaReceiverBindingConfig.java:68)

Do not work for me :(
I just renamed items, and add yamahareceiver:room.host=192.168.1.14 to openhab.cfg
What i missed?

Bob Igo

unread,
Nov 16, 2014, 11:04:03 AM11/16/14
to ope...@googlegroups.com
Change the bracketed section to [%d].

Bob Igo

unread,
Nov 16, 2014, 11:06:54 AM11/16/14
to ope...@googlegroups.com
I have power, volume, and mute working, but nothing ever shows up for input. Anyone else seeing this?

Ben Jones

unread,
Nov 16, 2014, 2:05:04 PM11/16/14
to ope...@googlegroups.com
Not much help but the input for both my main zone and zone 2 are successfully being updated. I don't actually display them in my sitemap but just use them in rules. Was is your item config and site map definition for this item?

Bob Igo

unread,
Nov 16, 2014, 2:18:33 PM11/16/14
to ope...@googlegroups.com
BTW, it's an RX-V673 receiver.

config:
yamahareceiver:tvroom.host=192.168.0.172

items:
Switch Receiver_Power "Receiver Power" <switch> (gSF) { yamahareceiver = "uid=tvroom, zone=main, bindingType=power" }
String Receiver_Input "Receiver Input" <video> (gSF) { yamahareceiver = "uid=tvroom, zone=main, bindingType=input" }

My sitemap includes all of gSF (group for Second Floor).

Power works perfectly. I can set the power state from openHAB GUIs, and a change in power state via the receiver's remote control updates the GUI.

Ben Jones

unread,
Nov 16, 2014, 3:00:43 PM11/16/14
to ope...@googlegroups.com
You need to read up about item/sitemap configs. Your input binding has no placeholder to display the current value so you will never see anything in the UI.

Try something like 'Receiver input [%s]' as your item label..

Bob Igo

unread,
Nov 16, 2014, 3:04:45 PM11/16/14
to ope...@googlegroups.com
That was indeed the missing part! I just copied the example items and augmented them to include the zone, as I saw in the earlier discussion. When the time comes to make the wiki entry, let's all make sure the baseline example works.

Thanks!

ruben.v...@gmail.com

unread,
Nov 27, 2014, 11:40:16 AM11/27/14
to ope...@googlegroups.com
Got mine working.,
I'd like to know if there is a binding to get the "Pure Direct" working.
The rest is working like a charm, if I could get that working, I can  configure scenes to turn on my receiver, switch it to e.g. HDMI4 and turn the "Pure Direct" on so that I get the best sound out of my XBMC

The wiki would have been very helpfull, but got it working with some research :)

Falk Sauer

unread,
Jan 6, 2015, 4:33:30 AM1/6/15
to ope...@googlegroups.com, st.s...@gmail.com

Hi,

your actual way to select a net radio station dosn't work on a 475, this receivers have afaik only the possibility to set the radio station over the boomarks list like

http://faq.yamaha.com/us/en/article/audio-visual/av-receivers-amps/rx/rx-v673_black_u/10296/7180

the only way for me to select a station is a solution like the following way:


    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><List_Control><Jump_Line>"
                + "1</Jump_Line><Cursor>Sel</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");
        try {
          Thread.currentThread().sleep(1000);
        } catch(InterruptedException ex) {
          Thread.currentThread().interrupt();
        }
        postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Jump_Line>"
                + "1</Jump_Line><Cursor>Sel</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");
        try {
          Thread.currentThread().sleep(1000);
        } catch(InterruptedException ex) {
          Thread.currentThread().interrupt();

        }
        postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Jump_Line>"
                + lineNo + "</Jump_Line><Cursor>Sel</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");
        postAndGetResponse("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><NET_RADIO><List_Control><Jump_Line>"
                + "Sel</Jump_Line><Cursor>Sel</Cursor></List_Control></NET_RADIO></YAMAHA_AV>");
    }

(i don't know if is possible to make a sleep here ...)

but anybody knows a way to make a internal net radio preset station inside this receiver.

today i make this functionality over the exec binding and a couple of scripts. this is not half so good as a native binding ...

regards
   falk
Reply all
Reply to author
Forward
0 new messages