I'm unable to get my Android TV to show the playing status or change the source

Hi guys

So, I’m quite new to HA and the first thing I wanted to do was to connect my TV up to HA, since I have an Android TV. I went through the steps and got the integration working, but for some reason the TV is always either listed as “Off” or “Idle”, and when I want to change the source, it shows the list of apps but doesn’t change to them, as seen in this picture. For what it’s worth, I can change the volume from here?

I’ve tried to figure out what’s going on but haven’t had much luck - I found this thread that talks about getting intents working with HA and Android TV, and this works extremely well with things like opening apps, using it to control my TV (power button, d-pad navigation etc), but it doesn’t let me see when things are playing to trigger automations off it, like turning off lights when we start watching stuff.

My TV is a Hisense TV running Android TV (version 10, with no updates available for it). I am also running HA on my Windows laptop through VirtualBox.

Sorry if I’m missing something - if so, let me know and I can get it :slight_smile:

Thanks in advanced!

There are a lot of things here, but let me say what I can’t do in my integration. I can’t switch it to terrestrial tv from integration. Probably it can be don but I will have to check adb commands and statuses.
I have powercalc integration. My tv has two integrations, one is android tv and other one is google cast. I see that you gave google cast on it.
What I did was create powercalc integration for tv using my casting device. Then I created some automations for it. When tv is on youtube or netflix it turns on led light strip on back of tv. It can also turn of the lights etc.
The down side of this solution is that it doesn’t work when I switch to terrestrial tv. Probably because tv automatically switch off casting.

Well, Google Cast may be in the list of apps but we rarely use it and I haven’t set anything up in HA for it as far as I know. There is a Google Cast integration like you said, and that’s been around since forever, but since we barely ever cast things to the TV, I didn’t set it up.

You’ve got a good solution for making it work with casting - I’ll have to check out powercalc for sure - but since we don’t cast things often, it won’t quite work for me :frowning:

No, you got it wrong. When tv is on youtube or netflix casting device is on but it doesnt cast anything on tv. But when tv is on terrestrial tv casting device is off. I don’t know why. It doesn’t cast anything on tv. My tv has build in casting device. So using powercalc on casting device I can set tv on or off status.
I had trouble with powercalc using android tv integration but its a long story.
What I want to say, try adding casting device and use powercalc integration. You can also try powercalc integration with android tv and based on that you can get tv on/off status and run your automation based on tv status.

I see! I was completely misunderstanding how the Google Cast worked with HA and the TV. Let me have a play with it and see how things go, and also to try connect powercalc up to it as well :slight_smile:

It works for my tv but it has build in casting device. I don’t know will it work on your tv. You have to try it. You can add android tv integration to powercalc but for me adding android tv to powercalc doesn’t update status on restart. I don’t know why, tried for a few weeks with developer of powercalc to find out why is this happening but no luck so far.

So I haven’t had a chance to add powercalc so far, but I did try the google cast integration. It’s mostly good - I can now see when things are playing and what’s playing, with the exception of Netflix. For some reason, with every other app I can see the state of the playback as either playing or something else (paused, idle, off etc), and when you start playing something, every app has an attribute for the name of the media playing, so I can check when things start playing easily - if there’s a media title and the state is playing, I’ve started watching something.

The issue is with Netflix exclusively - as soon as I open any app that’s not Netflix, it changes the status to idle, but when I open Netflix, it changes the status to playing? Then when I choose something, Netflix doesn’t give theeextra information about what’s playing, so I can’t use automations as reliably with Netflix for some reason?

I’ll have a look at powercalc tomorrow when I have some time, but I suspect it’s a weird thing Netflix does, but I’m not sure if there’s a way to fix it :stuck_out_tongue:

That is because Netflix, when starting a chromecast stream, switches to the Netflix app and streams from there. It effectually bypasses the Chromecast buit in service. Also Google Home cannot interact with Netflix streams - it cannot even start a Netflix stream via voice the way for instance Youtube can.

Ah, that makes sense why it doesn’t play nicely with anything then. That’s a big of a shame - I can make every other app play nicely except Netflix! It’s a shame it can’t just work off the default AndroidtTV integration - if you could use automations with the play state that would be perfect. Maybe Netflix just isn’t meant to be automated

I can control things like play and pause though HA when Netflix is running, but that is through IR codes. I cannot do it through the android tv app because my Philips TV made it impossible to activate the api that the android tv api uses. But maybe it can work that way too though the android tv app?

Thanks for the info. What a shame.