JeffLIrion/python-androidtv

Wake on LAN

larena1 opened this issue · 7 comments

Started using HA Android TV component after I bought my new Android TV a week ago.

Reading through the HA community forum revealed that many users have issues with waking the TV from sleep because the adb connection is terminated when the TV is powered off

Same goes for my TV but it does support wake on LAN. Unfortunately though the component does not support that but it would be a nice addition.

I created a "community contribution required" label and applied it to this issue. If someone submits a pull request that implements this functionality, I'll merge it. But I don't plan to work on this myself.

I'll maybe just go with patching the component. Another issue is that HA will not forward turn on to the component when the entity is not available so it must be patched to never be unavailable as there's probably no reliable way to distinguish whether the TV is just powered off or really unavailable.

You could try using a universal media player, as in this comment: home-assistant/core#41734 (comment)

Thought about that too and it does work. Only downside is I now have another entity lingering around in the state machine.

HA has a WoL service. Could your use case call that first, or check state and call that if needed?

My use case is turning the TV on from the media player card. It's working now that I use universal media player to override state and turn on action. I'm using the WoL service.

To recap:

The problem is that the device goes into deep sleep or powers off completely and the ADB connection gets broken.

The solution is to use a means other than ADB to turn the device on. There are different possibilities here: WOL, an IR/RF signal (as mentioned in the linked HA issue), and surely others.

I'm going to close this issue because (1) the scope of this package is controlling the device via ADB and (2) HA provides a workaround for using alternative means of turning the device on via the Universal Media Player integration.