Sony Devices Binding

Hi!
I still have to play around to give a helpful feedback but things have been discovered and it’s working so far.

Regards

Jonas

KD-49XE8005 (with the new oreo update) i don’t know anything about ircc, dial or scalar. Just trying to help as enduser.

Some questions:

1: IRCC: doesn’t show any status information while playing content (DVB channel). (see screenshot)
2: DIAL: if i click an app switch, the tv works as expected, the switch however turns off after 10 seconds. I would have expected it to remain on while the app is playing.
3. DIAL: To determine what app is running it would be nice to have a ‘agregate’ channel that holds a string from the active App or null if no app is active.
4. IRCC: paperUI turn on and works off as expected. When i manually turn the tv on, the switch is not changed in paperUI (maybe related to 1?)
5. Scalar: Only channel title is updated. Other interresting Content details are missing (Title, length, age rating, guide information etc. Don’t know what scalar offers, but atleast content title is shown but empty.)

image

I’m also wondering if i have to do anything with the RQST code. As it doesn’t seem to do anything at the moment. Tv is nog giving a key and changing the key in paperUI is not giving any feedback (logs, tv or ui)

Hi! I mapped an item to the power status to switch on my active loudspeekers attached to my tv.
it works when i fire the power status → on via rest or whatever.
When i switch the tv on with the remote it does not update.
Any ideas?

Hi Tim, thanks for your answer. Sorry, I was talking about scalar. Never used DIAL. Maybe i should have a look at it. Could you maybe explain (very shortly) what these different protocols (simple ip, ircc, scalar, dial) are all about and which protocol is best for which purpose? Maybe this could be a useful guideline for starters in the first post.

In dial you can see the apps. Scalar is a server controlling most of your tv. Ircc is infrared simulation (up down vol up 1 2 3 etc.)
Simple ip is some basic protocols bypassing the server if i am correct.
What dial is i dont know. In versions before everything in dial was included in scalar.

can anyone tell me how to expose the input HDMI2, HDMI4 for example into alexa. i manged to expose the swtich, (power, volume, mute) but since the input is a stream dont know how this will work? thanks

When this goes to be merged I will - until then I’m dumping alot of logging to help solve issues.

You can ignore this - just means you TV doesn’t support a public key encryption for text entry.

Nor would it. IRCC content information is really only for DVD/bluray players

This is correct actually. We start the APP (switch is on), after 10 seconds we poll the TV and Sony’s broken DIAL implementation tells me it’s not running, the switch turns off. Can’t do anything about this because Sony broke this in a firmware about 2 years ago and hasn’t fixed it.

Same issue as number 2 - Sony broke this logic about 2 years ago and never fixed it - it’s impossible to tell what is running.

Understood - I’m looking into why on this one

Like number one - TV’s scalar only really returns the title. The others are for players and AVRs. You may get this info if you play a USB source that has metadata that Sony recognizes (this happens on soundbars and may happen on TVs - but it really depends on the metadata).

Has nothing to do with anything - once pair that config setting is fully ignored.

As mentioned above - I’m looking into this

If so, what is the point in discovering the tv as IRCC device? Offcourse i can hide it in the inbox, but would be better to not disover it at all if it doesn’t have any purpose.

Anything specific that needs to be tested? i’m happy to help, but don’t know what you are looking for.

I like to think of these as three generations of services Sony has offered - in reality it’s not but that’s how I think about it…

SimpleIP
In the beginning, there was only bravia tvs and simple ip was the way to control them. Simple IP is gears strictly towards bravia and only does a few (simple) things like power, volume and channel changing.

DIAL/IRCC
After that came DIAL/IRCC which is implemented on alot of devices.
DIAL (DIscovery And Launch) is an open protocol that many devices implement. Designed for smart devices to allow discovery of the smart device and allow a person to start/stop apps on the device. In fact, I could take my DIAL implementation and make it a binding for other devices as it would work on LGs, etc. However, Sony extended it a bit to allow me to query for apps installed as well as stop/start. About 2 years ago, Sony broke it’s implementation (and doesn’t follow the protocol) in that you cannot query for what app is currently running (they all say stopped).

IRCC (actually IRCC-IP standing for InfraRed Compatible Control over Internet Protocol) is a protocol sony designed to basically mimic a remote control over IP. Each TV has a set of protocol codes for the remotes it supports and you can send those protocol codes over IP to mimic using that remote. At some point, someone though it would be a great idea to return information in the protocol as well (content information for DVD/bluray players) and added that to the protocol - that part is barely supported now but the remote functionality is still going strong.

SCALAR (otherwise known as REST API)
Eventually Sony decided to create an all encompassing protocol that would cover all their devices (with maybe the exception of projectors). The protocol is divided into a number of services (which services a device had would depend on the device). Each service is divided into a number of functions (function support also depends on the device). You then call those functions using one of two transports (HTTP or websockets). HTTP seems to be exclusive to TVs/blurays and websockets support AVRs, blurays and soundbars. The downside to HTTP is that there is no notifications or events - everything has to be done via polling.

