Detect when Apple TV is turned on or off

I use an Apple TV (gen 4) as my only source when watching TV. In the TV room I also have a heat pump that is normally running at full fan speed, in order to get the best possible distribution of heat.
However, when I’m watching TV I turn down the fan speed, in order to lower the noise.

So is there a way that Homey can detect when the Apple TV is turned on or off? Homey already talks to the heat pump, so it’s easy to create a flow that controls the fan speed once it knows the status of the Apple TV.

Can you run shortcuts on Apple TV? If so, you can see if there’s a shortcut action available that matches what you want (either “turn off” or “stop watching” or something similar) and send a webhook request to Homey when that happens.

Or maybe you can use a power plug on your Apple TV which measures energy…

Or with the app ‘Net Scan’, based on the (fixed) IP adres of your Apple TV (Online or Not Online).

Net Scan seems like a possibility. Tried with IP, but that didn’t work. The Apple TV doesn’t seem to go offline even when turned off.
At least Net Scan doesn’t detect that it’s turned off, and it also responds to ping.
So I’ll have to see if there’s a port that I can use

Unfortunately, it seems that the Apple TV always listens to the ports it is using, even when it is turned off. So maybe I’ll have to go for a power plug then.

It depends on what you mean by “turned off”. A device like the Apple TV is never really turned off, unless you take it off power.

Exactly! The Apple TV never really turns off.
After a power cycle it needs a couple of minutes to boot, so cutting the power is not an option