I'm working on some home automation programs and one of the things I want to be able to do is detect when my 4th generation Apple TV has woken from sleep. This will generally only ever happen when someone pressed a button on its Siri remote to wake it up.
I have a PC (connected to the same TV as the Apple TV) that has a Pulse-Eight USB-CEC adapter, so naturally the first thing I tried was using CEC to determine when the Apple TV is awake. Unfortunately it's not reliable, since monitoring the Apple TV's power status to see when it wakes up produces false positives. (I should note that I do not have "Control TVs and Receivers" enabled on the Apple TV, and can't turn it on for the particular project I'm working on because I need the Apple TV to not change the TV's input.)
I'm trying to think of some other way to do this. I'm open to any possibilities, including things like:
Does anyone have any suggestions? I'm running out of things to try!
To wake your Apple TV, press Menu or TV/Control Center on your remote.
Apple continues to sell the Apple TV HD (originally known as the fourth-generation Apple TV) for $149. Beyond changes to the Siri Remote, the device has not received any hardware upgrades since being released nearly seven years ago.
Put Apple TV to sleep If your TV or audio/visual receiver supports HDMI-CEC, your Apple TV automatically goes to sleep when you turn off your TV or receiver and wakes up when you select its HDMI input on your TV or receiver. You can also turn your TV or receiver on or off with the Siri Remote.
Press and hold the TV button. to open Control Center, then select Sleep. Open Settings. on Apple TV, then select Sleep Now.
I tried to post below on apple discussion / support communities but was told i don't have the right to post this content. Maybe someone in this group can succeed in doing it:
Apple TV 4 CEC integration is great when it works, but it doesn't work all the time and not with all the various equipment out there, you can do a search across forums and you will see lots of unhappy users. I would like to use a raspberry PI to detect when my AppleTV goes to sleep and wakes up and programmatically turn my tv on or off using its RS232C or custom CEC commands.
I used a bonjour services explorer and compared every single result between sleep and on states and there are no differences whatsoever. I would have expected Apple to welcome such automation projects and make this information readily available with a variable such as status: sleep or status: on.
Is there a way I could tell the two states apart via the network connection?
If not, could one build a TvOS app which runs on the background and makes this information available to clients somehow?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With