Sony Devices Binding

Long time lurker, first time poster here.

I am Vera Plus refugee and moved over my whole system to openhab.
With the help of all the documentation and this forum I was able to get more things working than I even imagined when I started - so thank you for that!

But now I have hit a road block.
I am trying to create a ircc thing to control my (rather old) Sony BD Player BDP-S490.
I was hoping I could detect wether it is starting a BD to automagically turn off the lights.

When I try to create a thing from PaperUI discovery menu the player is never found although it is turned on. So when I use ā€œadd manuallyā€ the config menu is presented, I fill in IP and MAC but I am missing the map file.
I created that manually from posts I found in this thread so I could close the config dialog.
The thing created is always in state of

OFFLINE - COMMUNICATION_ERROR Error connecting to IRCC device (may need to turn it on manually): java.net.ConnectException: Connection refused (Connection refused)

This is in the log

2019-08-18 12:28:32.617 [INFO ] [nding.sony.internal.ircc.IrccHandler] - Attempting connection to IRCC device...

2019-08-18 12:28:32.623 [DEBUG] [ding.sony.internal.ircc.IrccProtocol] - WOL packet sent to 54:53:ED:5C:5C:B2

2019-08-18 12:28:32.715 [DEBUG] [inding.sony.internal.net.HttpRequest] - 1 * Sending client request on thread OH-thingHandler-3

1 > GET http://192.168.2.102

1 > Connection: close

1 > User-Agent: OpenHab/Sony/Binding

1 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

1 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

So here it goes:

  • should the BD player be discovered automatically?
  • what is the correct format for the URL (I tried with/without http and port :50002)?
  • how do I discover the right access code (is set to RQST right now, had the player in listening mode for control apps in itā€™s network settings menu)?
    Any help is greatly appreciated!

EDIT
Out of the blue after one day (!) a thing was discovered after I restarted OH (BD player was off at that time, strange).
Now in PaperUI the thing states

 OFFLINE - CONFIGURATION_ERROR 403 - Forbidden

On the Config page in PaperUI everthing was prepopulated (IP,MAC), only access code is still on RQST.
Any ideas how I can get hold off a valid access code?

2019-08-18 22:15:23.660 [DEBUG] [ternal.dial.DialDiscoveryParticipant] - No specific thing type found for Blu-ray Disc Player

2019-08-18 22:15:23.662 [DEBUG] [ternal.ircc.IrccDiscoveryParticipant] - Found Sony IRCC service: uuid:00000003-0000-1010-8000-5453ed5c5cb2

2019-08-18 22:15:23.664 [DEBUG] [ternal.ircc.IrccDiscoveryParticipant] - No specific thing type found for Blu-ray Disc Player

2019-08-18 22:15:23.806 [DEBUG] [inding.sony.internal.net.HttpRequest] - 1 * Sending client request on thread upnp-main-411

1 > GET http://192.168.2.102:50001/Ircc.xml

1 > Connection: close

1 > User-Agent: OpenHab/Sony/Binding

1 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

1 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2019-08-18 22:15:23.820 [DEBUG] [inding.sony.internal.net.HttpRequest] - 1 * Client response received on thread upnp-main-411

1 < 200

1 < Accept-Ranges: none

1 < Connection: close

1 < content: text/xml; charset=utf-8

1 < Content-Length: 2801

1 < Date: Sun, 18 Aug 2019 20:15:22 GMT

1 < Server: Linux/2.6 UPnP/1.0 Sony-BDP/2.0

<?xml version="1.0"?>

