Sony Devices Binding

Hmm I am not sure, i stopped oh2 deleted the old jar file, dropped the new one, set the persmissions and restarted oh2:

Where else could be an old jar that is loaded instead of this one?

Hi Tim! I noticed yesterday and today that the Sony went suddenly down and is shown as offline in PaperUI. OFFLINE - COMMUNICATION_ERROR Error connecting to IRCC device (may need to turn it on manually)

It seems that the binding suddenly stops polling the status from the Sony AV.
yesterday at 23:51 the last GET http://192.168.205.46:50001/cers/getStatus in the log file but no http 200 response.

afterwards the binding starts the discovery process over and over again until this morning:

openhab.log
2017-02-15 11:15:07.876 [DEBUG] [nding.sony.internal.ircc.IrccHandler] - exception: Premature end of file. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.

event.log
2017-02-15 11:15:07.891 [hingStatusInfoChangedEvent] - 'sony:ircc:5f9ec1b3-ed59-1900-4530-5453edf73098' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error connecting to IRCC device (may need to turn it on manually)
attached the detailed logs
 http://pastebin.com/um410x8H

when i restarted the bundle this evening, the Sony comes up online immediately. Any idea for this behavior?

Andi,

Seems like that is good - just to make sure - could you download the latest from today (2017-02-16) and give that a try?

Tim

Oliver,

Three things of note here:

  1. Go point on the discovery process. I was re-running device verification everytime the sony device sent out a discovery result packet. Latest version will change that to only run verification when it’s being added to the inbox.
  2. The lack of a retry, I think, is a side affect to the two phase authentication process I had (it wouldn’t retry if you were in phase 1 because it would cancel the registration attempt). As a quick, temporary test - the latest version will only retry after going online (you just need to make sure it goes online when you start it). I need to think through how to properly handle the situation however (ie identify a two phase authentication and not retry during it).
  3. I still say there is something funky going on in your network or the AV. I understand the pcaps were from a mirroring process but even they showed requests being sent with no replies occasionally (and a lot of retries and fragments). Might be something you want to investigate on your side.

At any rate, try the latest I posted today to see if they help (and remember - you’ll need to restart if it doesn’t go online immediately - after that the retires should kick in).

Tim

Hi Tim, sorry an old version was indeed still active. Uninstalling in the karaf console and then dropping the new jar file did the trick. Now I have this log entries, which seems to be the changed message you meant:

2017-02-16 16:07:58.454 [WARN ] [y.internal.simpleip.SimpleIpProtocol] - Unparsable response ‘’ to command ‘*SEPIPI################’
2017-02-16 16:08:24.116 [WARN ] [y.internal.simpleip.SimpleIpProtocol] - Unparsable response ‘’ to command ‘*SEPIPI################’
2017-02-16 16:08:57.981 [WARN ] [y.internal.simpleip.SimpleIpProtocol] - Unparsable response ‘’ to command ‘*SEPIPI################’
2017-02-16 16:09:31.909 [WARN ] [y.internal.simpleip.SimpleIpProtocol] - Unparsable response ‘’ to command ‘*SEPIPI################’
2017-02-16 16:10:05.909 [WARN ] [y.internal.simpleip.SimpleIpProtocol] - Unparsable response ‘’ to command ‘*SEPIPI################’

Interesting - what model of tv do you have again? Do you know if it support picture-in-picture?

I have a KD-49XD7005 and i think it does not support pip because i cannot find the feature in the menus/manual and it does not react to the pip functions in your binding.

Try the latest one I just posted - should fix that issue


It seems to work, thank you :slight_smile:

thanks, will give it a try and let you know the results.

i have updated openhab2 yesterday to current snapshot build #791 because i also had some strange error with the fritzbox binding which seems similar to this thread https://community.openhab.org/t/handler-takes-more-than-5000ms-for-processing-event/22158

not sure if it’s related, the sony binding stopped again status request this afternoon at 13:53 but the thing is still online in paperUI and i can controll the AV

`2017-02-16 13:53:04.420 [DEBUG] [inding.sony.internal.net.HttpRequest] - 42185 * Sending client request on thread ESH-thingHandler-2

42185 > GET http://192.168.205.46:50001/cers/getStatus
`
regarding the network i will do some further analysis and probably measure the wiring and replace the patchcables this weekend.

thanks, Oliver

Any updates on the scalar api? My Girlfriend is away for a week very soon :smiling_imp:

No real update - been too busy solving these other issues. The real issue with scalar is two fold: 1) its HUGE - it combines the capabilities of simpleip, dial and ircc into a single service and even adds to it. 2) its very dynamic and openhab just doesn’t like to be as dynamic as I’d like it to be to properly implement it - so I’ve been considering different design options on that and have yet to choose the best one. Give you an example - the scalar api (when I send it to my bravia) tells me there are two audio options (“speaker” and “headphone”) - I’d like to create two channel groups based on those names with the common audio channels (“mute” and “volume”) - giving you channels like speaker#mute, speaker#volume, headphone#mute, headphone#volume. I can’t easily do that with openhab right now. I don’t want to hardcode them because I’m pretty sure the AVs will tell me something different (probably something like “zone1”, “zone2” and will probably have additional audio channels [treble/bass/etc]). Very dynamic and that’s a simple example.

