Sony Binding [4.0.0.0;4.4.0.0)

I’ve published a new binding version that should fix the reported issue in combination with the TR-064 binding. The only change in this version is the removal of a simple web ui for the scalarweb protocol. It seems that the respective ui implementation has become incompatible with recent OH changes.

I must admit that I didn’t try to isolate and fix the root cause. But as the removal of the web ui doesn’t affect the core features of the binding, I think this is acceptable (at least for now).

The successful (re-) installation of the new binding can be checked by the version string (the console command bundle:list | grep Sony should show the version 4.3.0.202409121854)

Please let me know if you still encounter any issues.

Thank you Andreas …

I have tested it:
With this version there are no more crashes. :grinning: However, the binding is now unstable. Assigned Things are sporadically in the status: uninitialised. There is then a communication_error or a handler_missing_error with the message:

COMMUNICATION_ERROR

Unhandled exception connecting to Scalar Web device (may need to turn it on manually): java.lang.NullPointerException: Cannot invoke “org.apache.cxf.binding.BindingFactoryManager.registerBindingFactory(String, org.apache.cxf.binding.BindingFactory)” because “manager” is null

I did some further investigation but haven’t found a solution yet.
I’ve created a new topic to ask for help: Potential conflict between openhab.tp-jaxws feature and use of ClientBuilder reference in binding - Development / Add-ons - openHAB Community

Hi Andreas,

I’m getting the same error with the updated binding (the version you mentioned above).
Please let me know if I need to look into that and in which repository (if necessary)… I can create a PR if you don’t have time to look into it.

The exception is this one. I haven’t looked in the code base. Happens only on my KD-65XD7505 while it works on KD-55XF7596 which is weird. Would expect this to be the same from API standpoint :slight_smile:

2024-11-06 18:41:07.196 [ERROR] [.internal.scalarweb.ScalarWebHandler] - Unhandled exception connecting to Scalar Web device: Cannot invoke "java.util.List.size()" because "content" is null
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "content" is null
        at org.openhab.binding.sony.internal.net.HttpRequest.sendGetCommand(HttpRequest.java:103) ~[?:?]
        at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executeGet(SonyHttpTransport.java:274) ~[?:?]
        at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:114) ~[?:?]
        at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:244) ~[?:?]
        at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:227) ~[?:?]
        at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executeGet(SonyHttpTransport.java:167) ~[?:?]
        at org.openhab.binding.sony.internal.ircc.IrccClientFactory.queryIrccClient(IrccClientFactory.java:236) ~[?:?]
        at org.openhab.binding.sony.internal.ircc.IrccClientFactory.get(IrccClientFactory.java:99) ~[?:?]
        at org.openhab.binding.sony.internal.ircc.IrccClientFactory.get(IrccClientFactory.java:79) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebLoginProtocol.lambda$0(ScalarWebLoginProtocol.java:128) ~[?:?]
        at org.openhab.binding.sony.internal.SonyAuth.getDeviceIdHeaderName(SonyAuth.java:117) ~[?:?]
        at org.openhab.binding.sony.internal.SonyAuth.requestAccess(SonyAuth.java:173) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebLoginProtocol.login(ScalarWebLoginProtocol.java:238) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.connect(ScalarWebHandler.java:330) ~[?:?]
        at org.openhab.binding.sony.internal.AbstractThingHandler.doConnect(AbstractThingHandler.java:136) ~[?:?]
        at org.openhab.binding.sony.internal.AbstractThingHandler.lambda$1(AbstractThingHandler.java:343) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]

Cheers,
Konstantin

I am getting the same exception as well.
Cannot invoke “java.util.List.size()” because “content” is null

I will look and hopefully fix this issue as part of a planned rebuild against the new 4.3 OH release.

Update:
Just seen that there was an open fix PR. This has been merged and thus will be part of the new binding version.

1 Like

Can you point me to the repo for the binding? As far as I see it’s not part of the main repo (or I overlooked it somehow…)

Edit… I found it on the first page of this thrad. Sorry for the confusion!

It’s this right?(https://github.com/andan67/openhab-addons)

Do you plan to merge this binding it in the main codebase?

Yes, this is the right repo. The latest version can be found in the feature/sony-4.3 branch

No, I don’t plan this.
The reasons are that this binding is quite complex (it supports multiple protocols and a huge number of channels) and uses a somewhat ‘idiosnycratic’ implementation style. So I guess that the PR review will be a bit painful for both the reviewer and the creator. For newer models I think the AndroidTV binding might be a future proof alternative.

May I know how can I install the latest version in OH4.3?
Thanks.

The current version should now be available from the marketplace. This should also work with OH 4.3. An updated version will be provided in the next days.

Thanks a lot !!!
Tried the one in marketplace and got the “content” is null error.
Will try again in next few days when updated version is available.
Thanks.

I’ve published a new version for OH 4.3.0. Please let me know if you encounter any problems.

Thanks a lot !

This is to confirm that the latest version in marketplace works well in OH 4.3
Super thanks.

Hi, I have managed to configured the binding for my 10 years old Sony Android TV.
I can power on/off, mute and change volume, however the following channels don’t seem to work for me:

  1. Channel (when TV on it sets to empty string)
  2. Input (when TV on it sets to empty string)
  3. Scene (not sure what it is?)

Also PIP doesn’t work for me but maybe the limitation of my TV. Any idea where could be the issue? Below is my config:

Group     gSonyTV        "All Sony TV"
String    IrCode         "IR Code"         (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:ir"}
Switch    Power          "Power"           (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:power"}
Dimmer    Volume         "Volume"          (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:volume"}
Switch    Mute           "Mute"            (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:audiomute"}
String    Channel        "Channel"         (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:channel"}
String    Input          "Input"           (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:inputsource"}
String    Scene          "Scene"           (gSonyTV)    {channel="sony:simpleip:sonyandroidtv:scene"}```

I’ve no experience with the SimpleIP protocol since my TV doesn’t support this.
However, it might be that some features have been discontinued by firmware updates.
Do you have any logs that could provide a hint of the root cause?

If supported by your TV, I would rather try the Scalar protocol, which offers the richest feature set and AFAIK is still supported by Sony,

Hi @andan : Thanks you for your reply!
My TV was from 2015, how do I know if it supports Scalar protocol?

Simplest way is to enable auto discovery (see Sony Binding [3.2.0;3.9.0) for more details). I’m quite sure that your TV supports this protocol.

You can also try to call http://xxx.xxx.xxx.xxx:52323/dmr.xml. If the response includes a service definition /sony/avContent, than your TV definitely supports the ScalarWeb protocol,

1 Like