Hello All,
Im back to using HASS after a short hiatus, testing other systems.
Everything is moving along pretty well, short of the media player states.
All of my devices are detected, however the only ones that show the current state of the device are my Chromecasts, Google Home, and Plex.
The generic cast function that picks up my Android TVs are no longer working to detect the play state for internal apps.
In the past this worked as expected and I used the following to manage lighting Media Player States for Actions
This use to work for any app on my Android TV that used the built in media renderer. The same renderer that the cast portion of the Android TV uses. This included apps like Youtube, Netflix, Google Play Music, ect.
Has something changed with regard to this?
To be clear, I am not looking for a method to control the Android TV.
I simply need to view the state of media playing (idle, stopped, play, pause)
@rpitera I remember you were working on the above mentioned forum post with me. Is it still working for you?
Only thing different from my last build to this one, is that Im running a dedicated RasPi and Hass.io, instead of running HASS as a docker on my UnRaid server.
1 Like
Im suspecting that something has changed in what Android makes available to HASS in the latest version of Android TV. I fired back up my old docker build of HASS and again it does not detect play states, as it did previously.
SO, I guess Im looking for an alternative.
One that stands out right away would be a simple Tasker routine setup to determine if media is playing.
This for example uses the AutoApps plugin to detect if a notification is being displayed for a specific app and changes a variable. http://forum.joaoapps.com/index.php?resources/create-a-music-playing-state-that-you-can-use-as-a-profile-condition.187/
The Var could then be tied to a MQTT Switch/switches.
The nice part about this method would be that we can setup multiple apps to be monitored and group them for specific media types.
Spotify, Google Play Music, ect, could trigger an MQTT Switch for Music.
Netflix, Plex, Hulu, HBO, ect, could trigger an MQTT Switch for Movie.
We could even take this a step further and filter for specific words in the notification.
Lets say we are monitoring the TV app along with everything else, and it should trigger a change in our lighting scene. If we filter the notification for the word NFL or News for instance, we could have a different lighting scene, than if the notification has the word X-Files in it. I doubt many people want movie theater lighting just to watch the nightly news.
Considering what info is actually made available in Android notifications, we could also try to capture that data and send it over to HASS. I just need to make sure Android TV’s notification system, which is hidden from view is still capable of being accessed in the same way. I assume it is.
@broesie I know you’re a total Tasker junkie from back in the Google+ days, any thoughts on this?
1 Like
I am too looking for a solution for dimming the lights when i play netflix on my AndroidTV. Did you try it with Tasker? Does the notification interception even work on AndroidTV, since there are no notifications on TV devices?
Also, could you point me to a tutorial or something on how to connect tasker and Home Assistant?
From what I understand of the documentation on Android TV, there are actually notifications, but they are not accessible at present. SO, no this method is not going to work.
Im still looking into this, but since, I started my build again from scratch on Hass.io, its on the back burner till I get everything else up and running.
Ill post back here if/when I find anything.