Now - the device allows me to discover the services and the functions it supports (as well as the transports to use) and is actually quite well designed (in the ways it represents all devices pretty universally). This binding tries to organize that in a way that openHAB can understand and use and present that to you.

You can use the web application ({openhaburl}/sony) and the first tab is really a SCALAR explorer - it will show you the services/functions that a device supports and allow you to call those functions interactively. You kind need to know what you are doing because you are working with raw codes at this point (which I hide a bit from you in the binding).

On top of all that is authentication - there are about 5 authentication schemes I support based on the protocol, the device and the generation of the device. Authentication is the trickiest part of this binding.

Having said all that - I’ve put many hundreds of hours into this binding so far and it’s by far the most powerful, complete binding you’ll find outside of sony itself and beyond @freke help with the websocket - most of it’s been watching the interactions with my devices, reading tidbits of stuff on the internet, guesswork and alot of trial/error but I have a pretty good knowledge of all this now (and knowledge of many of the pitfalls alot of the other sony implementations [homeassistant, etc] are making and they don’t realize it yet!).

EDIT: if you want full automation, scalar is the way to go since it encompasses everything SimpleIP, DIAL can do and can control the stuff directly (as opposed to sending remote codes like IRCC). I included an IRCC channel in scalar to cover some things that scalar can’t do (like nagivating an onscreen keyboard). But beyond that - scalar is pretty much the king of the protocols right now.

2 Likes

Because it’s the ONLY protocol that can send remote control codes and some people simply want that (as opposed to the much heavier scalar implementation). Scalar can’t even send remote code - it can control the device directly (so probably wouldn’t need to mimic remotes) but I (in the background) created a IRCC command channel in scalar that will call the IRCC service without you need to install it (a helpful option).

Base line - some people just want a remote control emulator as opposed to a full featured automation and I can’t preguess who wants that - so you get to see both! :wink:

Thanks for the clarification. It does fullfill a purpose then :slight_smile: The above explenation about the three differenc protocol types helped a lot. Maybe good to add that to the binding documentation once it is ready to merge.

Oke, so scalar is the way to go if it covers about all the functions from IRCC and DIAL. Some questions:

  1. How do i start an app like Plex with scalar?
  2. DIAL is a bit broken by Sony resulting in the app switch turning off. Can Scalar tell wich app runs? didnt see that yet.
  3. When the TV is turned off, the channel avContent#pl_title-Main still shows the last watched DTV channel. Do you have an opinion about having it reset to NULL / UNDEF or - when the TV is turned off?

I’m really happy that you are willing to spend so much time on this. I’m no java dev, but if i can help in any other way, just ask.

I have a new version for 2.4 ready to test based on @tmrobert8b version 07-31-1
https://github.com/markus7017/org.openhab.binding.sony.24/blob/2019-07-31-1/target/org.openhab.binding.sony-2.4.0-SNAPSHOT.jar

give it a try :slight_smile:

2 Likes

You should not post ads here my friend …

? I’m talking about the backport

Thanks Markus. I tried last night and it works well. I still have the log errors as before

Yes, me too. Those exceptions are strange, I also get them. Luckily the binding comes up and runs fine.
@tmrobert8 Do you have an idea where those come from?

1 Like

Hi

no, i don’t refer to you. There was a post by a “new member” advertising support for sony devices … It has already been deleted by admins.

  1. All applications should have a channel in scalar. If you are in the paperui - you need to hit the ‘show more’ button as they are all ‘advanced’ channels and by default hidden from view. Unlike DIAL, this is a String channel that you send “START” or “STOP” to start/stop the app.
  2. No - they API in scalar also returns “stopped” for all channels as well. Obviously this was a specific decision in Sony to prevent that for whatever reason (probably some technical reason on their end).
  3. I could but I don’t want to - right now there is a handler for each service. The power is in the system handler and those are in the avcontent handler. I’d rather not start letting one handler have access to the other handlers and it get’s ‘messy’. Likewise, I’d have to start making subjective decisions on what and what shouldn’t be reset. I’d rather just follow what sony does (and they don’t clear those out either).

@markus7017 - I see what’s causing those errors. I’ll PM you with the reason.

FOR ALL: a new version will occur today. I fixed a few minor issues in the code that I noticed and will hopefully fix the issue where the polling isn’t getting the updates correctly (ie if you power off with the remote, the binding should reflect that)

1 Like
  1. I assume you mean scalar?
  2. Can you double check that the “Refresh Interval” configuration property for the thing is set to a valid number of seconds (hopefully about 5 seconds)? I’ve tested this on all my devices and they all worked fine (ie when the polling fires off - the information is updated in paperui).
  3. Maybe it’s a rule issue - can you check it in paperui to see if the value changes?

Thanks,
Tim