<root xmlns="urn:schemas-upnp-org:device-1-0">

  <specVersion>

    <major>1</major>

    <minor>0</minor>

  </specVersion>

  <device>

    <deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>

    <friendlyName>Blu-ray Disc Player</friendlyName>

    <manufacturer>Sony Corporation</manufacturer>

    <manufacturerURL>http://www.sony.net/</manufacturerURL>

    <modelDescription></modelDescription>

    <modelName>Blu-ray Disc Player</modelName>

    <modelURL></modelURL>

    <UDN>uuid:00000003-0000-1010-8000-5453ed5c5cb2</UDN>

    <iconList>

      <icon>

        <mimetype>image/jpeg</mimetype>

        <width>120</width>

        <height>120</height>

        <depth>24</depth>

        <url>/bdp_bx_device_icon_large.jpg</url>

      </icon>

      <icon>

        <mimetype>image/png</mimetype>

        <width>120</width>

        <height>120</height>

        <depth>24</depth>

        <url>/bdp_bx_device_icon_large.png</url>

      </icon>

      <icon>

        <mimetype>image/jpeg</mimetype>

        <width>48</width>

        <height>48</height>

        <depth>24</depth>

        <url>/bdp_bx_device_icon_small.jpg</url>

      </icon>

      <icon>

        <mimetype>image/png</mimetype>

        <width>48</width>

        <height>48</height>

        <depth>24</depth>

        <url>/bdp_bx_device_icon_small.png</url>

      </icon>

    </iconList>

    <serviceList>

      <service>

        <serviceType>urn:schemas-sony-com:service:IRCC:1</serviceType>

        <serviceId>urn:schemas-sony-com:serviceId:IRCC</serviceId>

        <SCPDURL>/IRCCSCPD.xml</SCPDURL>

        <controlURL>/upnp/control/IRCC</controlURL>

        <eventSubURL></eventSubURL>

      </service>

    </serviceList>

    <presentationURL></presentationURL>

    <av:X_IRCC_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

      <av:X_IRCC_Version>1.0</av:X_IRCC_Version>

      <av:X_IRCC_CategoryList>

        <av:X_IRCC_Category>

          <av:X_CategoryInfo>AAMAABxa</av:X_CategoryInfo>

        </av:X_IRCC_Category>

      </av:X_IRCC_CategoryList>

    </av:X_IRCC_DeviceInfo>

    <av:X_UNR_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

      <av:X_UNR_Version>1.2</av:X_UNR_Version>

      <av:X_CERS_ActionList_URL>http://192.168.2.102:50002/actionList</av:X_CERS_ActionList_URL>

    </av:X_UNR_DeviceInfo>

    <av:X_S2MTV_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

      <av:X_S2MTV_Version>1.0</av:X_S2MTV_Version>

      <av:X_S2MTV_BaseURL>http://192.168.2.102:50003/</av:X_S2MTV_BaseURL>

    </av:X_S2MTV_DeviceInfo>

    <av:X_RDIS_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

      <av:X_RDIS_Version>1.0</av:X_RDIS_Version>

      <av:X_RDIS_SESSION_CONTROL>false</av:X_RDIS_SESSION_CONTROL>

      <av:X_RDIS_ENTRY_PORT>50004</av:X_RDIS_ENTRY_PORT>

    </av:X_RDIS_DeviceInfo>

  </device>

</root>

2019-08-18 22:15:23.835 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2 * Sending client request on thread upnp-main-411

2 > GET http://192.168.2.102:50001/IRCCSCPD.xml

2 > Connection: close

2 > User-Agent: OpenHab/Sony/Binding

2 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

2 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2019-08-18 22:15:23.847 [DEBUG] [inding.sony.internal.net.HttpRequest] - 2 * Client response received on thread upnp-main-411

2 < 200

2 < Accept-Ranges: none

2 < Connection: close

2 < content: text/xml; charset=utf-8

2 < Content-Length: 1760

2 < Date: Sun, 18 Aug 2019 20:15:22 GMT

2 < Last-Modified: Fri, 07 Nov 2014 07:15:00 GMT

2 < Server: Linux/2.6 UPnP/1.0 Sony-BDP/2.0

<?xml version="1.0"?>

