Apple TV HA Integration: Optionally override state
What feature would you like?
I am one of those users who has HomePods paired with each of my Apple TVs. As such, the Apple TV state never goes into standby/off, it remains idle indefinitely. I understand that this is a current limitation of what is understood about the protocol.
This creates a challenge in the HA frontend, because the Media Player card cannot be used to control the power state. The turn_on and turn_off behavior of the card relies on an accurate understanding of the device state.
However, I can determine the "likely" power state of the Apple TV based on other sensors in my home. For example, since the power of my TV is controlled via the Apple TV's HDMI CEC, if the TV is off and the ATV is idle, I can assume the ATV of off. Other users may have other methods for inferring the value based on power sensors, receiver settings, etc.
Describe the solution you'd like
Given the lack of a one-size-fits-all solution, I was wondering if an optional state_override configuration option could be made available. This could either be a template, or an entity_id that references a sensor value. If not provided, the state behavior would remain the same as it is today.
The other change this might necessitate is adding a reference to the "true" reported state value in the device attributes. This would allow the template / sensor to consider the reported state of the integration when calculating the override value.
I understand this might seem like a bit of a hack, but I've seen multiple references to the idle HomePod situation, and general reliability of the power state in the issues. As optional, this could better support the myriad individual setups until a more graceful solution is identified.
Any other information to share?
Nope. Thank you for the consideration.
I totally understand the frustration with this and I would love a proper solution. Currently I have no idea how that would look like though. My experience is that these sorts of hacks are generally quite hard to get merged into core as there are ways to accomplish similar behavior in other ways (and it only affects a small amount of users). One way is to use the universal media player (and yes, you do get two media players, but that's life). This is one of those things that I would love for to the community to figure out and send a PR as I have to much on my plate anyways.
@MizterB Thanks for sharing, I was frustrated because I got lost seeking why my ATVs are powerstateon, while obviously there were not. Now I'll consider to make hardware solution with sonoff pow switch, and adding automation based on changes in power consumption. Unfortunately, wasnt able to find enough info if this will work, but I'll try and inform you back.