Basically, I got a stick for free and might want to use it to control one of the TVs that I’m not able to control via Home Assistant. Based on what I wrote now is that you CAN control the underlying TV with the Firestick/ FireCube via ADB. Do you do something special for this ?
Nothing special. Again all I was interested in controlling via Home Assistant was turning the TV’s power off. You have showed me how to do that via ADB abd AndroidTV. Thank you.
Hi Bert, This is also what I’m looking for. Did you change anything to your configuration.yaml file ?
If I press the turn off button in the Lovelace card. It brings the TV to sleep but doesn’t turn it off completely. Would it be possible to share your automation ?
I did change my configuration file as directed by the configuration of ADB. My automation simply calls the turn off service with the entity ID added by that configuration. I couldn’t get a media player card to work either.
Yeah, I am facing the exact same issue. It does work when asking Alexa, the TV turns off, but any commands from HA to the stick can only get it to sleep mode, which doesn’t turn off the TV. I still don’t have luck figuring it out.
I would try using the androidtv.learn_sendevent service to see if you get a different command when pressing the power button on your remote other than the default command
I’m having this exact same issue and tried to use androidtv.learn_send event to figure it out, but still can’t get it working. Have you had any luck in getting to tv to also turn off (not just ‘sleep’ on the fire stick)?
I got the adb_response back, but not sure what to do with it? When trying to re-enter that response in the adb_command service, gives me error that the path /dev/input doesn’t exist.
Anyone make any progress on this? Also hitting this issue with Fire TV stick 4k. Tried the adb_command as well, but didn’t work–that didn’t turn the Fire TV off either, so I’m not convinced I did it right. Willing to work with someone to troubleshoot.
Does anyone solve this? Any ideas? the only one in my mind is to connect the TV through a Smartplug and make an automation to power it off when the Firestick is “sleep”. Not the best solution but I think could be useful. I also tried with other adb commands like input keyevent KEYCODE_TV_POWER but nothing really happens.
I suspect that it’s not CEC that is actually turning the TV off, rather the Fire TV device blasting the corresponding IR code which is taking care of it. Since this functionality also works when using the FireTV app, I assume there is some way to invoke it… I’m just not sure what that way is though.
So… there is no option to cleanly shut down a Fire TV using ADB commands?
I for now use a (quite ugly) workaround by sending this key combinations:
HOME
HOME
CENTER
HOME
--------
LEFT
LEFT
LEFT
DOWN
DOWN
DOWN
CENTER
DOWN
DOWN
DOWN
CENTER
This activates the “deep sleep” of FireTV - which is obviously no power off, as the device still responds to echo requests (ping) on the network.
Note that until the “-------” it’s a bit of error control cause we never know in what state the Fire TV currently is (home screen or profile selection pre-screen e.g.).
Does someone know if there’s a technical difference between the
SLEEP (ADB command) and the
deep sleep function selected in Fire TV (long press HOME and switch right to sleep (dunno what it is in English)
If SLEEP is the same all that send key commands party can be replaced.
For real power off:
I searched the whole web (really, not much left out there ):
I also tried to send few ADB commands mentioned here where only poweroff -p is working …and it reboots the Fire TV, does not shut it down.
This one looked promising, but in the end keyevent 26 is the well-known SLEEP command.
For me “reboot -p” works well and shutdowns the fire tv. The problem is that in order to power it on again it needs to be unplugged and then reconnected to the mains.