Sony Binding [3.2.0;3.9.0)

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

Hi Bob,

I think an alternative is just to disable the retry polling by setting the intervall to -1. In this case, when the binding receives a command while the thing is offline, it will try to switch on the TV via Wake on LAN and will process the command when the TV becomes online.

Note that this requires that the MAC address is set. Also the latest binding version should be used where some issues concerning offline handling have been fixed.

Regards

I think I have this working. Retry -1; Updated binding; MAC address set; by Rule: network binding sends a “refresh” to Sony binding power switch item when TV is plugged in (ping). It did not work (stayed offline- error) when the TV was started with the manual remote.

Thanks

Bob

This binding seems to be ignoring OH network preferences, if you use a lower metric for the NIC you should not be using in OH (in windows) but configure OH to use the other higher metric NIC as prefered network, it still tries to use the lower metric NIC.