core: Android TV integration - TV unavailable when turned of.

The problem

So I encoutered problem with my Android TV (TCL), where whenver I shutdown TV, it becomes unavailable in HA:

image

I did some debuging, and narrowed down problem to android TV itself.

When TV is on, NMAP results:

nmap 192.168.0.82
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-09 14:42 FLE Standard Time
Nmap scan report for 192.168.0.82
Host is up (0.0017s latency).
Not shown: 995 closed ports
PORT     STATE SERVICE
5555/tcp open  freeciv
8008/tcp open  http
8009/tcp open  ajp13
8443/tcp open  https-alt
9000/tcp open  cslistener
MAC Address: XX:XX:XX:XX:XX:XX

After TV gets shutdown, by any way remote/HA/auto sleep:

nmap 192.168.0.82
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-09 14:47 FLE Standard Time
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 1.02 seconds

I tried to change every tipe of settings in Android TV and nothing helped.

After some time I tried to wake up TV with WakeOnLan option and at first seems like TV had’nt woke up, however, nmap started responding with OK results, and TV become available (visible as turned off again) in HA again:

image

nmap 192.168.0.82
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-09 14:53 FLE Standard Time
Nmap scan report for 192.168.0.82
Host is up (0.00017s latency).
Not shown: 995 closed ports
PORT     STATE SERVICE
5555/tcp open  freeciv
8008/tcp open  http
8009/tcp open  ajp13
8443/tcp open  https-alt
9000/tcp open  cslistener
MAC Address:

I know this happend not to all android TVs, however maybe you could add configuration option to enable, automaticaly resending WakeUpOnLan command, before the Heartbeat request, if tv is in Off/unavailable state?

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Android TV Remote

Link to integration documentation on our website

https://www.home-assistant.io/integrations/androidtv_remote/

Diagnostics information

config_entry-androidtv_remote-369036337b86e55921657a6ff3d5d5b9.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

[Living Room TV(192.168.0.82):8009] Heartbeat timeout, resetting connection
2:43:35 PM – (WARNING) /usr/local/lib/python3.11/site-packages/pychromecast/socket_client.py - message first occurred at 1:28:34 PM and shows up 25 times
Disconnected from Living Room TV at 192.168.0.82
2:38:41 PM – (WARNING) Android TV Remote - message first occurred at 1:28:30 PM and shows up 47 times
[Living Room TV(192.168.0.82):8009] Failed to connect to service ServiceInfo(type='mdns', data='Smart-TV-Pro-6e0231880edf1cc85f26ad05671960b1._googlecast._tcp.local.'), retrying in 5.0s
2:20:49 PM – (ERROR) /usr/local/lib/python3.11/site-packages/pychromecast/socket_client.py - message first occurred at 1:29:04 PM and shows up 14 times

Additional information

For anyone looking for fast fix, setting automation every 10s. to send magic wakeup packet, to TV’s MAC when TV is off/unavailable fixed the issue for me.

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 1
  • Comments: 33 (4 by maintainers)

Most upvoted comments

Hello, Just follow doc (https://www.home-assistant.io/integrations/androidtv_remote) : Some devices, like TCL, become unavailable after they are turned off, unless you activate the Screenless service. To activate it, go to Settings > System > Power and energy > Screenless service, and activate it.

It’s work for me,

Regards,

I have the same issue with my TCL Android TV. It doesn’t even have such a setting.

Hello, Just follow doc (https://www.home-assistant.io/integrations/androidtv_remote) : Some devices, like TCL, become unavailable after they are turned off, unless you activate the Screenless service. To activate it, go to Settings > System > Power and energy > Screenless service, and activate it.

It’s work for me,

Regards,

Hello, I did tried it, however, My TV has no such (Screenless service) setting.

Hello, Just follow doc (https://www.home-assistant.io/integrations/androidtv_remote) : Some devices, like TCL, become unavailable after they are turned off, unless you activate the Screenless service. To activate it, go to Settings > System > Power and energy > Screenless service, and activate it.

It’s work for me,

Regards,