lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
132 stars 13 forks source link

[bug report] power state switching on>off>on when turning in Apple TV #63

Closed Post404 closed 4 years ago

Post404 commented 4 years ago

When turning on the Apple TV, the switch for the power state switches to on, then to off and back to on within a second.

This essentially triggers both the automations for turning on and for turning off. I never noticed this or had problems with automations based on the power state as it always worked anyway. But now that I added a IR Beamer I did notice. Since the switching happens so fast the IR Beamer is beaming the signals for turning on and off at almost the same time and not all of them come through.

I think this is related to the stability issues, but I haven't seen anyone talk about this before.

lukasroegner commented 4 years ago

Do you have any suggestions on how to enhance the behavior? Dampening for on/off data coming from the Apple TV?

Post404 commented 4 years ago

Thanks for your quick response. I don't know exactly what you mean with dampening.

Since the power state doesn't change in quick succession I would say you could get away by locking the power state for 1 or 2 seconds after it changes. So nothing from "power off" automations get triggered. After that it is open for changing the state again.

bleeps commented 4 years ago

I have the same issue here and as you have suggested locking the power state for 1-2 seconds would solve issues for automations based on power states

lukasroegner commented 4 years ago

Please check out the latest version, which includes a fix for unstable on/off and play/pause states!