Sony Devices Binding

Posted - give it a shot!

great - openhab has registered successfully!

2017-02-13 19:42:19.404 [DEBUG] [inding.sony.internal.net.HttpRequest] - 19 * Sending client request on thread safeCall-1038
19 > GET http://192.168.205.46:50001/cers/register?name=OpenHAB+%28MediaRemote%3A00-11-22-33-44-55%29&registrationType=initial&deviceId=MediaRemote%3A00-11-22-33-44-55
19 > Connection: close
19 > User-Agent: OpenHab/Sony/Binding
19 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
19 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2017-02-13 19:42:19.450 [DEBUG] [inding.sony.internal.net.HttpRequest] - 20 * Client response received on thread safeCall-1038
20 < 200
20 < Connection: close
20 < CONTENT-LENGTH: 0
20 < CONTENT-TYPE: text/xml; charset="utf-8"
20 < X-AV-Physical-Unit-Info: pa="STR-DN1030"
20 < X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="STR-DN1030"; mv="1.00"

and after removing RQST from the access code my Sony STR-DN1030 Thing became Online :slight_smile:
so i will now start playing around with the channels and items


thank you very much Tim for your great work!

and please let me know if you need any further support or testing of your binding.

Woohoo! If you would could you post the output of the ircc transformation file that it created (should find it under the transform directory) and the response to the getStatus/getContentInformation urls (you’ll see it in the debug output)? For the bravia tvs, the only channels that work are power and ircc - the rest of the channels are unique to blurays. Be interesting to see what AVs support (getContentInformation may or may be implemented btw in avs)

Actually - looking at your actionlist - you will only support the power, ircc command and text channel. I’m still interested in seeing what the transform file and the getStatus looks like however (see if there is any new information)

And looking at the commands from the getRemote from your mediaremote pcap - there may or may not be an issue. Some of the commands have “STR:” prefixed to them and I’m not sure how the transform service handles those. Easiest thing to do is to try out a command in the PaperUI->Control->Click on the “-” under IRCC Command and enter “STR:TvMain” (press enter) and see if the AV switches over (or if you get an error or anything in the log)

Even if it works - I’m thinking that maybe I’ll just make a blanket policy to strip anything up to a colon if one is found (looking at the commands, there doesn’t seem any overlap if I do that). That way the commands are easier to deal with - thoughts?

Actually - one more thing as well - restart the binding. I want to see if the AVs will handle the “registrationType=renewal” ok or not


sorry, had no time today for further tests
below the output from the logs

2017-02-13 20:40:42.057 [DEBUG] [ding.sony.internal.ircc.IrccProtocol] - getContentInformation is not implemented
2017-02-13 20:40:44.063 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2545 * Sending client request on thread ESH-thingHandler-3
2545 > GET http://192.168.205.46:50001/cers/getStatus
2545 > Connection: close
2545 > User-Agent: OpenHab/Sony/Binding
2545 > X-Auth-PSK: 0
2545 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
2545 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2017-02-13 20:40:44.646 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2546 * Client response received on thread ESH-thingHandler-3
2546 < 200
2546 < Connection: close
2546 < CONTENT-LENGTH: 146
2546 < CONTENT-TYPE: text/xml; charset="utf-8"
2546 < X-AV-Physical-Unit-Info: pa="STR-DN1030"
2546 < X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="STR-DN1030"; mv="1.00"
<statusList><status name="viewing"><statusItem field="source" value="TV" /><statusItem field="zone2Source" value="SOURCE" /></status></statusList>

and attached the transform file ircc-5f9ec1b3-ed59-1900-4530-5453edf73098.map.xml (2.7 KB)

here also the output after restarting the bundle. registrationType renewal seems to work, but some strange error at the end “exception: Premature end of file.”?
http://pastebin.com/bK4qHXvR

will do the testing of the channels tomorrow


