Help! I have spent weeks digging through all that I can find on the Android Debug Bridge, stretched my skills to pull information from the ADB response, documented all the ‘media_session_state’, ‘wake_lock_size’ values, written custom state detection rules (formatting the YAML correctly as HA does, not the way marked in the documentation which throws errors), and submitted it all to the integration. I was so proud of what I’d managed to figure out.
Then, taking all the wind out of my sails, HA returns the wrong state for the media_player.
I’ve checked my work, throughly, and it looks like I’ve done everything correctly. Have I lost my mind? Have I done something silly and just can’t see it?
The device is a FireTV 4K, it is connected to ADB and no errors have been apparent , it has worked 80% correctly in triggering an automation that sets lights to an appropriate scene when watching TV and a different scene when paused. For a couple of apps the lights were triggering the opposite scene so I wanted to use custom state detection to fix that, now it seems to have broken something…
Images show the state tab of dev tools, indicating that it does see the media_session_state and wake_lock_size values; then the custom state detection rules which should translate those values to ‘Playing’ but dev tools shows the state as ‘Idle’ which is backwards.
What have I done wrong here? Any ideas where to look?