Hello all
I am fairly new to Zigbee (but very used to Home Assistant) and today, I tried to dim lights with an IKEA 2 button.
I thought I could easily just create an automation on brightness_move_down and then add a reapeat until brightness_stop is received and decrease the brightness in the loop.
But I struggle hard as I cannot find brightness_stop as a condition.
Would this anyway be the correct way? And also, I don’t have experimental_event_entities currently enabled. Should I enable this? Is this the way in the future that will be used?
Many thanks for some help.
What I currently could do is to decrease the brightness on a single long-press:
This is awesome! Works out of the box and I don’t even need the experimental events activated. Pretty clever with the brightness_stop and restart mode, didn’t get how this worked at first but it works great. Maybe one small question: you gate the triggers an id, I guess this is needed. Are those ID globally unique or just unique per automation?
Sending a message 5 times per second on a zigbee network can flood the network. It may work. But if you also control many lights this way, you may notice that not all the lights react and get out of sync. It is better for the network to send one message to start dimming up or down and one to stop. That is also how the Philips Hue hub does it
I get your point. In my case it is not that critical as it is with manual buttons, so there won’t be 100 buttons pressed at the same time I hope
I actually also tried a combination of both versions by just switch the light.turn_on action to the mqtt.publish action with works but the one issue I have with it is that when dimming down and it somewhen reaches 0, the light is still on very dim. If I use the light.turn_on it seems that HA has some internal logic that when the brightness is 0%, it will turn off the light. That seems to be missing in Zigbee2MQTT.
The way the dimming works in my example is that you give the light the message to dim up or down 50 steps (from 1 to 255) per second until it either reach upper or lower limit or you send the stop message (move 0)
If someone wants to lower the light to the lowest it will be really annoying if you have to accurately time your release to avoid turning it off. To turn off you short press. Or press an Off button if it is a 4 button.
The real risk of poor performance is if you have this scenario.
You have a living room with 8 lights. (like me).
You put the 8 lights in a Home Assistant group and not in a zigbee group
And then you use an automation that sends step up or down 5 times per second.
This will make Home Assistant send 8 messages every 200 ms to each of your lights which is 40 zigbee messages per second. Zigbee is not a fast network and it has a lot of retries and rerouting and all your sensors keep on chatting also. The result many have reported is that when they dim up and down the some lights misses steps so you end up having everything out of sync.
If you have your lights in a zigbee group - HA sends one message 5 times per second to 1 group. That is 5 messages per second. Better and probably works for most.
There is another benefit of Zigbee groups. If a light looses connection to the coordinator but is still alive, it will most often still react to the group commands so it turns on and off and dimms with the rest even if it is officially lost to Home Assistant. That means your family will only notice if they try to turn the individual bulb on and off. Always use Zigbee groups. Only group lights in HA if they are wifi. If you have a mix of zigbee and wifi lights and you want to control them as a group, then make a zigbee group first. And then in HA you group the Zigbee group with the Wifi lights. The wifi lights will not know the brightness_move commands so then you have to iterate in a loop stepping up and down.