Chromecast integration playback status

Hello everyone, I hope a dev can give us a hand to solve this limitation.

After reading almost all forum threads about chromecast, android tv, shield tv. I hope this time will be the right one!

Like several other people in the community I have an nvidia shield and I would like to make sure that I can manage the lights, among other things, when we listen something on the shield. Currently there is only with the Plex communicator application that we can do something interesting. But as the name says, it only works with Plex.

After trying different approaches, the only one that seems viable to me is to use Chromecast integration (beta). That if the mediasource is different from "none" then turn off the lights for example. This way it works for this action. However, I notice that in the current state of the device. The value of the "status" attribute always remains at "idle". I assume this is a bug in Chromecast integration? It should be able to display at least a status "playing, stopped, paused, idle" with that we could automate everything perfectly.

image

image

I hope someone can help us on this one!

Cordially,

1 Like

I've had mixed success with this myself (chromecast that is, I don't use Plex), but can't say I have invested an adequate amount of time to provide useful feedback on my own issues. I've had some success with running periodic refreshes on the device to keep it in check.

I also know there has been some attention paid to this in recent months, so it may be worth looking at whether you are running the latest platform version and whether an upgrade might address your issues.

I have found this doc on android dev. Not sure if this can help..

Implement a media session | Android Developers

You can use a Logitech Harmony Hub (if you can find one) and integrate with HE that way. You can then set up rules in HE to do whatever you want with the lights when a specific activity is started / stopped.

There are probably other ways but that's the simplest one that comes to mind.

Unfortunately I find this option to be nonsense. Having to use a third-party solution, when everything suggests that it is just a code adjustment to be made in the Chromecast integration application. I would like to contact the people who are in charge of the development of this application to have their opinion.

It's likely a code adjustment to be made on Google's end... which is why I offered an alternate solution.

Good luck.

1 Like

I have try something using the Android debug bridge (ADB). After I have enabled the developpers option (USB and network debug mode). I have do the following thing:

  1. Connect an USB cable between my computer and the shield
  2. Autorize the computer fingerprint
  3. Install the SDK Android tools SDK Platform Tools release notes  |  Android Developers
    and extract the zip.
  4. Run the following command line from the unzipper directory to connect to the shield

adb connect 192.168.1.69:5555 to connect on my shield tv

adb devices -l to see you are connected properly to the shield

and now the interesting part:

adb shell dumpsys media_session List

Now, how can we fix the chromecast integration to check the media_session state currectly????

1 Like

Any change would require the HE developers to update the built-in integration. Not sure who is best to pass it on to.... @gopher.ny ?

I have found the state value doc here :PlaybackState | Android Developers

And from home assistant some additionnal explanation about the Android TV logic.
Android TV - Home Assistant (deploy-preview-11324--home-assistant-docs.netlify.app)

Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV · GitHub

I'm sad to see that 20 days later there hasn't been any development on this...

The Chromecast integration has been in "beta" since I've had my hubitat (over 2 years)

I find this feature doesn't work great in home assistant either. If you pause/play from hubitat or home assistant it tracks well but if you play/pause from outside of that it doesn't usually update the status.

So I've been looking more into what works and what doesn't, and it's seemingly app based

Playing YouTube the status does change and the buttons within hubitat work. Disney plays status does not update but the buttons work. Netflix the status does not update and only the stop and volume buttons work (not pause or play). But I find this issue also when casting from the actual Netflix app... It will start but I cannot control anything once the show starts. So it's seemingly more of an Android TV app issue.

Not sure if this helps anyone but using my actual Chromecasts tend to be a bit more reliable

With the latest Shield Experience update any news ?

I think I've figured out what's blocking it, if I want to connect to Android TV from the ADB debugging tool. I have to "allow my device" to connect to Android TV.

When I initiate a first connection with adb, a popup appears on the shield asking to authorize a device that tries to connect.

I think that for hubitat to be able to control and interact with what is playing on the shield, we should authorize our hubs first. I'll try to see what I can find on this side.

is there a way to initate a connection between HE hub and Android TV to trigger the fingerprint autorization popup on Android TV??

@staff Can you give us a little help on this issue?

1 Like

Any updates on this? Seems like there was some nice progress for a bit.

I threw a bottle into the sea (at Google). I hope they will answer me.

At Nvidia, I am told that it is on Google's side that this needs to be corrected.

1 Like

Download the Hubitat app