ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
897 stars 91 forks source link

Hue buttons weird acting #1107

Closed bosco90 closed 1 year ago

bosco90 commented 2 years ago

I have 4 Hue buttons and all of a sudden all of them began to do a weird thing.

The buttons are set to turn on/off one or more lights (depends on the room they are in), using an if statement in the singe press action.

When I press a button the related lights turns on and off right away, this happens multiple times before they stay On. Same happens when I press the button to turn off the related lights (they go back On after one or two seconds).

I've tried to:

The logs in HomeBridge shows only a single button press.

What could cause this? And how can I solve it?

Thanks a lot!

vitkutny commented 2 years ago

I have same issue with Hue Dimmer Switch + homebridge/conbee. Tried using wait in shortcut (thinking second trigger will pass to same if condition), but it looks like the second shortcut is triggered after the first completes, not running parallel.

As workaround it is possible to turn on dummy switch (Toggle Lock) set to automatically turn off after X seconds. And add condition at top of shortcut if "Toggle Lock" is Active => Stop this shortcut. It will ignore multiple runs of same shortcut for X seconds.

Found 6 months old Reddit post with same issue: https://www.reddit.com/r/HomeKit/comments/snib13/home_automation_running_multiple_times_after/

ebaauw commented 2 years ago

Hm, looks like my original reply didn’t stick, sorry for that.

I’ve seen the same issue a couple of times, albeit with an IKEA Trådfri remote controller. Homebridge Hue registers the button event once, and notifies HomeKit once, but somehow, HomeKit triggers the automation twice, a second or so apart. As far as I can tell, this is an issue with HomeKit itself, in particular with the iCloud sync between the HomeKit runtimes on your IDevices and home hubs. I think the second trigger is the home hub receiving the notification over iCloud, but not recognising it has received it already.

In my cases restarting Homebridge (forcing the home hubs to reconnect to Homebridge) remedied the situation. I have an Apple TV 4K and a HomePod mini. HomeKit automations tend to become unreliable, when the HomePod mini is the active home hub. Also, occasionally my iPhone depletes its battery charge in a couple of hours, with Home consuming over 80%, being constantly active in background, and the iPhone getting warm, strengthening my hunch that it’s somehow related to the iCloud sync. I’m afraid all I can do is hope the iOS 16 and family finally fix stability issues on large HomeKit installations, where the configuration no longer fits a single CKRecord of 1MB.