Ok, so I’m not sure where to start with this one. Hopefully someone else has done something similar, and might be able to point me in the right direction.
I have a bunch of exterior accent lights on the outside of my house that use regular E26/E27 bulbs. I replaced those bulbs with Sengled Element Color Plus bulbs. I have the bulbs paired to my HUSBZB-1, and I’m able to control them via Home Assistant just fine. I’ve currently got them set in a alternating static red/green/red/green pattern. So, the first fixture is green, the 2nd fixture is red, etc.
What I’d like to do, is have them switch between red and green (or any other combination, depending on occasion) automatically, based on time…but synchronized.
For example:
Fixtures 1, 3, 5, 7, 9 all start red, Fixtures 2, 4, 6, 8, 10 all start green.
After 1.5 seconds, all fixtures change state together, so the odd numbered lights turn green, and the evens turn red…repeat in a loop until a specific time; at which point all light will turn off for the night.
What’s the best way to approach this? Any help is greatly appreciated.
My first suggestion is to not think in terms of ‘even’ and ‘odd’ lights but simply two groups of lights. When one group of lights is set to red the other is set to green. The automation doesn’t need to consider the physical arrangement of the lights (red-green-red-green-red-green) only that one group’s color must always be opposite to the other.
You should also know that this project will subject your ZigBee network to a flood of traffic. I don’t know how many lights you plan to use but let’s say there are five. Every 1.5 seconds, at least 5 commands are transmitted from the ZigBee coordinator, one for each light, to change their color. Five acknowledgement messages, one for each light, will be returned to the coordinator. Then the process starts all over again, repeating every 1.5 seconds.
If your ZigBee network has any appreciable amount of latency, you may begin to see some lights fail to change color at the desired moment in time. In other words, you see the so-called ‘popcorn effect’ where a group of lights doesn’t change color in unison but one after the other. In addition, while all this traffic is in progress it might degrade the performance of controlling other ZigBee devices.
Or, it might work flawlessly.
When dealing with groups of lights, the best performance is achieved with hardware-based groups (or hardware scenes, depending on the terminology used by the lighting technology). ZigBee supports the concept of groups so that just one ZigBee command can control all members of a group. Instead of sending 5 commands, only 1 is sent and all group members respond at the same time (no ‘popcorn effect’). How does one use ZigBee groups in Home Assistant? That’s where I’ll admit the limit of my knowledge and hopefully someone else can answer that one.
Note
A relative recently installed 6 ZigBee bulbs in a chandelier. He uses SmartThings but the key point here is that the lighting is ZigBee-based. When instructed to turn on, 6 commands are transmitted and one clearly sees the ‘popcorn effect’ (i.e. all six lights do not turn on at the exact same time). He is currently investigating ‘ZigBee groupcasting’ to have them turn on/off in unison.
Good point. In my head, I was indeed treating them like 2 groups. For whatever Reason, it seemed like I needed to explain it in even/odd terms. But, I agree with you.
I had not even thought of this. There will be a lot of these bulbs in the mix, so I can see this becoming a problem very quickly.
This was something else I was not aware of. I just always took for granted that groups (HA’s groups) worked in this manner. I also couldn’t figure out why my group members acted sequentially instead of simultaneously. This explains a lot.
So…how to get things working as hardware-based groups…
DeCONZ for example exposes the ZigBee groups to HA as a light. I have 3 bulbs in the ceiling of my office and I grouped them in deconz and it exposes to HA the 3 bulbs as light.ceiling_1, light.ceiling_2 light.ceiling_3 and the group as light.office.
@RobotGib
The native ZHA component (which I assume you are using to integrate the ZigBee devices into HA? ) doesn’t support grouping of lights into a ZigBee group. I don’t know about ZigBee2MQTT.
When it comes to groups, Home Assistant handles them the same way as other home automation systems. A group is a collection of devices that can be handled as a single device … but it does not leverage any grouping feature offered by the device’s technology.
For example, these technologies all offer a grouping feature:
Insteon
ZigBee
Z-Wave
UPB
Let’s call that a hardware-based group to distinguish it from Home Assistant’s software-based group.
Imagine you have created a group, in Home Assistant, called “all_lights” consisting of a dozen lights:
four are Insteon
four are ZigBee
four are Z-Wave
When you turn on the “all_lights” group, Home Assistant sends twelve commands, one to each of the twelve lights: four Insteon commands, four ZigBee commands, and four Z-Wave commands.
Ideally, it should automatically create three hardware-based groups (one for each lighting technology) and then it would only need to send three commands (instead of twelve) to turn “all_lights” on. However, you can imagine how challenging it would be develop a mechanism that automatically creates/updates/removes hardware-based groups to match the software-based groups!
FWIW, in Insteon they are called scenes and Home Assistant can turn on/off an Insteon scene. That’s direct control of a hardware-based Insteon scene (group). As per Burningstone’s post, direct control of ZigBee’s groups depends on which ZigBee integration you use. Per its documentation, zigbee2mqtt supports ZigBee groups.