<scpd xmlns="urn:schemas-upnp-org:service-1-0">

  <specVersion>

    <major>1</major>

    <minor>0</minor>

  </specVersion>

  

  <actionList>

    <action>

      <name>X_SendIRCC</name>

      <argumentList>

        <argument>

          <name>IRCCCode</name>

          <direction>in</direction>

          <relatedStateVariable>X_A_ARG_TYPE_IRCCCode</relatedStateVariable>

        </argument>

      </argumentList>

    </action>

        

    <action>

      <name>X_GetStatus</name>

      <argumentList>

        <argument>

          <name>CategoryCode</name>

          <direction>in</direction>

          <relatedStateVariable>X_A_ARG_TYPE_Category</relatedStateVariable>

        </argument>

        <argument>

          <name>CurrentStatus</name>

          <direction>out</direction>

          <relatedStateVariable>X_A_ARG_TYPE_CurrentStatus</relatedStateVariable>

        </argument>

        <argument>

          <name>CurrentCommandInfo</name>

          <direction>out</direction>

          <relatedStateVariable>X_A_ARG_TYPE_CurrentCommandInfo</relatedStateVariable>

        </argument>

      </argumentList>

    </action>

  </actionList>

  

  <serviceStateTable>

    <stateVariable sendEvents="no">

      <name>X_A_ARG_TYPE_IRCCCode</name>

      <dataType>string</dataType>

    </stateVariable>

    <stateVariable sendEvents="no">

      <name>X_A_ARG_TYPE_Category</name>

      <dataType>string</dataType>

    </stateVariable>

    <stateVariable sendEvents="no">

      <name>X_A_ARG_TYPE_CurrentStatus</name>

      <dataType>string</dataType>

    </stateVariable>

    <stateVariable sendEvents="no">

      <name>X_A_ARG_TYPE_CurrentCommandInfo</name>

      <dataType>string</dataType>

    </stateVariable>

  </serviceStateTable>

</scpd>

2019-08-18 22:15:23.862 [DEBUG] [inding.sony.internal.net.HttpRequest] - 3 * Sending client request on thread upnp-main-411

3 > GET http://192.168.2.102:50002/actionList

3 > Connection: close

3 > User-Agent: OpenHab/Sony/Binding

3 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

3 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2019-08-18 22:15:23.878 [DEBUG] [inding.sony.internal.net.HttpRequest] - 3 * Client response received on thread upnp-main-411

3 < 200

3 < Access-Control-Allow-Origin: *

3 < Cache-Control: no-cache

3 < Connection: close

3 < content: text/xml

3 < Date: Sun, 18 Aug 2019 20:15:23 GMT

3 < Pragma: no-cache

3 < Server: Linux/2.6 Sony-BDP/2.0

3 < Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>

<actionList>

  <action name="register" mode="1" url="http://192.168.2.102:50002/register"/>

  <action name="getText" url="http://192.168.2.102:50002/getText"/>

  <action name="sendText" url="http://192.168.2.102:50002/sendText"/>

  <action name="getContentInformation" url="http://192.168.2.102:50002/getContentInformation"/>

  <action name="getSystemInformation" url="http://192.168.2.102:50002/getSystemInformation"/>

  <action name="getRemoteCommandList" url="http://192.168.2.102:50002/getRemoteCommandList"/>

  <action name="getStatus" url="http://192.168.2.102:50002/getStatus"/>

  <action name="getHistoryList" url="http://192.168.2.102:50002/getHistoryList"/>

  <action name="getContentUrl" url="http://192.168.2.102:50002/getContentUrl"/>

  <action name="sendContentUrl" url="http://192.168.2.102:50002/sendContentUrl"/>

</actionList>

2019-08-18 22:15:23.888 [DEBUG] [inding.sony.internal.net.HttpRequest] - 4 * Sending client request on thread upnp-main-411

4 > GET http://192.168.2.102:50002/getSystemInformation

4 > Connection: close

4 > User-Agent: OpenHab/Sony/Binding

4 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

