Detect Apple TV sleep

Is there any way to detect in Home Assistant that an Apple TV has been put to sleep (by holding the home button on the small physical remote, and selecting ‘sleep’ option, or by idle time out). The network interface is kept alive by the Apple TV, so I cannot use ping, for example…

You could try this template:

{{ is_state('media_player.your_apple_tv', 'off' }}

Or this automation trigger:

platform: state
entity_id: media_player.your_apple_tv
to: 'off'

To check for sure look at the dev tools states menu when the device is asleep and note what the state is.

Nope, not possible I’m afraid.

That’s what I’m starting to think. During my Google searches I found someone pointing a webcam at the status light of the Apple TV, really?!

Yeah, either that or a light sensor I guess… Not a very elegant solution but would work.

I’m looking to know the same thing…
The Apple TV state is ‘idle’ when it is sleeping. The state is also ‘idle’ when powered on and in the menu.

Don’t get tricked by what state Home Assistant reports. There’s currently no known way of figuring this out I’m afraid.

Good getting this confirmed, since I’ve been trying to figure it out.

Has anyone put a smart plug to see if there is any difference in power-consumption between “idle” and “sleep” on the ATV? Potentially that can be used, feels a little better than a light sensor…

I didn’t check power usage. I did do a quick wireshark trace, but couldn’t determine any specific chatter when switching on/off. It looks like it’s doing a soft display-off action only. The rest of the device stays up and running.

Answering my own question, I’m now running a test and is monitoring the power consumption of ATV. Currently using a threshold of 2.9W. Less than that it’s in sleep mode and above it’s on.

1 Like

My zwave “neo coolcam” power plug is actually measuring 0.00 W when on and idle, or in sleep. When playing content or browsing menu power usage goes up. But still can’t tell “on and idle” from sleep this way…

Maybe you can try another plug. I’m using some older telldus plug I didn’t use. It reports 0.65w when really sleeping, but goes down to 2.6-2.8 directly when I put ATV in sleep mode.

Idle is above 3.3w, what I’ve seen so far is that a few times per day ATV is looking for updates etc and then it consumes over 2.9 even though I haven’t touched it.