Sony Devices Binding

With earlier versions of the binding the paring process with the scalar thing did not work. Now a scalar thing was discovered automatically and paring worked fine. After paring the thing doesn’t go online. Here is a log with log level INFO. I also tried log level DEBUG an saw the binding creating many channels but there was so many log entries i thought this would show the ERRORs better. If needed I can log on DEBUG again and post it.

Maybe the unsupported says it all?

2019-03-09 14:35:20.676 [hingStatusInfoChangedEvent] - 'sony:scalar:fcf152a50257' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): unsupported

Full INFO level log:

==> /openhab/userdata/logs/events.log <==
2019-03-09 14:35:15.119 [hingStatusInfoChangedEvent] - 'sony:scalar:fcf152a50257' changed from UNINITIALIZED (DISABLED) to INITIALIZING
==> /openhab/userdata/logs/openhab.log <==
2019-03-09 14:35:15.120 [INFO ] [.internal.scalarweb.ScalarWebHandler] - Attempting connection to Scalar Web device...
2019-03-09 14:35:19.823 [INFO ] [web.protocols.ScalarWebLoginProtocol] - Command map already defined - ignoring: /openhab/conf/transform/scalar-fcf152a50257.map
==> /openhab/userdata/logs/events.log <==
2019-03-09 14:35:20.676 [hingStatusInfoChangedEvent] - 'sony:scalar:fcf152a50257' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): unsupported
==> /openhab/userdata/logs/openhab.log <==
2019-03-09 14:35:24.761 [ERROR] [protocols.ScalarWebAvContentProtocol] - Exception occurred retrieving the content list for scheme 'fav' and source 'fav:tv?id=1': fav:tv?id=1
java.io.IOException: fav:tv?id=1
        at org.openhab.binding.sony.internal.net.HttpResponse.createException(HttpResponse.java:176) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.AbstractScalarWebProtocol.execute(AbstractScalarWebProtocol.java:108) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAvContentProtocol.getChannelDescriptors(ScalarWebAvContentProtocol.java:225) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebProtocolFactory.getChannelDescriptors(ScalarWebProtocolFactory.java:138) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.initializeTask(ScalarWebHandler.java:201) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.lambda$0(ScalarWebHandler.java:162) ~[?:?]
        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:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
2019-03-09 14:35:24.960 [ERROR] [protocols.ScalarWebAvContentProtocol] - Exception occurred retrieving the content list for scheme 'fav' and source 'fav:tv?id=2': fav:tv?id=2
java.io.IOException: fav:tv?id=2
        at org.openhab.binding.sony.internal.net.HttpResponse.createException(HttpResponse.java:176) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.AbstractScalarWebProtocol.execute(AbstractScalarWebProtocol.java:108) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAvContentProtocol.getChannelDescriptors(ScalarWebAvContentProtocol.java:225) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebProtocolFactory.getChannelDescriptors(ScalarWebProtocolFactory.java:138) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.initializeTask(ScalarWebHandler.java:201) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.lambda$0(ScalarWebHandler.java:162) ~[?:?]
        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:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
2019-03-09 14:35:25.158 [ERROR] [protocols.ScalarWebAvContentProtocol] - Exception occurred retrieving the content list for scheme 'fav' and source 'fav:tv?id=3': fav:tv?id=3
java.io.IOException: fav:tv?id=3
        at org.openhab.binding.sony.internal.net.HttpResponse.createException(HttpResponse.java:176) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.AbstractScalarWebProtocol.execute(AbstractScalarWebProtocol.java:108) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAvContentProtocol.getChannelDescriptors(ScalarWebAvContentProtocol.java:225) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebProtocolFactory.getChannelDescriptors(ScalarWebProtocolFactory.java:138) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.initializeTask(ScalarWebHandler.java:201) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.lambda$0(ScalarWebHandler.java:162) ~[?:?]
        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:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
2019-03-09 14:35:25.405 [ERROR] [protocols.ScalarWebAvContentProtocol] - Exception occurred retrieving the content list for scheme 'fav' and source 'fav:tv?id=4': fav:tv?id=4
java.io.IOException: fav:tv?id=4
        at org.openhab.binding.sony.internal.net.HttpResponse.createException(HttpResponse.java:176) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.AbstractScalarWebProtocol.execute(AbstractScalarWebProtocol.java:108) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAvContentProtocol.getChannelDescriptors(ScalarWebAvContentProtocol.java:225) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebProtocolFactory.getChannelDescriptors(ScalarWebProtocolFactory.java:138) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.initializeTask(ScalarWebHandler.java:201) ~[?:?]
        at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.lambda$0(ScalarWebHandler.java:162) ~[?:?]
        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:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