Hi Tim, since the last update everything is working fine and the binding ist stable!

While testing the channels and creating some items and rules i noticed, that the Primary Channel “Power” is not working as expected and does not “Power on/off device” of the AV. Instead it tries to power on/off the “Zone2” .
the power on command fails with WOL packet, and the power off command is sending AAAAAgAAAHkAAAAVAQ which actually toggles Zone2 on/standby:


2017-02-19 08:27:35.083 [INFO ] [ding.sony.internal.ircc.IrccProtocol] - WOL packet is not supported nor could we find a power on IRCC cmd
2017-02-19 08:27:36.068 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2536 * Sending client request on thread safeCall-312
2536 > POST http://192.168.205.46:8080/upnp/control/IRCC
2536 > Accept: text/xml;charset=utf-8
2536 > Connection: close
2536 > Content-Type: text/xml;charset=utf-8
2536 > SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"
2536 > User-Agent: OpenHab/Sony/Binding
2536 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
2536 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body>
    <u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1">
      <IRCCCode>AAAAAgAAAHkAAAAVAQ==</IRCCCode>
    </u:X_SendIRCC>
  </s:Body>
</s:Envelope>


2017-02-19 08:27:36.138 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2537 * Client response received on thread safeCall-312
2537 < 200
2537 < CONTENT-LENGTH: 311
2537 < CONTENT-TYPE: text/xml; charset="utf-8"
2537 < EXT:
2537 < SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5
2537 < X-AV-Physical-Unit-Info: pa="STR-DN1030"
2537 < X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="STR-DN1030"; mv="1.00"
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope
                xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
                s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <s:Body>
                <u:X_SendIRCCResponse xmlns:u="urn:schemas-sony-com:service:IRCC:1">
                </u:X_SendIRCCResponse>
        </s:Body>
</s:Envelope>

When i use the Primary IRCC Command channel sending PowerMain the AV powers on/off fine:

2017-02-19 08:46:37.597 [DEBUG] [ding.sony.internal.ircc.IrccProtocol] - Transformed PowerMain with map file 'ircc-5f9ec1b3-ed59-1900-4530-5453edf73098.map' to ircc:AAAAAgAAADAAAAAVAQ%3D%3D
2017-02-19 08:46:37.617 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2552 * Sending client request on thread safeCall-318
2552 > POST http://192.168.205.46:8080/upnp/control/IRCC
2552 > Accept: text/xml;charset=utf-8
2552 > Connection: close
2552 > Content-Type: text/xml;charset=utf-8
2552 > SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"
2552 > User-Agent: OpenHab/Sony/Binding
2552 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
2552 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body>
    <u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1">
      <IRCCCode>AAAAAgAAADAAAAAVAQ==</IRCCCode>
    </u:X_SendIRCC>
  </s:Body>
</s:Envelope>

It’s nothing urgent as there is the workaround, but just wanted to make sure you get the test results from the AV amp users :wink:

Try the latest zip - should work for you

i think it’s still not working as expected.
toggling the power switch item (which was in on position) results in the following behavior:

  1. power off -> is activating Zone 2 Source
  2. power on -> putting AV in standby
  3. power off -> Zone2 in standby
  4. power on -> actually powering AV on

attached the excerpt from openhab.log and eventl.log
http://pastebin.com/TSqkft7E

Really weird - try the latest.

now it toggles Zone 2 on/off
the binding is only sending AAAAAgAAAHkAAAAVAQ which actually switches Zone2 on/off
this matches what’s listed in ircc transform: PowerZone2=ircc:AAAAAgAAAHkAAAAVAQ%3D%3D

shouldn’t it sends AAAAAgAAADAAAAAVAQ for PowerMain?

http://pastebin.com/gkBgdDwF

Yep - my fault, forgot the commands have that “STR:” attached to them. Try the latest instead


thx, now it’s working!

one question: do you think it’s possible to poll also the power state of the AV and update the switch item accordingly?
when powering on/off the AV manually the switch on the sitemap does not reflect the correct status.

The only way to determine power status (in any IRCC device) is by side effects (there is no direct “getPowerStatus” type of call). The current implementation will turn set the switch ON if the getStatus call returns 200 and turn it OFF if the getStatus call returns 503 (service unavailable) - that worked both on the bravia and the bluray.

I’d watch the log for a few successful getStatus calls then turn the AV off and see what the log says then.

I’m not sure if getStatus will ever return 503 on your AV because you have two zones (zone1 off, zone2 on will probably still have the service running). Not sure if the AV really ‘turns’ off anyway because of that. Other than that - there is really no way of knowing


Note2: your’s doesn’t have the scalar service (that I’m working on) implemented. But sony, supposedly, designed it to work on all their devices and someday you may get it. I definitely get an API that can tell that then