Sony Devices Binding

Hi All
Just rebooted my Tv and on restart it asked me to add a 4 digit pin into OpenHab - was a little surprised!
Anyone seen this?

Hi @tmrobert8 ,

i get following errors:

SimpleIP:
2017-10-23 21:24:49.314 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP 2017-10-23 21:24:49.319 [ERROR] [y.internal.simpleip.SimpleIpProtocol] - Failed to get MAP transformation service; is bundle installed?

Scalar:

2017-10-23 21:21:52.440 [ERROR] [.internal.scalarweb.ScalarWebHandler] - Exception caught: null
javax.ws.rs.ProcessingException: null
        at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:264) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [161:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [161:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:228) [161:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) [161:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343) [160:org.glassfish.jersey.core.jersey-client:2.22.2]
        at org.openhab.binding.sony.internal.net.HttpRequest.sendPostCommand(HttpRequest.java:116) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.net.HttpRequest.sendPostJsonCommand(HttpRequest.java:99) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.models.ScalarWebService.execute(ScalarWebService.java:119) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.models.ScalarWebService.execute(ScalarWebService.java:111) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.models.ScalarWebService.execute(ScalarWebService.java:106) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebLoginProtocol.postLogin(ScalarWebLoginProtocol.java:205) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebLoginProtocol.login(ScalarWebLoginProtocol.java:180) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.initializeTask(ScalarWebHandler.java:182) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.access$2(ScalarWebHandler.java:155) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler$2.run(ScalarWebHandler.java:150) [212:org.openhab.binding.sony:2.2.0.201707261512]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
        at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.NullPointerException
        at java.util.Date.getMillisOf(Date.java:958) ~[?:?]
        at java.util.Date.after(Date.java:931) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.models.ScalarAuthFilter.filter(ScalarAuthFilter.java:68) ~[?:?]
        at org.glassfish.jersey.client.ClientFilteringStages$RequestFilteringStage.apply(ClientFilteringStages.java:115) ~[?:?]
        at org.glassfish.jersey.client.ClientFilteringStages$RequestFilteringStage.apply(ClientFilteringStages.java:103) ~[?:?]
        at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171) ~[?:?]
        at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255) ~[?:?]
        ... 26 more```

As requested debug logs for Sony HT RT-5 soundbar.
192.168.83.133 is the soundbar 192.168.83.130 is my tv which I switched off during this

I dont know if it is a bug or intended but when the binding starts (in general when openhab is restarted for some reason) my tvchannel item

String St_Tv_Channel_Lr "TV Kanal [%s]" <list> { channel="sony:simpleip:mysonytv:channel" }

gets assigned the value 1.0, which causes to switch the channel (even from apps like Netflix) to the channel 1.0 which is disturbing in most of the cases.

Could you have a look?
Thanks

Hey,
Iā€™m new and today I saw ā€œHey, I can control my Sony devices!ā€. The TV worked properly (ca. 5 minutes after shutting off, it wonā€™t react), but my amplifier getā€™s recognized and then it wantā€™s an access code! So it showā€™s the message

Status: OFFLINE - COMMUNICATION_ERROR Access code request error: 406 ()

Where do I get the access code? On my TV it was shown on the screen.

FYI - have not disappeared. Been busy preparing the NEEO binding/transport to be accepted/merged. Iā€™ll be looking at the latest comments tomorrow and will be responding then

2 Likes

@LarsK1

Donā€™t know what AVR you have - but does it have some kind of TV output (hdmi, composite, etc) for setup? If it does, connect that up and see if a code appears. If you do all your setup through a front panel, look for it there. Another thing to check is if your setup allows you to set a preset code - if it does, use the code shown and it should work. If nothing else - try 0000 (the default code). If none of that works, I may need you to turn on debug and show me some information.

Tim

@andirs
That is really weird. Just looked at the source and there is nothing that explicitly does that (although Iā€™m wondering - at startup we request the current channel number, which we may get 1.0 back, which then updates the channel, which then may send it back to the tv - just a guess however). Would help me if you could turn debug on for the binding and restart openhab - does the log show it getting the channel and then sending the channel update? Posting the log would help as well so I can review itā€¦

Thanks,
Tim

@David_van_Laatum
Yep - the soundbar has the same issue that my bluray has. Advertises the webscalar methods but has no way to authenticate against it. With the bluray, we still have IRCC/DIAL to fall back on - but the soundbar doesnā€™t. Iā€™m still trying to figure out how to authenticate in this case. By any chance have you tried the official Sony SideView (or whatever they call it these days) app to see if it can control the soundbar? If so (and I donā€™t know how technical you are), Iā€™d love to see how it goes about doing that (via Wireshark)ā€¦

Thanks,
Tim

@Simsal
You have two issue here:

  1. You need to install the MAP transformation service. If you use paperui, click on Extensions on the left side then Transformations on the right side. Then install the MAP (or mapping - forget the name) service.
  2. The exception you received was fixed in the latest binding - make sure you download the latest binding and use it.

Thanks,
Tim

@habnoob

Is this still happening or was that a one time occurrence?

Thanks,
Tim

@Jonas88

Iā€™ve confirmed this bug and will be making a fix for it shortly. Iā€™ll post when itā€™s fixed.

Tim

@Justas

Thanks for the logs - youā€™ve stumbled on some rather unique stuff with your TV that Iā€™m going to have to adjust for. Look for the next update from me and hopefully some of this will be fixed.

Tim

Future update will address the ā€˜stuckā€™ part

Tim

@Simsal

Simple IP mode doesnā€™t have an API for IR codes - youā€™ll need to, additionally, install the IRCC service if available to allow that.

In the webscalar service - we have really long obtuse channel names. Needed this because that was the only way to uniquely define things. However, with openhab 2.2 - they introduced a new service that will greatly simplify all this and I can reduce the length of the channel names greatly.

The approach for a channel name could be:
sony:scalar:{UUID}:{service}-{idx1}-{idx2}

Where:
{UUID} is the unique identifier of the device (although I may shorten this to the last node of it - which should be fairly unique)
{service} is the service the device advertises
{idx1} the index of the area within the service we are addressing
{idx2} the index of the api within the area

idx1/idx2 combination uniquely identifies a channel in the device definition that I receive from it

DOWNSIDES to this approach:

  1. The biggest is that itā€™s not backward compatible and your existing rules/etc will need to be modified
  2. Iā€™ll be dumping into an INFO message what idx1/idx2 relates on startup - but itā€™s not very intuitive (however, the current scheme of using what the device says really isnā€™t that intuitive either)
  3. RISK - in my observations, what idx1/idx2 points to has always been consistent between restarts. However, Iā€™m a bit concerned whether that holds true over all devices and especially firmware updates. Iā€™d hate to have a firmware update that changes the order of things - thus invalidating everyones sitemaps/rules.

Because of the RISK issue - Iā€™m not sure I want to mess with the channel names. However I wanted to throw this out for discussion to see if anyone has any different opinions.

@LarsK1

Could you post what receiver you have. Hereā€™s a good guide on how to pair the STR-DN850/DN1050:

http://docs.esupport.sony.com/homeav/STR-DN850_DN1050_guide/en/contents/TP0000239032.html

that may help in your case. Let me know if itā€™s similar

Would be happy to do that (I am a software dev myself) but it doesnā€™t work it only detects my tv. Happy to give ssh access to firewall so you can poke around if you want, just need some way of giving you the details thatā€™s not public.

Oh, I forgot to start the paring mode as described in the manual! I try it again!
Lars

Thank you realy much!
Now it works. Will be there an possibility to control the volume?
Lars