New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent toggling between states of certain lights #1172
Comments
It looks like you’re using HomeKit automations to set the lights when the wall switch button is pressed? I strongly recommend to use Hue bridge rules recalling Hue bridge scenes instead.
|
I will lose the flexibility and the limited features in this case. Using the full fletch of things needs this way of doing. HUE is far behind with the possibilities in their own app, unfortunately.
Why is that the case that Switch send 10 simultaneous API call is that also an issue or working as designed?
Yes, light 2 physically turns off and back on, kind of flashing/toggling |
The switch doesn't send API calls; it just sends a single buttonevent message. Here is what happens:
When using Hue bridge rules, this would happen;
This is actually HomeKit turning the light on and off, and Homebridge Hue sending the corresponding commands to the Hue bridge. That would suggest there's something wrong in your HomeKit automations (the on and off being triggered from the same Single Press?), or the Home hub is acting up. |
I checked all the rules and deactivated them for testing only the relevant ones. The issue persists. Next to that, I also checked the communication and logs for HomeKit. Seems that there is a race condition happening when using a too-slow HomeBridge Server. I used an old Raspberry Pi for that to test my home automation setup first before I automated everything. So now I tried a Standalone Laptop with Hyper-V with a lot of Power to Handle all requests in Time. |
Seems that the issue still persists with the new Hardware running HomeBridge on it. Looks like that sometimes the HUE Wall Switch sends two homekit button single press short after each other, even when pushed only one time. Can be an electrical line bruise because of other interferences on the powerlines close to the Switch. Question: Can we enrich the HomeBridge hue-plugin in a way that we could optionally configure a delay in milliseconds so that in case we get twice a request during a specific time window one will be discarded? Log EXAMPLE:
Here you see the same Trigger twice, even though pressed single time. |
The Hue wall switch doesn't know HomeKit and doesn't send Single Press events. The wall switch sends a 0x00 command from the 0xFC00 cluster, encoding the button event in the command payload. The Hue bridge translates this to an eventstream notification for We've had issues in the past recognosing the correct button events in Homebridge Hue, see #1148. I really need to see the debug logging to ascertain whether the Hue bridge sends duplicate events to Homebridge Hue, or whether Homebridge Hue somehow generates fake Single Press events. Also note that the wall switch needs to be configured what type of physical switch is connected: rocker vs push. I haven't seen any bouncing effects while testing the wall switch myself, but I'm not using any in production (I think they're worthless in that they don't support dual mode and won't function without a Hue bridge or deCONZ gateway, unlike the Hue dimmer switch). If you've configured them as rocker (which the device name would suggest), I think you would see at least three events on bouncing effects. If you've configured them as push, bouncing could explain seeing two events.
A debounce option? Maybe in Homebridge Hue2, but I doubt that's going to work with the mixed API v1 for polling vs API v2 for event stream. Also, I really want confirmation that, indeed, the Hue bridge is sending two events in error. I could add an option to ignore the event stream events for the wall switch module, but that would delay the triggering of Single Press in HomeKit due to polling. |
Here another example Debug Log
So the Switch has been pushed only once but I see two homekit button single press: So in this case it was toggling from ON to Off and then ON |
OK, this seems to be a different situation than what started this issue (where only one out of five lights would not update its state). It looks to be a variant of #1148. I actually see two button press/release sequences, both resulting in a Single Press.
and
However, when Homebridge Hue polls the Hue bridge in between these two press/release sequences, it also generates a Single Press:
I think in this case, unlike #1148, the v1 API has already been updated with the second press/release, before the event stream from the v2 API has reported this. In the other issue, the v1 API would be updated after the v2 API event stream had already reported the event. I fear the idea of combining the v2 API event stream with v1 API polling (as fallback) doesn't work out for switches. Homebridge Hue should probably use either, but not both. For the gen-1 Hue bridges (and for gen-2 Hue bridges with really old firmware), we need to use polling (since they don't support the v2 API). Looking at the amount of hacks and failed attempts to get the |
Just as a side note, I also have the HomeBridge system running with HUE Motion Sensors. Also, this is completely controlled by HomeKit automation as I do for Hue Wall Switch. But I have not seen one single Flapping/toggling issue. So, it looks like that it only happens, as you also mention, for the Switches and not for other components. |
Ignore polled values for `buttonevent` and `rotaryevent` on Hue bridges supporting eventstream notifications, see #1172.
v0.13.68 should use the event stream exclusively for I tested this with a Hue tap dial switch and a Caveat: in case the event stream would fail, there's no longer a fallback to polling (for Off topic, but interesting: when holding a button, then (long) releasing and press/holding it again, the event stream issues |
It works! Awesome. I did a regression test and could not reproduce it anymore. I have also the feeling that the reaction time has decreased, which is extraordinarily positive. Lights are faster in changing their status. Not sure if that's also caused by the change. But much better user experience. I will further test over the course of the next few days and keep an eye on anything that diverts from successful work. Fantastic Job. Thanks Erik. |
There's nothing in the change that would affect the reaction time, but no longer getting shadow button presses would result in fewer Zigbee messages and less throttling. |
Issue
I've seen a strange issue when using HUE Wall Switches, Sometimes I see that the HUE Lights develop a life of their own.
So, in specific circumstances turning OFF lights via the Switch, 5 lights go off as they should, and then 1 or 2 go back on.
Details:
This issue is not permanent, seems that we need to check some Race conditions.
Log Messages
Debug Files
The text was updated successfully, but these errors were encountered: