New Sony Bravia TV integration for 2015 - 2016 alpha

Thank you so much Steve. I will give it a test asap.

Yeah that bit is sort of confusing…

It would probably make more sense to just ask for the IP address and call iphex() with the value. Right now ipaddress() is joining the octets with a period, then iphex() is tokenizing them and converting them before joining the whole thing.

Seems unnecessary, but maybe there’s a reason for it?

Well the main reason is the validation, the inputs are supposed to only accept numbers from 0-254 which should have made it more difficult to enter something wrong for those users not sure what they need to enter, I didn’t think it would let you enter an entire IP address in there not sure why there is a range field. Maybe I nered to set it as an integer so you can’t type a decimal point in. You probably wouldn’t have made the same mistake if it stopped you typing after 3 numbers. Also all 4 are required fields so again not sure why smartthings allowed you to leave the values blank

Picture Off is working perfectly for me - Thank you so much. :smile:

updated again, just working through all of the remote buttons

nothing particularly new, just lots more to press, ill try to make it look better if possible as i go

2 Likes

I just updated to the latest version of the device handler. Turning the TV on and off as part of routines (e.g. Good Morning!, I’m Back!, etc) is working well. It’s amazing to walk down the stairs in the morning and have the downstairs lights switch on (one lamp in the lounge and Hue Blooms in the kitchen and dining room) AND have the TV turn itself on!

Is the status working on other peoples TV’s? On my X8309C the status doesn’t seem to work at all?

I’m not sure if the “swtich tv off” is broken with the latest code.i dont seem to be able to turn my tv off via smart things at the moment. but ill have a dig into that when i get some time, it could just be me if ive made a change since last time i uploaded the code.

the status of the TV polls about every 5 mins its a smart things default i think, so the status should sync up after about 5 mins, if you turn it on or off via the remote control. unfortunately its not instant polling.

On / Off still working fine for me from SmartThings and Alexa with the latest code.

I did notice you seem to have buttons for Guide and EPG.
Are they the same thing ?

Apart from that all seems to be working fine.

Hey Steve- First off thanks for the code here! Really nice to see someone get this done around here :).

I actually have a brand new Sony XBR75940D, and am able to use your code to turn off the TV along with multiple other buttons that seem to work just fine.

My only issue is, I am not able to turn on the TV. Once on, everything works, but when off, for some reason can not wake the TV up. Any thoughts on this here?

Thanks!

I have the same response as Basejumper86 when trying to turn on my Sony KDL50W805C.

Almost everything else works except WOL and turning on when on standby.

Thanks again for the script, your efforts are appreciated!

Interestingly, to follow up, if you hit the Netflix button the TV does power on to Netflix. So its not a power/standby issue then I would think?

hmm interesting. Its possible they have changed the codes, or some of the other stuff is working differently. ill create a slightly different version of the code for you to test in the next few days so bear with me.I think ikk set an option in the settings to use remote codes instead of the current way i turn the tv on and off, for those who cant get that working.

were you able to set the network address successfully?

the buttons ive created are spat out by the TV itself as capabilities, so im just adding them all on (slowly), i have no idea what they do tbh. i actually dont use digital TV so ive not tested them

oh @Basejumper86 and @bane2000 I believe you have to turn WOL on in the network settings on your TV i forget exactly how the option is worded but it wouldn’t surprise me if Wake on Lan is disabled. However that would be separate to not being able to turn your tv on. anyway let me knock this code together and try to figure out why i cant turn my TV off anymore. and we can go from there

Wow this is amazing. Please let me know how I can help or contribute. This adds a whole new experience to a smart home,

Here is what I noticed. I was not able to turn on my TV (XBR-55X850D 2016) via the smartapp. I should note that I do have a tivo and sonos. However, if I power on the TV via the remote I can use all the tiles as advertised (at least 85%). Really nice work!

I figured out my TV had just changed its IP address which is why it wasn’t working properly, so I’ve fixed the IP now. Interestingly the WOL packet still worked via Mac address which is why I could turn it on. I’ll try to have a bash with it tonight I have a feeling the remote codes may work for the new tv’s that are struggling if any of you with 2016 tv’s could test some code for me that would be great

I can’t get it working on a W800C. I have control working on home assistant so I think the pin is correct. I do not see any errors in the logs. Maybe port?

hmm the w800c appears to be a full on android TV not sure if that makes a difference?

only thing i can suggest is go through the network settings and make sure control over ip or simple control over network or something to that effect is turned on and you have seen that the PSK security is turned on with a pin. unfortunatley the tv wont come back with an error to log, it will just not respond, not too helpful

ok so this is a complicated one, but if one of you who has a TV that doesnt work on and off but the buttons work could follow the below instructions and post up the results, it could help get things working

Make sure you are on the same network as your tv via wifi or lan (as in dont do this at work if your tv is at home)

first using chrome install this extension https://chrome.google.com/webstore/detail/rest-web-service-client/ecjfcmddigpdlehfhdnnnhfgihkmejin?utm_source=gmail

assuming that works look for the new icon in the extensions bar its 3 blue dots on a white background, click it, you should get a new tab open up with lots of different things on it

change the drop down to POST
in the URL type http://your tv’s ip address/sony/system
click accept at the top and click application/json
click “add header” at the top and enter, X-Auth-PSK in the NAME field and the Psk passphrase you setup on your TV in the value field
click the body tab
in the empty white text box below the body tab paste the following text

“method”:“getMethodTypes”,“version”:“1.0”,“params”:[“1.0”],“id”:4694

click the “send” button at the top right.

click the response RAW tab and copy and paste all the text into a private message to me

if you get that far i may have other messages for you to try. this is from memory, so let me know via private message if it doesn’t work, when i get home later ill try it on my tv and let you know if what i posted is incorrect, please keep chatter about this to private messages so as not to clutter up or confuse this thread thanks.

assuming someone sends me some results ill get them to test a custom device type and hopefully get something that works for everyone

additional, i have just updated the code again, I believe this has now fixed the Eco mode issue where the TV showed as on when it was in eco sleep.

so for those power conscious among you you can now enable eco mode and still have full on off compatibility with smart things. the boot process is slightly slower but you will save electricity. im not sure if you can adjust the length of time before going into full sleep but most people are unlikely to notice the wake up time difference especially in automations, for instance, if the TV on command triggers as you walk through the door, the TV is still likely to be on before you’ve taken your shoes off and sat on the sofa!

enjoy

@steve.bratt The latest version of the code has broken turning the TV on for me on my X8309C.