Sony Binding [3.2.0;3.9.0)

@DrRSatzteil @mario1967

I opened an issue a few weeks ago ( [marketplace] Failed reinstalling add-on from cache on restart · Issue #2614 · openhab/openhab-core (github.com)) and until now have assumed that it had been fixed as it didn’t re-occur for me.

Strangely enough, in a today’s test I did see this issue again but without any log info, so I guess there is something else not working properly which I 'm now going to investigate.

You could try to re-install the binding from the local cache as follows (note that the path depends on your environment)

kar:install file:/var/lib/openhab/marketplace/kar/128262/org.openhab.binding.sony-3.2.0.kar

If you use the release build, this should not occur.

I’m using the release build and I think I can confirm that the mentioned Github issue has been fixed.

The current issue shows a different behaviour: The binding appears as ‘Resolved’ for a short time in the bundle list and then disappears without any log info. But it can be manually installed from the marketplace cache without problems. So I assume that something goes wrong with the binding installation on startup. Any hint for further investigation would be helpful.

1 Like

I’m also using the release build but haven’t noticed that the behaviour is different now. I just thought nothing had changed since I still see the thing in UNINITIALIZED state on startup. Please let me know if I can assist by sending log files or anything.

Just looked through the list of channels and can’t identify a further one that is dynamically generated.
Do you have one in mind that i can test? And is there something else i can provide while i am at it?
Thanks :slight_smile:

I’ve created a new topic Problem with binding from marketplace being installed and subsequently uninstalled on OH start-up for this issue as my current analysis of the log files have been unsuccessful. At least I would have expected to see a warning or error message in the log files, which I haven’t.

So for now the only option I see is to await a helpful response unless you have made other or complementing observations than I’ve stated in the issue topic.

I’ve published a new version on the marketplace that should fix the issue with binding removal on (re-) start of openhab.

@andan Removed and re-installed the binding, after reboot loaded as planned :smile:
Thanks for the fix.

What could help if you copuld send me details of your item and UI configs. Please also check if the items are properly linked to the channels (one channel per item, no orphan links etc).

Works for me as well! Thank you!

And now I can install the binding from the marketplace as well.

Ok here are some details:

Thing definition (I removed the MacAdress and access code)

Thing sony:scalar:mysonytv "Sony TV - Scalar" [ deviceMacAddress="xxx", deviceAddress="http://192.168.1.11", ignoreChannels="analog", checkStatusPolling=30, accessCode="xxxx", refresh=30, commandsMapFile="KD-49XD7005-Scalar.map", retryPolling=30 ]

Items (also includes metadata for Google Assistant)

/* Sony TV */
Group  gTv "TV" { ga="TV" [ volumeDefaultPercentage="18", levelStepSize="1", volumeMaxLevel="22", availableApplications="Startseite=Startseite:Startmenü,YouTube=YouTube,Netflix=Netflix,ARD-Mediathek=ARD-Mediathek,ZDFmediathek=ZDFmediathek,ARTE=ARTE,Kodi=Kodi", availableChannels="001=channel001=ARD,002=channel002=ARD_alpha,003=channel003=ONE,004=channel004=ZDF,005=channel005=ZDF_neo,006=channel006=ZDFinfo,007=channel007=WDR" ] }
Switch Sw_Tv_State_Lr "TV Power" <screen> (gTv) { channel="sony:scalar:mysonytv:system#powerstatus", ga="tvPower" }
String St_Tv_Source_Lr "TV Quelle" <list> (gTv) { channel="sony:scalar:mysonytv:avContent#tm_source-main" }
Dimmer Di_Tv_Volume_Lr "TV Lautstärke [%d]" <soundvolume> (gTv) { channel="sony:scalar:mysonytv:audio#volume-speaker", ga="tvVolume" }
Switch Sw_Tv_Mute_Lr "TV Mute" <mutesound> (gMutemultimedia, gTV) { channel="sony:scalar:mysonytv:audio#mute-speaker", ga="tvMute" }
String St_Tv_Channel_Lr "TV Kanal [%s]" <video> (gTv) { channel="sony:scalar:mysonytv:avContent#ps_channel-dvbt", ga="tvChannel" }
String St_Tv_PowerSavings_Lr "TV Displayabschaltung []" <screen>  { channel="sony:scalar:mysonytv:system#powersavingmode" }

Sitemap

Frame label="Video" {
				Switch item=Sw_Tv_State_Lr
				Selection item=St_Tv_Source_Lr mappings=["tv:dvbt"="TV", "extInput:hdmi?port=3"="HDMI3"]
				Setpoint item=Di_Tv_Volume_Lr minValue=0 maxValue=26 step=1
				Switch item=Sw_Tv_Mute_Lr
				Selection item=St_Tv_Channel_Lr mappings=["001"="ARD", "002"="ARD alpha", "003"="ONE", "004"="ZDF", "005"="ZDF_neo", "006"="ZDFinfo", "007"="WDR"]
				Switch item=St_Tv_PowerSavings_Lr mappings=["off"="aus", "pictureOff"="an"]
			}

IMO the definition should be alright, but i assume you don’t like the Thing definition in the textfile with pre-shared key :slight_smile:

EDIT: But i just gave it a try with re-enabling scalar discovery and configuring via UI with a requested “RQST” key. But same problem, these two items do not refresh.

However when initialzing with the UI configured Thing no error shows up in the log. But with my text file definition this shows up (maybe it’s interesting for you):

2022-01-06 06:26:56.993 [WARN ] [ache.cxf.phase.PhaseInterceptorChain] - Interceptor for {http://192.168.1.11:10000/sony/guide}WebClient has thrown exception, unwinding now

org.apache.cxf.interceptor.Fault: Could not send Message.

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67) ~[?:?]

	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[?:?]

	at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:703) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:932) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:461) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.method(SyncInvokerImpl.java:150) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.method(SyncInvokerImpl.java:145) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.post(SyncInvokerImpl.java:85) ~[?:?]

	at org.apache.cxf.jaxrs.client.spec.InvocationBuilderImpl.post(InvocationBuilderImpl.java:153) ~[?:?]

	at org.openhab.binding.sony.internal.net.HttpRequest.sendPostCommand(HttpRequest.java:158) ~[?:?]

	at org.openhab.binding.sony.internal.net.HttpRequest.sendPostJsonCommand(HttpRequest.java:138) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executePostJson(SonyHttpTransport.java:331) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executePostJson(SonyHttpTransport.java:308) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:129) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyTransport.execute(SonyTransport.java:108) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.tryDefaultClientUrl(ScalarWebClientFactory.java:166) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.getDefaultClient(ScalarWebClientFactory.java:125) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.get(ScalarWebClientFactory.java:101) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.get(ScalarWebClientFactory.java:80) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.connect(ScalarWebHandler.java:327) ~[?:?]

	at org.openhab.binding.sony.internal.AbstractThingHandler.doConnect(AbstractThingHandler.java:137) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	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:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

