New Sony Bravia TV integration for 2015 - 2016 alpha

Just to turn on and off. But this works like a charm. Have to say I have never tried to do anything else by voice. Would like to change the channel, but not sure if that works.

[quote=“bennetm3, post:52, topic:64357, full:true”]
Is there any way I could execute one of the other commands from Amazon Echo ?

At the moment Alexa will turn on or off the television, but I would love to be able to say ‘Alexa turn on HDMI1’ or ‘Alexa turn off picture’

I can execute the commands via a widget on my phone via SharpTools but it would be great if I could do it through Alexa.
Any ideas how this could be setup ?[/quote]
I don’t have a current tv to try this with. But in a brief glance, it looks like this code is sending simple HTTP commands to the Bravia - is that correct?

If so, indeed you can do this with Alexa. I’m doing it with a Denon receiver using Alexa, via Tasker. I set it up with each command in IFTTT sending the variables I want, and the Tasker script putting those variables in the correct format and transmitting the http command over to the Denon.

One additional thing that may or may not help this project: with the Denon, you do not have to tell it to wake out of standby mode. Merely sending an http command to choose an input implies that it should wake from standby mode. Dunno whether the Bravia will do that, but you could try it.

1 Like

But do you believe I could change the channel with this to say change to channel 703?
I found channel up and down. Hence I don’t know which channel was used last time it’s not possible to change automatically to the right channel. What be nice not only to switch on in the morning by CoRE. Would also great to have to right morning news on the screen.

Thanks!

Hard to say. I finessed it on the Denon by defining a list of favorites, then sending cursor movements to navigate the list based on the command I give. IIt does not change instantly, it takes about 15 seconds to change both zones. But the number commands exist in the command list for this Bravia project, so it’s gotta be doable.

I would think you’d have to build (again, using the model I built) channel commands as a separate command, and the variable string would have to have a fixed format. But you’d have to build a separate Alexa command for each and every channel - cumbersome. My understanding is that Google Home handles variables in the command string. So that would be a better vehicle for absolute command of a tv. You’d probably have to do something like “ok google, channel zero six one” to ensure the variables land where they need to. The upside of that is that your variable list would be mercifully small.

the buttons for the numbers exist i think but are commented out in my code. so you could remove the comment to show the buttons in the app. because there are lots of buttons, i removed some of the less useful ones to make the app load a bit quicker.

however. at the moment smart things wont let you use anything but the primary button in its automations. so even though there are 30 or more buttons, the only one you can use in automatons is on/off with the exception of some media controls play pause stop FF RW i think. you can also use a slider, but due to how the remote commands are implemented this wouldn’t be any use for volume or channels.

this may change at some point, we can hope. I woudl like to be able to have a button or automatrion to turn the TV on at netflix, or turn the tv on at HDMI2 etc

1 Like

ive just made a small tweak to the code, that will hopefully fix turning on for the newer TV’s which is based on what @adamjseed posted up above.

still got bugs to fix, but not much time at the moment. but ill be back to sort it at some point

1 Like

Just got this setup on my KD-75X8500C. Thanks!

Thanks for all your work on this! I installed this and linked it to my w850b. Everything works except for the on/off button. I can get the TV to come on with the wake on lan button though. I tried the code change recommended by adam with no change. Due to this, I can’t get the TV to come on w/ automations. It will turn off in an automation though. Any ideas on how to get the on to work are appreciated. Thanks again for sharing your work.

hi Brkoch, i think i may have broke the turn on code in my last update as its not working for me either.

you can either wait for me to fix it i may be able to look at it soon. or you can try using the previous code from git hub the one before the latest update. without testing i think this is the code that should work for you for the time being

1 Like

I Dont know if you guys figured this out but the netflix button isn’t showing and doesn’t work because the method is capitalized and the referenced action in the tile isn’t if you Ctrl+F and change all netflix to Netflix it will show up and work

Ill fix that at the same time!

