New Sony Bravia TV integration for 2015 - 2016 alpha

you may be able to set something like that up using CORE but im not 100% sure.

On my X850D, the POST looks like this to bring up YouTube:

POST: http://192.168.x.x/sony/appControl

Header name: X-Auth-PSK
Header data: sony

Header name: SOAPAction
Header data: “urn:schemas-sony-com:service:IRCC:1#X_SendIRCC”

Data: {“method”:“setActiveApp”,“params”:[{“uri”:“com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.activity.TvGuideActivity”}],“id”:10, “version”:“1.0”}

I’ve not yet figured out where (if it’s even possible) to insert the specs of the item you want to watch. But I’m playing with it, and if I get it I’ll let you know

1 Like

Ok, I’ve not yet built any devices or handlers or smartapps (I tend to work in Tasker as that’s where I’m comfortable). But I have an idea.

Right now, from an Alexa standpoint you can only turn the ST Bravia device on and off.
However, you’ll notice that if in the ST Bravia device you tap the Netflix square while the tv is off, it will power up and take you directly to Netflix.

Sooo… why not have a ‘subset’ device in ST? Why not have a device called Netflix, and all you do with it is turn it on? I know in ST that’s a bit silly when you already have the square available. But from an Alexa perspective, ST devices turn on/off rather than needing to be triggered via IFTTT. So instead of saying “Alexa, trigger Netflix” and it having to make the AutoRemote call to Tasker, you would say “Alexa, turn on Netflix” and it would instantly turn that on thru ST just as it instantly turns on my corner lamp smart bulb thru ST.

So my question: would I simply write a device that relies on the handler Steve wrote, but trims down the device functionality? Or would it also require a new handler?

the problem i think you will have is (and i dont know this as fact) i dont think you can have two devices pointing to the same IP address. so you could build a device handler that just turns the tv on to netflix, but you couldnt then use the standard one

well you may be able to work around that if you have both lan and wifi as the tv would have two ip addresses. but its a bit of a hack.

if i had time i could possibly develop the device handler to switch to one of a few imports depending on selection in the options. but im not sure i m going to be able to find time to create that any time soon.

I’m gonna test it. I’m taking the example you used as your starting point, deleting all functionality except the ‘on’ function, and assigning three things: HDMI4, COMPONENT1, NETFLIX. Each will get its own device handler. There will be no polling or status; I can determine easily enough what’s running by looking at the screen. Each will access the same wired Ethernet port IP address. My thought is that if the device handler is merely sending a single command to an IP address, why would there be any system conflict with another handler that sends a different command to that IP address?

I’ll find out if that approach is flawed soon enough :slight_smile: I’m expecting to look at it this coming weekend. If it works, I’ll expand testing to various apps such as YouTube.

There’s no reason this wont work. You can’t have two devices with the same IP address. You can access that device from as many applications as you like.

Mike, the unrepentant Windows 10 on mobile speaker upper and self appointed spokes person for all.

I ran short on time this weekend, so I did these in Tasker using IFTTT. So instead of saying “Alexa, turn on YouTube” I say “Alexa, trigger YouTube”. The commands I did are
YouTube
Netflix
Cable (powers on cable box)
Program guide
Amazon video
TV (switches to cable)
Photo sharing
Crackle
Cable box power
Hockey
Browser
Center channel (Enhances dialog if needed)

The benefit of doing it in Tasker rather than ST: Each command also force-switches to the appropriate input and mode on the Denon AVR. The ‘Hockey’ command does all the following:
Switches on the TV, if not ready on
Turns on the Denon, if not already on
turns on the cable box, if not already on
Turns cable box to NBCSN
Sets speaker levels as follows:

  • center channel -12
  • L,R, and all surrounds at +9 or above.
    This eliminates theTV announcers, so I can enjoy the game as if I am in the arena.

As for YouTube, it seems that Intents are not yet handled well by the AndroidTV app. So I can’t create a command that says “Alexa, trigger Waterfall” and have it automatically play a waterfall video that I specify in the command. Hopefully they make that functionality available in the future.