4 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2019-08-18 22:15:23.901 [DEBUG] [inding.sony.internal.net.HttpRequest] - 4 * Client response received on thread upnp-main-411

4 < 200

4 < Access-Control-Allow-Origin: *

4 < Cache-Control: no-cache

4 < Connection: close

4 < content: text/xml

4 < Date: Sun, 18 Aug 2019 20:15:23 GMT

4 < Pragma: no-cache

4 < Server: Linux/2.6 Sony-BDP/2.0

4 < Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>

<systemInformation>

  <name>BDPlayer</name>

  <generation>2012</generation>

  <remoteType>RMT-B119A</remoteType>

  <remoteType>RMT-B120A</remoteType>

  <remoteType>RMT-B122A</remoteType>

  <remoteType>RMT-B123A</remoteType>

  <remoteType>RMT-B119J</remoteType>

  <remoteType bundled="true">RMT-B119P</remoteType>

  <remoteType>RMT-B120P</remoteType>

  <remoteType>RMT-B121P</remoteType>

  <remoteType>RMT-B122P</remoteType>

  <remoteType>RMT-B119C</remoteType>

  <remoteType>RMT-B120C</remoteType>

  <remoteType>RMT-B122C</remoteType>

  <remoteType>RMT-B115A</remoteType>

  <actionHeader name="CERS-DEVICE-ID"/>

  <supportContentsClass>

    <class>video</class>

    <class>music</class>

  </supportContentsClass>

  <supportSource>

    <source>BD</source>

    <source>DVD</source>

    <source>CD</source>

    <source>Net</source>

  </supportSource>

  <supportFunction>

    <function name="Notification"/>

    <function name="WOL">

      <functionItem field="MAC" value="54-53-ed-5c-5c-b2"/>

    </function>

  </supportFunction>

</systemInformation>

2019-08-18 22:15:23.912 [DEBUG] [inding.sony.internal.net.HttpRequest] - 5 * Sending client request on thread upnp-main-411

5 > GET http://192.168.2.102:50002/getRemoteCommandList

5 > Connection: close

5 > User-Agent: OpenHab/Sony/Binding

5 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

5 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding

2019-08-18 22:15:23.926 [DEBUG] [inding.sony.internal.net.HttpRequest] - 5 * Client response received on thread upnp-main-411

5 < 403

5 < Connection: close

5 < Date: Sun, 18 Aug 2019 20:15:23 GMT

5 < Server: Linux/2.6 Sony-BDP/2.0

2019-08-18 22:15:23.931 [DEBUG] [nternal.transports.SonyHttpTransport] - Closing http client

2019-08-18 22:15:23.945 [DEBUG] [larweb.ScalarWebDiscoveryParticipant] - No specific thing type found for Blu-ray Disc Player

stupid questions: where to find the volume channel?

Iā€™m using scalar, but also canā€™t find it with the other thing types.
Model is BRAVIA#KD-65XF8505, latest 2.4 build, OH 2.4

I would gladly test it, but iā€™m on 2.4 :confused:

Hmā€¦ i canā€™t find it eitherā€¦ maybe weā€™re again facing the bug where TV doesnā€™t respond with this channel unless you turn on the TV, and then discover the thingā€¦

I have it in Simple IP as ā€˜volumeā€™ā€¦

see above

I try to re-discover when tv is on (good chance, I had it some tome, but noe itā€˜s gone)

perfect, thatā€™s the trick. After re-discovery there is the channel group Audio, which includes volume and mute. @tmrobert8 Is that a bug or ā€œit is what it isā€?

1 Like

Which switches are you talking about? The app switches or the TV channel switches (or possibly both)? Iā€™m contemplating putting the tv channel switches back as an ease of use thing. If people want the app switches - I can switch that back as well as long as you understand itā€™s not really a switch since I canā€™t detect when something is running or not (unlike the TV ones).

Yeah - I wish I knew what conditions the TV has to switch a port. None of mine switch ports but many people have mentioned it. Unfortunately there is nothing I can do about that.