==> /openhab/userdata/logs/events.log <==
2019-03-09 14:35:29.381 [hingStatusInfoChangedEvent] - 'sony:scalar:fcf152a50257' changed from OFFLINE (COMMUNICATION_ERROR): unsupported to UNINITIALIZED
2019-03-09 14:35:29.387 [hingStatusInfoChangedEvent] - 'sony:scalar:fcf152a50257' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

Hey @tmrobert8,

I want to power on my kdl55w905 with this Binding but when the TV is power off I get an JAVA exception no route to host. I use OH2.4 and your binding in Version 2.5 with the ircc option. With scalar the log told me “unsupported” like in the previous log. With FHEM I can power on the TV from standby. So what I have to do to do so with your binding?

@AlexKid
What is FHEM? Whatever it is, I have a feeling it’s probably sending a wake on lan packet which I’ve added to all four of the services in the next version - so that may fix the power on.

@AlexKid @Knut1507
It’s probably because of unsupported but I’m surprised there isn’t more information on what is unsupported. I’m going to add some more debug messages with the next version to see if we can tell what is unsupported and I’ll ask you to try it again with that new version.

For all - the next version will likely be posted tomorrow

Today i did a new log on DEBUG log level. I enabled the scalar thing and waited some time. The log was to big to upload so i cutted some of the channel creations.
openhab - Sony-Scalar.log (636.1 KB)

Looking forward to the new version. Will try the wake on lan integrations and give an update to my scalar thing!

is there a way to run a backdrop screensaver with the binding?

If your tv supports it the binding will probably be able to activate it.

The binding supports different services. Its recommended to use Scalar if supported by your tv.
I only used the SimpleIP so far. There is a channel called Picture Mute it turns off the display while sound still playing. Maybe this is working for your purpose already.

@Knut1507
Very interesting log - thanks for posting it. So your scalar isn’t going online because of the same issues @johfeu has (you have two “arte” apps) - the next version should fix that.

However - the unsupported is actually okay and I’m going to have to make a change for it. In a nutshell - the TV gives me a list of APIs that it supports. However - your’s reported an API that when the binding tested it - reported back ‘unsupported’. Somehow that’s being leaked up to openHAB instead of the real message (the duplicate ‘arte’ channel). I’ll see if I can get that fixed for the next version.

@suntribe
As @Knut1507 mentioned - you might want to try the picture mute channel. There is also a video scene setting mode - I’ve played with it before but haven’t the slightest idea what valid ‘scenes’ there are. Here’s what I’d do - make a sitemap that contains all the non-appcontrol channels. Turn on the TV and bring up the sitemap in openHAB - then let the TV go into the screen saver mode and see what (or if any) channels change values. If any change, then you know the values to send to try to get the TV into that mode. If none change, then that may not be possible. Note: this assumes that the ‘refresh’ config setting of the TV in openHAB is set to some positive value (so it’s actively refreshing the channels).

BTW - Is there a button on the remote that will trigger it? You’d be able to use the IRCC channel to trigger it then…

New release: https://github.com/tmrobert8/openhab2-addons/releases/tag/2.5-0312-1

Should fix some of the issues here and be a bit more stable. When a scalar thing comes online - it will write to the userdata\sony\tmpdb directory a thing definition. You can then move that to the userdata\sony\db\ directory to have it define channels even when the device is OFF on a restart. THIS IS EXPERIMENTAL and I’m likely going to still be making changes to it - but feel free to play a bit with it if you want.

Note: after you move the definition to sony\db - you’ll need to delete your device and readd it to get the definition.

Other notes:

  1. WOL is now sent on power on in SimpleIP/IRCC (not scalar)
  2. If you defined a device in sony\db directory - only the scalar will be discovered in the inbox. This is by design as people really should be using scalar over the others. You can still manually define the others however.
  3. “arte” duplicate channel issue should be solved - please let me know if it still doesn’t work
  4. A number of ‘exceptions’ are not being logged as a message (rather than a full stack trace). These are mainly ones that I know of that aren’t really exceptions.

Future stuff:

  1. I’m going to create a debug page that will help test things - after looking at your logs there is a few things in scalar (that I don’t have) that would be nice to include and I need an easy method for you all to get that information and transmit it to me - this would address that
  2. I’ve started to integrate the sonyaudio method into the plugin - I need to continue doing that
  3. There is more ‘stuff’ that is not part of the API (like the scalar content service including music and 4k markers) - I need to add those.