Caused by: java.net.ConnectException: ConnectException invoking http://192.168.1.11:10000/sony/guide: Connection refused (Connection refused)

	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]

	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]

	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]

	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1400) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1384) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77) ~[?:?]

	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671) ~[?:?]

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63) ~[?:?]

	... 28 more

Caused by: java.net.ConnectException: Connection refused (Connection refused)

	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]

	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]

	at java.net.Socket.connect(Socket.java:609) ~[?:?]

	at sun.net.NetworkClient.doConnect(NetworkClient.java:177) ~[?:?]

	at sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[?:?]

	at sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[?:?]

	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[?:?]

	at sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[?:?]

	at sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1232) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1367) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1342) ~[?:?]

	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:274) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1343) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1304) ~[?:?]

	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:307) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) ~[?:?]

	at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77) ~[?:?]

	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671) ~[?:?]

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63) ~[?:?]

	... 28 more

2022-01-06 06:26:57.184 [WARN ] [ache.cxf.phase.PhaseInterceptorChain] - Interceptor for {http://192.168.1.11:54480/sony/guide}WebClient has thrown exception, unwinding now

org.apache.cxf.interceptor.Fault: Could not send Message.

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67) ~[?:?]

	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[?:?]

	at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:703) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:932) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901) ~[?:?]

	at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:461) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.method(SyncInvokerImpl.java:150) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.method(SyncInvokerImpl.java:145) ~[?:?]

	at org.apache.cxf.jaxrs.client.SyncInvokerImpl.post(SyncInvokerImpl.java:85) ~[?:?]

	at org.apache.cxf.jaxrs.client.spec.InvocationBuilderImpl.post(InvocationBuilderImpl.java:153) ~[?:?]

	at org.openhab.binding.sony.internal.net.HttpRequest.sendPostCommand(HttpRequest.java:158) ~[?:?]

	at org.openhab.binding.sony.internal.net.HttpRequest.sendPostJsonCommand(HttpRequest.java:138) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executePostJson(SonyHttpTransport.java:331) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.executePostJson(SonyHttpTransport.java:308) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyHttpTransport.execute(SonyHttpTransport.java:129) ~[?:?]

	at org.openhab.binding.sony.internal.transports.SonyTransport.execute(SonyTransport.java:108) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.tryDefaultClientUrl(ScalarWebClientFactory.java:166) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.getDefaultClient(ScalarWebClientFactory.java:130) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.get(ScalarWebClientFactory.java:101) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebClientFactory.get(ScalarWebClientFactory.java:80) ~[?:?]

	at org.openhab.binding.sony.internal.scalarweb.ScalarWebHandler.connect(ScalarWebHandler.java:327) ~[?:?]

	at org.openhab.binding.sony.internal.AbstractThingHandler.doConnect(AbstractThingHandler.java:137) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	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:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

