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
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?