Interesting - has no issues with the renewal. Appears to support the viewing->source channel (in fact, has a viewing->zone2Source channel that I’ll add to support) - note those are readonly channels. The transform map is interesting - I’ll be removing the “STR:” parts on it in the next version also.

I don’t get the “premature end of file” - that’s saying it didn’t get the full chunk of data from the AV. I’ll do a little research on that.

BTW - if you try the IRCC channel, the channel is CASE SENSITIVE. So you’ll need to type “BLUETOOTH” to start bluetooth, “Left” to go left, “Confirm” to hit enter, etc

I just posted number 2 for today:

  1. Delete the ircc map file to allow it to recreate (should remove the “STR:” parts in the commands - let me know if it doesn’t)
  2. Included a new channel - viewing#zone2source that should contain the source for zone2

Could you also reply with the exact directions to put the AV into pairing mode (want to include it in the documentation

Latest testing file should fix your issue - let me know if it doesn’t

Stuliet - download the latest from the openhab2-addons sony thread - should be able to connect now (you need to put the AV into registration mode as documented by Oliverk for it to properly pair)

Unfortunately not:

2017-02-14 18:22:13.034 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-14 18:22:47.027 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-14 18:23:21.138 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-14 18:23:55.182 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-14 18:24:29.394 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-14 18:25:03.505 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring

I used “sony-binding-2017-02-13-2”

Andi,

Download the latest “sony-binding-2017-02-14-1” and try that one

Tim

the new ircc map file was created, removed the STR: parts and is working fine!

2017-02-14 20:12:42.829 [DEBUG] [ding.sony.internal.ircc.IrccProtocol] - Transformed VolumeUp with map file 'ircc-5f9ec1b3-ed59-1900-4530-5453edf73098.ma
p' to ircc:AAAAAgAAADAAAAASAQ%3D%3D

here the exact directions to put the Sony STR-DN1030 into pairing Mode:
Settings/Network/Media Remote Device/Start Registration

Thanks Tim & Oliver, this is working for me with the sony-binding-2017-02-13-1.jar binding. Now to work out ho to use it!

Stuart,

Download the 2017-02-14-1 or the 2017-02-13-2 to get the latest changes

BTW - which model do you have? Nevermind - you have the STN-1050. Any chance you can turn on debug and post what the “getStatus” URL is returning?

Tim

No problem, downloaded and installed sony-binding-2017-02-14-1.jar

Is this the output you are looking for?

2017-02-14 20:36:26.855 [DEBUG] [inding.sony.internal.net.HttpRequest] - 209 * Sending client request on thread ESH-thingHandler-3
209 > GET http://192.168.1.53:50001/cers/getStatus
209 > Connection: close
209 > User-Agent: OpenHab/Sony/Binding
209 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
209 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2017-02-14 20:36:27.465 [DEBUG] [inding.sony.internal.net.HttpRequest] - 210 * Client response received on thread ESH-thingHandler-3
210 < 200
210 < Connection: close
210 < CONTENT-LENGTH: 152
210 < CONTENT-TYPE: text/xml; charset="utf-8"
210 < X-AV-Physical-Unit-Info: pa="STR-DN1050"
210 < X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="STR-DN1050"; mv="1.00"
<statusList><status name="viewing"><statusItem field="source" value="SAT/CATV" /><statusItem field="zone2Source" value="SOURCE" /></status></statusList>

Yep - that should work just fine with that binding.

Still that log messages :frowning:

2017-02-15 16:44:36.661 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-15 16:45:09.857 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-15 16:45:43.079 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-15 16:46:16.261 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-15 16:46:49.445 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring
2017-02-15 16:47:22.625 [INFO ] [y.internal.simpleip.SimpleIpProtocol] - Response took too long - ignoring

And you’re positive that you are using the correct jar now (not the zip)? If so, search you’re system to see if the old one is still laying around. The reason I ask - I changed the text on that message and I don’t see the text change I made