[Release] Sony Bravia TV Rest Control

Fair enough, I understand. Thanks for making the app available nonetheless!

Also getting issues with this driver after recent update to Android​TV. Sigh. It was working fine before. It seems to detach itself and I have to go back into the network/ip settings of the TV in order for it to work again. Then it works for a while then disconnects yet again. Grrrr.

Yeah. So when I bought the tv, the reviews were that the OS was slow and buggy. I agreed, but thought it was worth it anyway. I used a fire TV for awhile. Then I had a firmware update and it was snappy and bug free for like 18 months. Just got one in the last month that freezes my TV and hangs the show I'm watching. Sony certainly did something recently. I might have to do what that post above mentioned and report issue to Sony.

1 Like

In a previous Android version on my Sony (D series), I did a 'debloat' script I found on Reddit that disabled or deleted a lot of the Sony bloat/apps, and it did make a noticeable difference on the menu performance. Search on the Bravia subreddit for debloat, and it might be updated for the current Android. Worth a shot...

@ajones wondering if this driver / Sony API allows for the display of custom messages at the bottom of the screen? I could see that being very useful!

I ended up knocking up something for my needs...

2 Likes

@ajones is it possible to shorten the refresh interval for the device? For my use the 1 minute refresh is a little slow. I added 0.5 and 0.25 to the driver code but it seems to break it but maybe I am not changing the right code. Thanks.

Hey @ajones. Thank you again for this awesome driver.

I'm trying to set up a toggle for mute/unmute and I"m finding that this parameter is either set to 'on' or 'off' however when I try to form an RM conditional action to check for the current status, I'm seeing two options; 'muted' and 'unmuted'. This means that I'm unable to check for the action status of the mute, which is shown in the device page as 'on' or 'off'. Can this be resolved somehow so that I can check the current status of mute properly in a condition?

device page mute is either 'on' or 'off':
image

however, the condition only allow 'muted' or 'unmuted':

And while trying to set the conditional (no ability to select 'on' or 'off') :

Thanks.

My "remote control" dashboard for my Sony TV (buttons run various rules)...

I also set up a simple rule that when the TV turns on and my mode is Evening or Night then dim the lights. When the TV turns off then revert the lights back to wherever they should be on the circadian cycle.

1 Like

In case you still want this you need to change line 243 to this
def devicemute = (response.data.result[0][0]?.mute == true) ? "muted" : "unmuted"

Oh perfect, thank you so much. I didn't have time to go digging through the code so this is very helpful. Much appreciated!

Can someone please link me to the latest version of this code on GitHub? I'm seeing that several updates have been made and I want to make sure I use the latest. Thank you!

Just to piggy back off this question does shortening the refresh rate create a lot more chatter that would bog down HE? Right now I am keeping the default refresh rate at 10 minutes but I'm wondering what the implications of maximizing to 1 minute or even more frequent (if possible).

I would like to trigger an automation upon immediately switching HDMI inputs so ideally the refresh rate would be like 5-10 seconds.

Yes, for sure, the more often it polls the TV for status, the more traffic on the network and hub. I'm using 1 minute because I want lights to follow the on/off status. Haven't seen any degradation in other areas due to that so it seems fine. I think 1 minute is the most frequent setting so if you want it more often than that you will need to edit the driver and then take care it doesn't swamp your network &/or hub. I suspect at 5 seconds you could run into trouble! Maybe a good justification for a dedicated hub if that happens and the network can take it :grinning:

Hello @ajones or anyone for that matter.

I am using this driver on a Sony XBR-55X900E and it looks like it does what I want it to do. I just needed a driver that can see the State of the TV so I can make rules. I have something funky going on in the log where it is repeating the same messages, and then now two errors (this is the first time the errors came up). I dont know if it is related, but I also cannot see the State Variables. Its not a big deal to me, but not sure if related. Please see screenshots:
tv state var

Thank you!

I have a Sony smart tv but I did not install this driver.

Somebody could give me a couple of examples of what kind of rules you defined to use it ? I have no idea what I could do with it.

You can ask Google to turn on the tv, turn on/off the Xbox when the tv is on, set lights to a certain level/colour when tv is on, turn on audio to desired level, you could simulate someone being home etc.

I have a new bravia A8H, set this driver up, set a key. Do I need to select any particular settings on the tv otherwise? There are options for "simple TV control" or "control 4" in addition to the rendering menu to allow control. The driver is connected because refreshing displays the correct volume, but none of the commands change anything. Additionally, the Sony Lite driver does control tv fine with the same ip and port setting. What am I missing?

EDIT: I got it going. For future readers with the A8H, after pulling your hair out trying every combination of settings and reading every post here, go back to the PSK settings and disregard them, set it to "none" and it'll all work perfectly. I went as far as unlocking pro settings mode so I could select the setting for only PSK instead of the default available option "normal+psk" and it still wouldn't work. Eventually I selected "none" and all is well. If you're in my LAN already, I've got bigger problems than you changing the channel so "none" should be fine!

2 Likes

Okay one odd observation. Prior to setting security to none, every action gave my log a forbidden error and did nothing. Now, everything works, and literally nothing shows in the logs whatsoever.

Note that you can do this if you add your TV to Google Home (irrespective of using the HE Rest integration).