Sony Devices Binding

openhab2
Tags: #<Tag:0x00007f6ce9e01f70>

(James) #341

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?


(Simon) #342

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```

(David Van Laatum) #343

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


(Andi) #344

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


(Lars Kusch ) #345

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.


(Tim Roberts) #346

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


(Tim Roberts) #347

@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


(Tim Roberts) #348

@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


(Tim Roberts) #349

@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


(Tim Roberts) #350

@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


(Tim Roberts) #351

@habnoob

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

Thanks,
Tim


(Tim Roberts) #352

@Jonas88

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

Tim


(Tim Roberts) #353

@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


(Tim Roberts) #354

Future update will address the ‘stuck’ part

Tim


(Tim Roberts) #355

@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.


(Tim Roberts) #356

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.


(Tim Roberts) #357

@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


(David Van Laatum) #358

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.


(Lars Kusch ) #359

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


(Lars Kusch ) #360

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