Would anyone here like a turn on and switch to option in the setting?

I “may” be able to change the device handler so when you press the on button it turns the tv and switches to a specified input. you would then select either turn on as normal to last used input or turn on to and then a choice of

hdmi 1 -4
Digital TV (probably unable to select a channel however)
Netflix
App menu
something else (will see what the options are

if you selected one of the options in the list it would then always turn on to that choice using smartthings

it “may” be possible to do this but it might be a bit of a hack, for instance i may have to make it wait 20 seconds then press the button to change it, so it probably wouldnt be as smooth as turning it on and the screen you want being the first to display

2 Likes

I would love this option actually. Is it even possible to also switch to restricted profile as well? Mostly to prevent my kids from messing with my setting.

Its funny that you mention this today


I finally had a bit of time yesterday to work on my authentication problem but because it was late and I was already pretty tired, I worked on automating the selection of functions that cannot be accessed directly via a command, specifically launching the Amazon Video app. Using CoRE, I created a new piston that triggers off of a simulated switch which then steps through a series of key presses to navigate to and launch the app. So I basically created a macro in CoRE. The tricky part was troubleshooting the potential initial states that the TV could be in at the time of piston activation, so that regardless of the initial state, The piston would navigate to a known top level menu location and proceed from there. Once I had established the necessary keystrokes, I then had to play with the timing between commands to ensure that the TV would respond in time for the next command to function properly. For instance once the home menu is requested, you need to wait a second or two before you try to navigate and the time that it takes for the home menu to pop up varies based on the TV state at the time of the request. If Nexflix is running it takes longer to pop up than if on a source input. I still have a little more troubleshooting to do so that the piston runs as quickly as possible but is also robust, (I think there may be a network lag issue) but it presently seems to be about 95% reliable and executes reasonably fast.

Here’s what the piston looks like right now:

ive not seen core mentioned before, what is it? is it something that will work with the existing device handler? or is it something you are modifying the device handler with.

Id recommend that you also test it with booting from powersave mode, perhaps even proble the TV and wait for a response, as booting from power save mode with wake on lan takes a lot more time than just resuming from standby

Oh man
 If you haven’t used CoRE yet (Community’s own Rule Machine) you need to make time to get acquainted with it because it is one of the most useful and powerful smart apps, (possibly the best) ever created for ST. It allows you to create almost any type of automated sequence you can imagine (If, If not, or, then, etc
) with a ton of status’ and variables from your devices, and hub, plus much much more.

Just pop over HERE to get started.

As for the power up situation, I’m not going to worry about that right now because it is irrelevant to my setup until I can fix the authentication issue I have. It would also have to have a way to determine if the TV was already powered up to be bulletproof. So for now, as long as I know my TV has been on for ~10 seconds, I can tell my Echo to turn on “Amazon Video” and Viola! I’m off to the races.

Now it would be cool if Alexa/Echo could identify/activate the commands you’ve made available in the device handler, but I think that is an issue on the Echo side rather than the device handler in that for now the Echo only permits the On/Off activation of switches, the setting of dimmers, and a few other very specific functions like thermostat settings. Hopefully that will change in the future, but for now those can be pulled out via virtual switches and custom pistons in CoRE for Echo activation

1 Like

ok alex, ill check out CoRE sounds excelent.

Ive just updated my code again, Ive fixed the Netflix button and it looks I hadnt broken the code in the latest build above, i just needed to go into settings and save the settings again and everything sprung into life.

how is everyone getting on with the device handler, working as you would expect?

1 Like

I updated with your latest code and was able to turn on and off and the other buttons I tried worked fine. My only problem is the status indicator not matching but I think it just takes a few minutes to sync like discussed earlier.

Thanks so much this is my first “custom code” and I love it!

Same as @dash. Thank you for the DTH.

Just wanted to say thanks for this SmartThings handler. I have this working with my XBR55X850C running the latest firmware (version PKG3.709.0120NAB) and my Echo. You rock!