1 Like

Will try soon.
What is the recommended way to update the binding? GitHub reads:

Is that anything i have to to?
Last times i deleted things and used the Karaf console with bundle:uninstall. After that i copy the file and readd and relink my things.

The best way is to do:

  1. bundle:uninstall org.openhab.binding.sony from the karaf console
  2. Delete the existing jar from the addons directory - wait a minute or so
  3. Rename from .zip to .jar and move to addons directory

That’s the complete way to do it - however, you could generally just drop the new one into the addons overwritting the old one - that works maybe 80% of the time. You could also shut down openhab, overwrite the existing one and start openhab - that works about 95% of the time for me.

Note: percentages are just pure guestimates based on my experience in developing this…

TV does not power on (IRCC) for me with the latest version

@AlexKid

You need to make sure you have specified the mac address in the configuration…

Tim

1 Like

:+1:
it works

Hi,

I’ve tried to use simpleIP, it works if the my television (BRAVIA KDL-32W705B) if it is switched on. If I switch it off and trying to switch it on after a few minutes, it simply doesnt’t wake up, and I get the folllowing log. Could you please help me te find out what do I do wrong?

WOL works well for this TV if I just use the openhabian’s WOL binding.

019-03-13 21:33:38.490 [ome.event.ItemCommandEvent] - Item ‘SonySimpleIP_Power’ received command ON

2019-03-13 21:33:38.495 [nt.ItemStatePredictedEvent] - SonySimpleIP_Power predicted to become OFF

==> /var/log/openhab2/openhab.log <==

2019-03-13 21:33:38.500 [DEBUG] [y.internal.simpleip.SimpleIpProtocol] - Sending WOL packet to d8:d4:3c:f9:25:41 (192.168.0.104)

2019-03-13 21:33:38.506 [DEBUG] [y.internal.simpleip.SimpleIpProtocol] - Sending ‘*SCPOWR0000000000000001’

2019-03-13 21:33:38.528 [DEBUG] [ny.internal.net.SocketChannelSession] - Connecting to 192.168.0.104:20060

==> /var/log/openhab2/events.log <==

2019-03-13 21:33:42.816 [vent.ItemStateChangedEvent] - BraviaTVPing_Online changed from ON to OFF

2019-03-13 21:33:42.823 [vent.ItemStateChangedEvent] - Bravia changed from ON to OFF

2019-03-13 21:33:44.009 [hingStatusInfoChangedEvent] - ‘sony:simpleip:38507b87’ changed from OFFLINE (COMMUNICATION_ERROR): Error connecting to simple IP tv to OFFLINE (COMMUNICATION_ERROR): Exception occurred sending command: java.net.NoRouteToHostException: No route to host (Host unreachable)

==> /var/log/openhab2/openhab.log <==

2019-03-13 21:33:54.008 [DEBUG] [ny.internal.net.SocketChannelSession] - Connecting to 192.168.0.104:20060

==> /var/log/openhab2/events.log <==

2019-03-13 21:33:56.021 [hingStatusInfoChangedEvent] - ‘sony:simpleip:38507b87’ changed from OFFLINE (COMMUNICATION_ERROR): Exception occurred sending command: java.net.NoRouteToHostException: No route to host (Host unreachable) to OFFLINE (COMMUNICATION_ERROR): Error connecting to simple IP tv

Hi @tmrobert8, I can’t seem to find this functionality… or at least, I don’t know how to use is? I’ve grepped all files for it and can’t find any files…

Is that the correct mac address and ip address of your TV?

Should be in your openhab userdata directory. On windows it would likely be “c:\openhab2\userdata\sony\db” - not exactly sure where it would be on your setup…

Yes it is. I use the same mac address in the WOL binding in openhab. I’ve tried with uppercase characters as well, but no luck. The ip address is ok but as I know for WOL we don’t use it (we use bradcasting ip, so something like 192.168.0.255 shall be used, so I guess it is written there just for information, but the in the WOL you use the above mentioned boradcasting IP, as written here (https://www.openhab.org/addons/bindings/wol1/).

Is it correct?
How can I log it to help you?

Currenty I use the normal WOL binding to wake the TV up, after that yout binding works well to change volume, source and switch the TV OFF.

Well - since I don’t have a broadcast address - I’m taking the device address, chopping off the last node and replacing it with 255. So if you’re address is 192.168.0.111 - should be 192.168.0.255. Note that the logging message is before that - just telling me the ipaddress/mac that it will use to generate the wol packet.

I’ll look into it a bit more and see if I made a mistake anywhere on that…