Yeah- blurays are a bit of a pain in that they donā€™t send out constant discovery messages. The forbidden means that you need to pair it. Hereā€™s the steps Iā€™d do at this point:

  1. Turn on the bluray player and make sure itā€™s on the home menu (none of the sub menues)
  2. In OH for the thing config, change ā€œRQSTā€ to some 4 digit number (doesnā€™t really matter - 0000 will do).
  3. Hopefully, a 4 digit number will then appear on the bluray screen. Change the thing config to that number and it should pair itself.

If that doesnā€™t work - Iā€™ll need a copy of your log to see whatā€™s going on (see the first post on how to create a separate sony log to send to me).

Interesting - I never knew the audio group would be affected by the device power. Apparently it is and would probably be the issue (Iā€™ll run a test on my end to confirm). However, I will say that the next version will formally implement my evil scheme of discovery/creating custom thing types for devices and any ā€˜tv must be onā€™ stuff should go away if the device information was already approved (more on all that later).

Isnā€™t this related to this?

Thank you @tmrobert8 for your reply!
I made some progress.
I did exactly as you suggested but no access code popped up.
Then I browsed the log and found the line

X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55

I used the number string as access code and went to the BD player menu
Network Settings > Media Remote Device Registration
started the registration and the thing went online! Great!

