Sorry to dig up an old thread, but I ran into this today, and figured I might as well post my configuration in case somebody will need it in the future. This is for Shield Pro:
media_player:
- platform: androidtv
name: Home Theater
scan_interval: 1
host: 192.168.1.156
exclude_unnamed_apps: true
state_detection_rules:
"org.xbmc.kodi":
- "playing":
"media_session_state": 2
"wake_lock_size": 2
- "paused":
"media_session_state": 2
"wake_lock_size": 1
- "standby":
"media_session_state": 1
"wake_lock_size": 1
"com.netflix.ninja":
- "media_session_state"
"com.amazon.amazonvideo.livingroom":
- "playing":
"media_session_state": 3
"wake_lock_size": 3
- "paused":
"media_session_state": 2
"wake_lock_size": 1
- "standby":
"media_session_state": 0
"wake_lock_size": 1
"com.disney.disneyplus":
- "playing":
"media_session_state": 3
"wake_lock_size": 3
- "paused":
"media_session_state": 2
"wake_lock_size": 1
- "standby":
"wake_lock_size": 0
It works well enough to turn on/off lights when you pause and resume playing in any of the apps above. There are some quirks, like, for example, fast forwarding in amazon prime videos app is considered a “pause”, but it otherwise it works well.
Oh, and Disney+ initial state actually reports media_session_state
as null
, which is not supported by HomeAssistant configuration, since it expects an integer.