AndroidTV - ADB Command to Check if a connected HDMI-Device is up

Is there a Way to check with an ADB-Command, wether HDMI is plugged in? And if so, will a running dumb TV, to the Android-Device connected, but not on the ‘active’ HDMI Port, report ‘HDMI connected’ to the Android-Device via ADB, and when TV gets powered off, get recognised by the Android-Device as ‘HDMI disconnected’?

Background:
I have the AndroidTV-Integration running on a Amazon FireTV Stick and working flawlessly.
Set up HA to slowly turn on lights, when FireTV gets turned off.
The Challenge: When i’m with my TV on a Different Source, e.g. BD Player, the FireTV (of course) goes off after 20 Mins. And the Lights get turned on :smiley:

My Idea now is:
When AndroidTV Status is Idle, every 10Secs issue an ADB-Command to check wether HDMI gets reported as “Connected”. This way i will know, if the TV is still running.
When The TV got turned off, the attached FireTV will report “HDMI disconnected”.
Of course, i would need to keep the FireTV awake while the TV is, and would need to issue an input every 15min.

Would that be a practical approach, are you aware of the possibility to check HDMI status via adb? Or can you think of a “Client”-Solution - a running Process on the FireTV Stick that keeps it awake as long as the via HDMI connected Device is up, and reports an "Unplugged-"event when the TV goes off?

It might be easier to have your TV hooked up to smart plug able to monitor Watts.
Then you would have a template sensor telling you if the TV is on or off depending on consumption…

1 Like

Of course that would always work. Its just - the Sensors are around (at least i think so), so why not trying to minimalise Setup. But you’re right, that would be Plan B/C :wink:

Hey @smartin ,

I have 50+ shellys around already and would like to avoid to add another :slight_smile: .
So I also had the idea to “somehow query the FireTV Cube” if the HDMI port to my beamer is “on or off”.

Did you ever find a way to do this with ADB?

Hi,
Fire TV Cube have in ADB log a line with
‘amazonhdmiservice:’ and ‘hdcp state 1’ or ‘hdcp state 0’ for HDMI on/off.
But I don’t know how it can be implemented in AndroidTV ADB.

regards remoter3406