Sony Binding [4.0.0.0;4.4.0.0)

This binding is for Sony IP based product line including TVs, BDVs, AVRs, Blurays, Soundbars and Wireless Speakers.

This is the OH 4.2 compatible version of Sony Binding [3.2.0;4.0.0). Installation details and documentation can be found there.

Version 4.3.0

  • OH 4.3 upgrade with minor fixes

Version 4.0.0

  • Initial 4.0 compatible version

Resources

https://github.com/andan67/openhab-addons/releases/download/openhab-addons-sony-4.3.0/org.openhab.binding.sony-4.3.0.202412181559.kar

2 Likes

Is it in any way possible to send text messages to a Sony TV?
I tried different ways with no success.

You could try with the the channel appControl#textForm
Reference: setTextForm (v1.0) | BRAVIA Professional Displays Knowledge Center (sony.net)

Nope, does not work

It does not work indeed… anybody succeed to send a text message using this binding?

Thanks!

Hi

Trying to clean the openhab.log file I have found some logs that seems to be related with Sony Binding:

2024-04-21 16:39:24.014 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.IllegalArgumentException: Invalid media type string: Content-Type: image/png
	at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.internalValueOf(MediaTypeHeaderProvider.java:90) ~[?:?]
	at org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider.valueOf(MediaTypeHeaderProvider.java:65) ~[?:?]
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.toMediaType(JAXRSUtils.java:1962) ~[?:?]
	at org.apache.cxf.jaxrs.impl.ResponseImpl.getMediaType(ResponseImpl.java:313) ~[?:?]
	at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:431) ~[?:?]
	at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:410) ~[?:?]
	at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:400) ~[?:?]
	at org.openhab.binding.sony.internal.net.HttpResponse.<init>(HttpResponse.java:90) ~[?:?]
	at org.openhab.binding.sony.internal.net.HttpRequest.sendGetCommand(HttpRequest.java:100) ~[?:?]
	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executeGet(SonyHttpTransport.java:272) ~[?:?]
	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:112) ~[?:?]
	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:242) ~[?:?]
	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:225) ~[?:?]
	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executeGet(SonyHttpTransport.java:165) ~[?:?]
	at org.openhab.binding.sony.internal.net.NetUtil.getRawType(NetUtil.java:262) ~[?:?]
	at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAppControlProtocol.refreshAppIcon(ScalarWebAppControlProtocol.java:345) ~[?:?]
	at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAppControlProtocol.refreshChannel(ScalarWebAppControlProtocol.java:224) ~[?:?]
	at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebAppControlProtocol.refreshState(ScalarWebAppControlProtocol.java:200) ~[?:?]
	at org.openhab.binding.sony.internal.scalarweb.protocols.ScalarWebProtocolFactory.lambda$2(ScalarWebProtocolFactory.java:167) ~[?:?]
	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:833) [?:?]

Would it be possible to solve it?

  • Platform information:
    • Hardware: AMD/8Mb RAM/SSD 512Gb PCIe3
    • OS: W10Pro
    • Java Runtime Environment: Zulu Java 17
    • openHAB version: 4.1.1.

Regards

Diego

I will try to analyse this issue when I have some spare time. I understand that this is only a logging issue and not an observable defect, Please correct me if I’m wrong.

Seeing this error using 4.2.0.M3

TV - KD-65X9000H

2024-06-14 11:57:17.568 [INFO ] [g.sony.internal.AbstractThingHandler] - Received power on command when thing is offline - trying to turn on thing via WOL
2024-06-14 11:57:19.568 [WARN ] [g.sony.internal.AbstractThingHandler] - Malformed device url

Used to work just fine, until I bumped the OH release from 4.1.3

things file

sony:simpleip:home [ deviceAddress="192.168.60.94", commandsMapFile="bravia.map" ]

Appreciate not really supported so more just a heads up than a request for help! Would be nice if it worked though :wink:

I will look at this issue in course of the planned 4.2 upgrade of this binding.