Caused by: java.net.ConnectException: ConnectException invoking http://192.168.1.11:54480/sony/guide: Connection refused (Connection refused)

	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]

	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]

	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]

	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1400) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1384) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77) ~[?:?]

	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671) ~[?:?]

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63) ~[?:?]

	... 28 more

Caused by: java.net.ConnectException: Connection refused (Connection refused)

	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]

	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]

	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]

	at java.net.Socket.connect(Socket.java:609) ~[?:?]

	at sun.net.NetworkClient.doConnect(NetworkClient.java:177) ~[?:?]

	at sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[?:?]

	at sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[?:?]

	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[?:?]

	at sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[?:?]

	at sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1232) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1367) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1342) ~[?:?]

	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:274) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1343) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1304) ~[?:?]

	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:307) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) ~[?:?]

	at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356) ~[?:?]

	at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77) ~[?:?]

	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[?:?]

	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671) ~[?:?]

	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63) ~[?:?]

	... 28 more

Just did some further testing and with directly calling avContent.getPlayingContentInfo() it nicely shows the different tv channels and tv inputs:

-- avContent.getPlayingContentInfo() --
status: 200
{
  "result": [
    {
      "uri": "extInput:cec?type=player&port=3&logicalAddr=4",
      "source": "",
      "title": "Chromecast"
    }
  ],
  "id": 1
}
-- avContent.getPlayingContentInfo() --
status: 200
{
  "result": [
    {
      "uri": "tv:dvbt?trip=41985.1051.11100&srvName=Das Erste HD",
      "source": "tv:dvbt",
      "title": "Das Erste HD",
      "dispNum": "001",
      "tripletStr": "41985.1051.11100",
      "programTitle": "ARD-Morgenmagazin",
      "startDateTime": "2022-01-07T05:30:00+0100",
      "durationSec": 12600
    }
  ],
  "id": 1
}
-- avContent.getPlayingContentInfo() --
status: 200
{
  "result": [
    {
      "uri": "tv:dvbt?trip=9999.411.41105&srvName=ARD-alpha HD",
      "source": "tv:dvbt",
      "title": "ARD-alpha HD",
      "dispNum": "002",
      "tripletStr": "9999.411.41105",
      "programTitle": "Bob Ross  The Joy of Painting",
      "startDateTime": "2022-01-07T05:30:00+0100",
      "durationSec": 1800
    }
  ],
  "id": 1
}