I could also make these respond to notifications and calendar events. So I could hypothetically set up something that notifies me any time an NHL game will be shown on NBCSN. And then if I’m home (checks the ST presence sensor, and/or other conditions via sharptools), automatically runs the Hockey command!

2 Likes

Hi there !

First of all thanks for your great script !

I didn’t have any issue set it all up.
However I could control my 1 out of 5 times the TV (W705C) was answering to all the control.
Turn On, OFF, switching HDMI etc was fine but all of a sudden only WOL is working.

Do you guys have any idea what’s going on ?

Regards

Did you give your TV a static IP address?

Yes I did.

1 Like

Sorry, in this case I have no clue… .

I reinstalled everything this evening, and now everything seems to work !

1 Like

Glen_King,

That’s awesome that you were able to figure out how to launch so many different apps! Would you mind sharing how you figured out what should go in there? I have the YouTube code working, but I’m also interesting in launching Plex, Amazon, HBO Go, Showtime Anytime, Playstation Vue, etc… I’ve scoured the internet but can’t find anything. Yours is the only successful post I’ve seen on the subject.

Do you mind sharing the the body of the post for those apps you got to work?

This the YouTube code I’m talking about that I have working with my setup… just not sure how to duplicate this for other apps…

{"method":"setActiveApp","params":[{"uri":"com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.activity.TvGuideActivity"}],"id":10, "version":"1.0"}

The first component is:
{“method”:“setActiveApp”,“params”:

From there, here’s Amazon video:
[{“uri”:“com.sony.dtv.com.amazon.aiv.eu.com.amazon.ignition.IgnitionActivity”}],“id”:10, “version”:“1.0”}

Crackle:
“uri”:“com.sony.dtv.com.crackle.androidtv.com.crackle.androidtv.CrackleBootActivity”

Etc. To get the ones that exist on your own Bravia:

http://192.168.xxx.xxx/sony/system
SOAPAction: “urn:schemas-sony-com:service:IRCC:1#X_SendIRCC”
{“method”:“getApplicationList”,“params”:,“id”:10, “version”:“1.0”}

To do something like my ‘Hockey’ command you have to combine a number of separate commands including cursor and number controls. There’s a way to send text strings to the Bravia, but I’ve not gotten it to work yet.

Btw, Joao got Autocast working so that you can use Tasker to cast from an android device, and the Bravia will start playing it. So now I say “alexa, trigger _________” and the vid starts automatically on the Bravia. So far I have 4K youtube vids of aquarium, fireplace, garden, and other things. It’s waaaay cool.

The only challenge I really have outstanding at this time is that I haven’t yet found a way to determine whether the cable box is on or not. It is plugged into the Denon, and the video passes through to the Bravia (the audio is far superior that way, with no loss of image quality). The Denon reports neither whether something connected to it is on, nor toe status of the video or audio input. And I can’t find a way to query the Bravia on this. I would even hook up a USB cable between the cable box and the Bravia, if I could find a way to query the Bravia’s USB ports for live connections.

I have a Sony 940d. It works like a charm. The only problem I have is that it’s not polling the TV. If I turn it on with the remote, it doesn’t change to on within the app. Is there anything special I need to do for that? Thanks for the great work!

You can setup a very simple CoRE piston to poll the TV and sync the status. Works like a charmer.

Do you mind elaborating?

I’ve tried creating a core rule to both poll and refresh (the two commands I would think are related to this), but just doing that does not update the TV status.

Here’s what the TV handler log shows:

9:45:47 PM: debug Executing ‘poll’
9:45:47 PM: debug poll count 12
9:45:47 PM: debug Executing ‘refresh’
9:45:47 PM: debug Executing ‘poll’
9:45:47 PM: debug poll count 11

Thanks!

nm. the hex for my device ID was wrong… my TV ip changed and I’ve only updated the preferences :slight_smile:

Thanks!