I guess your issue is caused by a regression error which was introduced in the latest version 4.0.0.202405191519 of the binding and which manifests only for the simpleip protocol.

Therefore, I’ve linked the previous version here, so a re-installation of the binding from the marketplace should hopefully fix your issue.

A quick test of the binding against OH4.2.0.M3 with IRCC and Scalar protocols showed no errors. So I expect no general issues with the new OH version.

Works a treat, thank you :slight_smile:

Hi, i raised an pull-request against your fork: Sony 4.2 by falkena · Pull Request #1 · andan67/openhab-addons · GitHub. Additionally issue reported in Sony Binding [4.0.0.M1;4.2.0) - #6 by DiegoGR is fixed. May be it’s of interest.

Greetings,

Alexander

Seems the binding is unavailable for 4.2.0, will it be released in due course?

I’ve made the current version available for 4.2.0. A quick test revealed no major issues.

I also plan to release a revised version which would include the changes from @falkena.

I have modified the version range in the title from “4.0.0.M1;4.3.0)” to “4.0.0.0;4.3.0.0”, so that it will correctly will show up in versions 4.0-4.2. Before this change it also showed up in 4.3.

Please test the SONY AddOn together with the Fritzbox AddOn (TR-064). This combination leads to a crash. In the openhab.log you will then find lines like:
(only in OpenHAB-Version > 4.1.3)

2024-08-12 12:04:25.340 [ERROR] [ternal.scalarweb.service.SonyServlet] - bundle org.openhab.binding.sony:4.0.0.202305291652 (286)[org.openhab.binding.sony.internal.scalarweb.service.SonyServlet(405)] : The activate method has thrown an exception

2024-08-12 12:04:27.600 [ERROR] [.internal.scalarweb.ScalarWebHandler] - Unhandled exception connecting to Scalar Web device: java.lang.ClassNotFoundException

2024-08-12 12:04:27.616 [ERROR] [ce.jetty.internal.JettyServerWrapper] - Multiple servlets map to path /sony/*: default-e5e325d3-02a6-4e19-9131-5d7af1e83116[mapped:EMBEDDED:null],default-c4933897-2778-466c-9932-63ab14747a9b[mapped:EMBEDDED:null]

I confirm Problems with TR-064 after installing sony binding.
Sadly I cannot connect my Sony TV without this binding.
But when this binding is installed, one of my TR-064-things (one of two Fritz!Boxes) does not work.
Can someone explain, why or - even better - correct this error?

I’ve just published a new binding version on the market place (thanks to the contributions from @falkena). There is a chance that this version fixes your issue, but this is not guaranteed.

Thus I’d suggest to run a test test with the new version. If this doesn’t help, I would start with further investigation.

Thank you very much for your support. Unfortunately, the error has not yet been rectified. The following message can be found in the openhab.log after a crash:

2024-09-03 11:17:20.519 [ERROR] [ternal.scalarweb.service.SonyServlet] - bundle org.openhab.binding.sony:4.3.0.202407181828 (320)[org.openhab.binding.sony.internal.scalarweb.service.SonyServlet(589)] : The activate method has thrown an exception
java.lang.IllegalStateException: Multiple servlets map to path /sony/app/*: org.openhab.binding.sony.internal.scalarweb.service.SonyServlet[mapped:EMBEDDED:null],org.openhab.binding.sony.internal.scalarweb.service.SonyServlet[mapped:EMBEDDED:null]

Thank you Andreas!
I tried the binding today, and it is even worse, because now my OH 4.2.1 (running on Win10 as service) crashes completely after a few minutes.
No change after several restarts.
Bevore the last crash I could save this message from the thing:

Status: OFFLINE
COMMUNICATION_ERROR
Unhandled exception connecting to Scalar Web device (may need to turn it on manually): Cannot invoke “java.util.List.size()” because “content” is null

webdevice is online, I checked it.
Had to uninstall your binding to get my OH to work again.
Sorry for these bad news.