I will provide a video. But to answer some of your questions.
5 smart bulb 1 lamp
yes grouped in HA
Don’t read too much into the labels. That was the minimum amount of work to get the behavior to trigger. This was really part of a larger automation I was working on until I saw this error.
The “ambient light state” label was actually wrong and is checking the group of lights if they are on an off.
To explain everything in full. I have a zigbee button that has 3 states. single click, long press, double click.
Single click should turn the 5 light lamp and the floor lamp on and off depending on its state.
Long press should turn off either the floor lamp or the 5 light lamp depending what is currently on. For example if 1 long press is registered and both lights are on, turn the lamp off. Long press it again, turn the lamp off and turn on the 5 light lamp. Once more, turn off 5 light lamp, turn on floor lamp.
Double click (which I havent even tried yet), cycle though predefined colors.
What you’re seeing right now is a dumbed down single click. The signal comes in and the state of each lamp is checked. If the 5 light group is on, turn it off. If its off, turn it on. Same with the floor lamp. If its off turn it on. If its on turn it off.
The issue that I’ve found during testing is when the lights are out of sync (which will happen when I want to do a long press of the button). Even though each lamp is independent of the other, they will want to act synced.
So lets say we’re simulating what should happen if the lights are out of sync. The 5 light lamp is on and the floor light is off. With the automation, the signal comes in and if its correct, the 5 light lamp should turn off while the floor lamp turns on.
Instead of doing that. The 5 light lamp instead flashes (instead of turning off) and the floor light comes on, putting them back into a synced state (and incorrect). If the automation is ran again, the lights will proceed on and off properly