Ok good news, i think you can stop searching for the error.
This item has to be defined and then the others work as well, although i don’t use it somewhere else.

String      St_Tv_PlayingURI_Lr  			"Playing URI"													{ channel="sony:scalar:mysonytv:avContent#pl_uri-main" }

It would be nice to know if you can reproduce the error. If yes maybe this could and should be fixed.
Why should one define items as condition that other items work as expected. Especially with this vast number of channels within this binding… It was pure luck that i found this out.

Thank you for your analysis.

I will do some further investigation when time permits. However, I don’t think that your observed issue is directly related to the missing item definition. I haven’t defined that item either and the refreshing is working fine for me on externally driven state changes.

I have two observations regarding the binding:

I realised today that when my bd-player is switched off, the corresponding switch item linked to the power state channel is actually set to ON. It would be great if the binding would assume that the device is OFF when it is not reachable. Even though there may be other reasons why the device communication fails this should be the normally expected behaviour in my opinion (device not reachable → assume it has been switched off).

I can also see in the UI that the thing is permanently trying to connect to the bd player but fails (which is ok since it’s off). Maybe it would make sense to have a small timeout between connection retries? There is no real point to retry immediately after the binding detected that the player is currently offline.

Which service are you using for your BD player? I’m using the power channel from the IRCC service for my BD player and this seems to work fine for me (item shows off when player is offline).

Re retry pattern: I think there is no general rule for things that might be switched on or off at any time. So I will keep the existing logic as ‘best’ compromise. I might think about making the retry process less visible. Note that the technical process is quite leightweight.

I set up the player as Sony Scalar Web thing. I actually tried all other thing types as well but this was the only one working. I’m using the powerstatus channel which works to switch the device off. As its in a different network I use a net directed broadcast and not the binding itself to switch it on.

I don’t mind the connection retries too much. It’s probably just a bit more obvious than with other bindings as it changes it’s state and color a lot :wink:

EDIT: I deleted the thing and readded it again. It seems to work ok now. Maybe this was a misconfiguration on my end. I added the thing manually as discovery did not find anything. Maybe because my device is just so old? :sweat_smile:

I had some time to review your issue and discovered some logic in the code which explains your observed behaviour.

The item states for the channels avContent#tm_source-main and avContent#ps_channel-dvbt are updated through a refreshing of the playing content info channels (=channels which names start with avContent#pl_). However, for performance reasons the playing content refresh is only called if there exists linked items to at least one of these channels. This explains why the definition of an item linked to avContent#pl_uri-main channel solve the issue. Any other pl_ type channel should also work.

I hope to get this issue fixed without the need of defining playing content items in the upcoming binding release.

2 Likes

Probably an unusual situation, but I thought I would ask. I am only using the Sony binding to turn off and on the lights in the TV room (TV On-Lights Off, TV Off- Lights On). Wife has control of the Sony remote and is generally not a fan of my home automation ideas, although she likes the light ON-OFF idea.

I have an ethernet connected Sony Bravia set up with Simple IP on Rpi4. I’m on OH3.3 but have an earlier Sony binding.
234 │ Active │ 80 │ 3.2.0.202201041123 │ openHAB Add-ons :: Bundles :: Sony Binding

The issue is she unplugs the TV after we are done watching. It has surge protection, but she is still concerned. While unplugged the binding keeps pinging the IP (I reduced the frequency from 10 to 30 seconds). Separately, I could ID if the TV is plugged in via the network binding. What I’m thinking is to deactivate (or raise to a high number) the polling parameter when the TV is unplugged, but restore the 10 second value when the TV is plugged in. With some Z-wave devices I can create a channel for a parameter and send an update to the item (linked to the channel) and change the parameter. I do this to reduce Zwave traffic. For instance, if I’m on the desktop PC, I get frequent watt readings, but if the PC is off the watt readings go to 2 hours.

Does this sound possible (create a channel for the retry parameter)? Or do you have another idea?

Thanks

Bob