Sony Devices Binding

Hi Andreas,
thanks for the binding! I just got a new Sony TV and tried it. Works very good.
However what I realized is that the TV does not go into Deep Standby when it’s switched off. It uses 23 W (!) which is not acceptable in Deep Standby. When I disable the binding the consumption drops to 0,5W.
Connected via Wifi. In general this is a known problem for some Sony TV, but I adjusted all the settings so it should fall down to 0,5W which does not happen when the binding is active.

Do you know about this problem or is this unavoidable?

Best regards and thanks for your work.

Hi Torben,

I would guess that your issue is caused by the status check and/or retry connection feature.

The status check feature sets the thing status to offline when the device has become unavailable (for my TV with LAN connection when the TV has gone into deep standby). The retry feature periodically tries to reconnect to the TV.

If the thing doesn’t go offline when your TV is switched off, then try to disable the status check by setting Status Check Interval = -1 in the advanced configuration and check if the TV goes into a deep standby thereafter. If this is the case, this would indicate that the status checks prevents your TV from going into deep standby.

Otherwise try to disable the retry feature by setting Retry Polling = -1 and check the standby mode of your TV.

If either of the options works, you can keep the according feature disabled with the potential disadvantage of an inconsistent thing state. Also using WLAN you might not be able to power on the TV with the binding when the thing has become offiline (this works via Wake on LAN).

Forgive me if I forget something, I tried to search the topic but couldn’t find anything. I installed the features above but I’m still getting errors:

openhab> diag 281
openHAB Add-ons :: Bundles :: Sony Binding (281)
------------------------------------------------
Status: Installed
Unsatisfied Requirements:
osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.measure)(&(version>=1.0.0)(!(version>=2.0.0))))"
osgi.service; filter:="(objectClass=org.openhab.binding.sony.internal.providers.SonyDefinitionProvider)"; effective:="active"
osgi.service; filter:="(objectClass=org.openhab.binding.sony.internal.providers.SonyDynamicStateProvider)"; effective:="active"
osgi.service; filter:="(objectClass=org.osgi.service.http.HttpService)"; effective:="active"
Declarative Services


openhab> resolve 281
openhab> start 281
Error executing command: Error executing command on bundles:
	Error starting bundle 281: Could not resolve module: org.openhab.binding.sony [281]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

Using Openhab version 3.1.0-SNAPSHOT, downloaded the latest " 3.1.0-alpha.andan-SNAPSHOT"

Somebody that can help me?
(I was using the binding on 2.5, awesom work!)

The openHAB 3.1.0-SNAPSHOT version depends on some newer libraries. These dependency changes are not yet reflected in the Sony binding, therefore the version error. The latest openhab version that should work with the binding is 3.1.0-M1.

Aha… Thanks for the info. Sadly that brings me into problems with other bindings (and fixed bugs) that need the latest snapshot.

Any idea when you would be able to change this? No pressure off course, you are in control :slight_smile: But just as a rough estimate.

I aim to provide a 3.1-SNAPSHOT compatible binding version within the next 1-2 weeks.

I’ve released a new version that should work with the current openHAB 3.1.0-SNAPSHOT version:
Release openhab-addons-sony-3.1.0_20210518

Note that this version will not work for the current stable 3.0.x releases.

1 Like

I’m getting the following error

 [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.sony-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sony [301]
  Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

The 3.1.0-SNAPSHOT version of the binding should work with the latest OH 3.1 snapshot versions (maybe M3 or M4 will also work). Older 3.1 versions might cause the observed error due to recent and backward incompatible dependency upgrades. So please check your OH version and upgrade if necessary, If the issue still persists please ket me know.

I’m on 3.1 M4

OK. I will check on my side whether the binding works with the M4 release. I have only tested it with a recent snapshot version.

1 Like

Will you eventually add a pull request for this binding to the OH3 repo?

I contacted the original binding author Tim Roberts a while ago and asked on how to proceed with adding a pull request for the OH3 repo. Unfortunately, he hasn’t responded so far on my request and I’m not sure whether he is still active on this project.

I know that Tim raised a pull request last year for the OH 2 version that was quite advanced but was eventually cancelled due to missing OH3 support. So it might be a rather straightforward pull request with the OH3 specific changes and the various fixes and extensions that I contributed.

I’m willing to support a new PR as much as I can, but there are some issues that make me hesitate to do it on my own with no support from Tim:

  • The code is (at least in my view) very complex and has many distinct implementation solutions. I’m currently far away of understanding the whole code and doubt that I could provide adequate maintenance.
  • I have no access to the complete history of Tim’s code in order to analyse regression issues (which I think exist given the reported bugs)
  • My testing capabilities would be limited to a rather old Sony TV
  • Last but not least, it feels wrong too me to initiate a pull request for a work which credits goes to Tim without his stated approval

@tmrobert8 If you read this maybe you could give a short hint…

I can confirm that ‘Could not resolve’ issue with the M4 runtime version. Would you mind to upgrade to the SNAPSHOT version? As the binding is not yet in the official release, it would be too much of an effort to build releases for each milestone.

I’ve switched to snapshot. However I don’t want to stay with the snapshot since two other bindings that I use doesn’t work properly.

In case this helps anyone out there:

I updated to OH 3.1.0 stable and had problems, things where not showing up.

Long story short, some dependencies of this binding where causing havoc on the new OH version.
Here is how I fixed it:

1- in karaf UNINSTALL all the dependencies stated in the OP and ONLY LEAVE THESE ONES:

feature:install openhab-transport-upnp
feature:install openhab-transformation-map

2 - Then I deleted the userdata/sony directory
3 - Also deleted the JSON in the addons directory

Now its working and I don’t even use the JSON file in the addons directory.

PD: I only use this setup to turn on and off my TV, I don’t know if this works for complex setups (using more functions).
PD2: I use files for setting up OH things, items and rules so have that in mind too.

I’ve created a new thread Sony Devices Binding for OH3 - Add-ons / Bindings - openHAB Community to continue the discussion of the OH3 version of the binding

Can anyone confirm if STR-DN1050 can be added to OH. I’m on openHAB 2.5.11-1 and binding-sonyaudio - 2.5.11. It looks like for a some reason I’m not able to add/discover receiver(well I can add it manually using STR-DN1080 - but stays offline, and it’s not discovered automatically). I’m able to see receiver when scanning network with UPnP scanner.

I cannot provide a confirmation but would instead advise to upgrade to OH 3.2 and try to use either the official Sony Audio binding or the Sony Devices binding. The latter is provided through the new community marketplace and should include most (if not any) capabilities of the Sony Audio binding. As maintainer of this binding I would be able to provide support in case you encounter any issues,

Thank you, will try, currently trying to migrate my backup from OH2 >> OH3 and faling as there are refferences to /var/lib/openhab2/* folders. Wondering How I can overcome that.