Alas, the 2 items I then configured (switch for ā€œpower on/offā€ and a string for ā€œIRCC Viewing Channel Sourceā€ donā€™t seem to work.

The log states a problem

2019-08-19 15:19:55.895 [DEBUG] [y.internal.transports.SonyAuthFilter] - Trying to renew our authorization cookie
2019-08-19 15:19:55.971 [DEBUG] [y.internal.transports.SonyAuthFilter] - Could not renew authorization cookie: java.net.ConnectException: Connection refused (Connection refused)

I guess Iā€™m not compltely there yet :wink:

Every time i flip the switch item mentioned above I get this

2019-08-19 15:19:55.714 [DEBUG] [inding.sony.internal.net.HttpRequest] - 85 * Sending client request on thread OH-thingHandler-5
85 > GET http://192.168.2.102:50002/getStatus
85 > Connection: close
85 > User-Agent: OpenHab/Sony/Binding
85 > X-Auth-PSK: 00-11-22-33-44-55
85 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
85 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding
2019-08-19 15:19:55.718 [DEBUG] [y.internal.transports.SonyAuthFilter] - Trying to renew our authorization cookie
2019-08-19 15:19:55.845 [DEBUG] [y.internal.transports.SonyAuthFilter] - Could not renew authorization cookie: java.net.ConnectException: Connection refused (Connection refused)
2019-08-19 15:19:55.883 [DEBUG] [inding.sony.internal.net.HttpRequest] - 85 * Client response received on thread OH-thingHandler-5
85 < 200
85 < Access-Control-Allow-Origin: *
85 < Cache-Control: no-cache
85 < Connection: close
85 < content: text/xml
85 < Date: Mon, 19 Aug 2019 13:19:54 GMT
85 < Pragma: no-cache
85 < Server: Linux/2.6 Sony-BDP/2.0
85 < Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8"?>
<statusList>
<status name="viewing">
<statusItem field="class" value="video"/>
<statusItem field="source" value="BD"/>
</status>
<status name="disc">
<statusItem field="type" value="BD"/>
</status>
<status name="party">
<statusItem field="status" value="nr"/>
</status>
</statusList>
2019-08-19 15:19:55.894 [DEBUG] [inding.sony.internal.net.HttpRequest] - 86 * Sending client request on thread OH-thingHandler-5
86 > GET http://192.168.2.102:50002/getContentInformation
86 > Connection: close
86 > User-Agent: OpenHab/Sony/Binding
86 > X-Auth-PSK: 00-11-22-33-44-55
86 > X-CERS-DEVICE-ID: MediaRemote:00-11-22-33-44-55
86 > X-CERS-DEVICE-INFO: OpenHab/Sony/Binding
2019-08-19 15:19:55.895 [DEBUG] [y.internal.transports.SonyAuthFilter] - Trying to renew our authorization cookie
2019-08-19 15:19:55.971 [DEBUG] [y.internal.transports.SonyAuthFilter] - Could not renew authorization cookie: java.net.ConnectException: Connection refused (Connection refused)
2019-08-19 15:19:55.984 [DEBUG] [inding.sony.internal.net.HttpRequest] - 86 * Client response received on thread OH-thingHandler-5
86 < 500
86 < Connection: close
86 < Date: Mon, 19 Aug 2019 13:19:55 GMT
86 < Server: Linux/2.6 Sony-BDP/2.0
86 < X-CERS-STATUS-CODE: DI02 NoMetadata
2019-08-19 15:19:55.986 [WARN ] [ding.sony.internal.ircc.IrccProtocol] - Unknown code from getContentInformation: 500 (http reason: Internal Server Error)

Sorry yes i mean both app switches and the TV channel switches.

Maybe you could do the dicovery in the background and assign the new discovered port to the thing.
That way the deviceAddress in the thing definition could be just the ip address, eg. ā€œ192.168.1.11ā€ instead of ā€œhttp://192.168.1.11:27282/sony/webapi/ssdp/dd.xmlā€ where the regularly changing port is defined. :slight_smile:

I think this would spare this thread some inquiries about things that do not go online.

Iā€™d appreciate a log on that (preferably the whole log so I can see the URLs the discovery packets are sending as well).

Thatā€™s not an issue for you and can be ignored. Simply means that the device doesnā€™t have the scalar/rest API defined and we arenā€™t renewing the auth cookie because of that. However, your version of IRCC doesnā€™t need auth cookies (uses auth headers instead) so it can be fully ignored.

That says that the disc you have in doesnā€™t contain any metadata on it and the ā€˜viewingā€™ fields wonā€™t populate. Thatā€™s actually the first time Iā€™ve seen that and Iā€™ll make some logging adjustments in the code but there isnā€™t much I can do about that (since the player is stating it has no meta data to work with).

And by switch you mean the ā€˜power switchā€™? If thatā€™s the case, I need to see a different part of the log where it tries to post the change (the log above simply is the polling part).

Iā€™ve tried doing that various times but it just doesnā€™t work across all devices (and is unbelievably complicated code wise).

The issue is that

  1. the discovery packets the device sends have critical information in it
  2. some devices donā€™t send the discovery packets regularly.

So I canā€™t have a simple IP configuration option (the thing would remain offline until a discovery packet is sent to get the correct port number). This would happen irregularly and some devices only send that packet when they get turned on (so any restart of OH would require you to turn on your devices as well - very inconvenient).

The second option is to initially set it up with a port and then try to monitor discovery packets for a new port number. Problem is that you fall into the same trap in that your .things file defines a port that was valid when you created the file and the device wouldnā€™t come online until it receives the correct port from the discovery packet.

The only real option would be to start saving the last port used (which you can then use at startup) and run a whole parallel discovery process for port changes. Just a ton of code Iā€™d have to create - which Iā€™m not sure I want to do (Iā€™ve already invested waaaay to much time into this).

1 Like

So Iā€™m going to be messing with a few channel ids (mainly the input status ones). Along the way, Iā€™ll probably re-add back the TV channel switches (atleast the digital ones [5.1, 20.5, etc] - sony broke the analog ones [the api returns all possibilities rather than those it found]).

Question for you all - I may add back some switches for apps (but still keep the command channels since there are devices that support more than stop/start). Note that the switch will likely not be live (ie it will not turn off when you end the app).

What do you all think?

1 Like

IMO, this should be handled by the user itself (if needed) in rules or somewhere else, as that way thereā€™s no overhead on the binding part to map/do all kind of stuff just to get switches if one does not need that functionality (that obviously isnā€™t up-to-date - switch canā€™t know when itā€™s on and when off)ā€¦ also, this will only open possibility to break things on your end once sony fixes things on their end. if someone needs a switch, it is possible to create one. I see your binding solely as a communication interface between sony device and openhabā€¦

no hard feelings to anyoneā€¦ just my two cents on the topic :slight_smile:

i personally donā€™t need a switch. but i also did not succeed discovering the tv channels to create a selection for example. if that is doable without to much of an effort i think thatā€™s the way to go.

If i switch on HDMI 1 then HDMI 4 ARC is selected.

Is that with the test version you are using or the real version? If test - respond via our PM chain

I had a look into this some more and think i found a promising solution for that.
Do you already know the auth method pre-shared key (PSK)?
In the Sony documentation youā€™ll find a description how to set up the tv and an .html file with some supported http-requests in it. I added some (for me) interesting functions to play around an attached the file for reference here in this post. After the download you have to change the file back to html.
displaycontrol.txt (4.5 KB)

With it i can control the tv just with the IP and the pre-shared key (PSK). No port or whatever needed.
Another good thing is that you do not have to register the tv with the binding anymore (four-digit code). I unregistered the binding on my TV but the html file still works fine. Maybe you could add this auth method to the binding, since i assume this will be much more robust (because regular port changes donā€™t matter anymore) when this binding is merged and used more often in the future. Since you have a working discovery for the devices i suppose this is sufficent to find out if the thing can be declared as ā€œonlineā€ in openhab.

Sadly it really seems that the api is ā€œbrokenā€ in some way because there is really no way anymore to find out which app is running.

getApplicationStatusList() just shows three applications:

-- appControl.getApplicationStatusList() --
status: 200
{
  "result": [
    [
      {
        "name": "textInput",
        "status": "off"
      },
      {
        "name": "cursorDisplay",
        "status": "on"
      },
      {
        "name": "webBrowse",
        "status": "off"
      }
    ]
  ],
  "id": 1
}

getPlayingContentInfo() unfortunately just says illegal state when an app ist running

-- avContent.getPlayingContentInfo() --
status: 200
{
  "error": [
    7,
    "Illegal State"
  ],
  "id": 1
}

However tv channels are reported reliably

-- avContent.getPlayingContentInfo() --
status: 200
{
  "result": [
    {
      "uri": "tv:dvbt?trip=9999.441.41104&srvName=BBC HD",
      "source": "tv:dvbt",
      "title": "BBC HD",
      "dispNum": "024",
      "tripletStr": "9999.441.41104",
      "programTitle": "Global with Matthew Amroliwala",
      "startDateTime": "2019-08-22T17:00:00+0200",
      "durationSec": 1800
    }
  ],
  "id": 1
}

Yep - the scalar binding supports PSKs and really your file is doing nothing different than what the scalar binding is doing under the scenes (but in much more detail). In fact, if you pull up the sony webpage you can pretty much play around with all that - simply load your device file from userdata/sony/definitions/capabilities) and youā€™ll see everything your TV supports and can play with it interactively (a much more powerful version of the page you put together because you can also interactively specify parameters).

The problem isnā€™t the port on the individual calls. The problem is the port is required during discovery to retrieve the descriptive information to setup everything the binding needs (to discover all that information you have in the file). Once I discover all that - the port isnā€™t needed anymore. Having said that - I donā€™t think I ever thought all that through and maybe I can come up with some solution that is easier.

As for your edits:

  1. getApplicationStatusList() that is not applications in what you think. That is internal sony application status and will tell you various states the sony internal applications are in. What you want to use is getWebAppStatus but youā€™ll notice that it returns stopped on everything. Sony broke that when they broke DIALs implementation as well.
  2. getPlayingContentInfo() yep - thats correct. And the binding should properly update the associated channels on the poll when it retrieve that information
1 Like