I have several Android TVs integrated into Home Assistant through the various means (Remote, ADB, Chromecast, etc). Recently, I purchased a TCL TV for our living room, and replaced it into an existing script for turning off e.g. when we’re going to bed.
For some reason, maybe 1 of 5 times, the TV will not turn off but instead will prompt a “Do you want to shut down” message (see pic). If you use the remote to hit “Ok”, the TV does shut down and then can no longer be controlled from HA until you first turn it on again with the remote.
Our old TV (a Sony) did not do this. I haven’t found anything in settings and when I test calling just each single TV entity, it turns off normally.
Does anybody have ideas what causes this, and how I can make the TV turn off into “standby” every time?
I did find potential clue. The TV does the same thing if you hold the power button on the remote (prompt to shut down). Is it possible HA is somehow sending a “long press”?
I am using the Android TV integrations and not any sort of IR control, so I’m not sure how it would do this…but…
Well thanks anyway. I may have solved my own issue. Posting in case anyone else has a similar issue.
For one, I added to the end of my “turn off” script the below automation. In sort, it waits 4 seconds and if the TV is still on, automates cancelling the prompt and then turns the TV off.
However, I had another theory. I had the device added to the area and then the script was turning off the area. I suspect this was sending the “turn off” command to both the Android TV Remote entity AND the Android TV Media player entity. I think this plus occasional bad timing may have been triggering the shut down.
I cleared the area tag from the device and instead added it to just the remote entity, and the prompt has not occurred since. YMMV.
- delay:
hours: 0
minutes: 0
seconds: 4
milliseconds: 0
- if:
- condition: state
entity_id: remote.living_room_tv
state: "on"
for:
hours: 0
minutes: 0
seconds: 10
then:
- action: remote.send_command
metadata: {}
data:
command: DPAD_RIGHT
target:
entity_id: remote.living_room_tv
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- action: remote.send_command
metadata: {}
data:
command: DPAD_CENTER
target:
entity_id: remote.living_room_tv
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- action: remote.turn_off
metadata: {}
data: {}
target:
entity_id: remote.living_room_tv