[BETA] Groupthink

I have lots of places where a single logical light comprises many smart bulbs. Obviously, that's what groups are for. However, I have some of these groups that are not always the most responsive -- mostly they'll fail to turn on/off, or occasionally a bulb will get left behind when the group changes. I've added well-reviewed repeaters, upgraded to a C-8 hub, moved suspect repeaters to a secondary hub, increased the power on the Zigbee radio, and still I have occasional lapses.

Sometimes you just have to repeat yourself. Enter Groupthink.

Unlike real devices, group activators reflect the last state they were told, rather than the last state the device reported. Groups and Room Lighting both optionally expose a groupState attribute that indicates whether the collection devices are allOff, someOn, or allOn. This makes it possible to do a consistency check on a group device.

Groupthink listens to the on/off events of a group activator, waits a configured period of time, and then checks to see that groupState reflects the state that was just commanded. If it doesn't, it repeats the command. And repeats the command. And repeats the command. And... you get the picture. (Eventually so do the bulbs.)

And the result:

Currently available on GitHub and HPM.

9 Likes

I have the same situation with 5 bulbs in the front of my house that I call "Front of House Bulbs." Every once in a while they get out of sync, so your app interests me. I'm assuming that it doesn't really loop forever, right? I mean I would think it would try X times over Y minutes or something so it doesn't bog down the hub with an endless loop. Wondering before I try the app...

1 Like

Very nice app @mbishop!

From the screenshot, I can see that a Maximum number of retries can be set (shows 20). So it looks like you will be able to control this, along with the delay between retries.

3 Likes

D'Oh! backs away sheepishly

2 Likes

Right; in the most obvious case, if one of the devices is actually offline, the group will never reach the desired state. Eventually it gives up.

1 Like

I played with this a bit last night. I have two switches in my Garage that don't always turn off. When I first set it up it kept saying it was ignoring the group because it didn't have the groupstate attribute. It was a group set up in Groups and Scenes. It was brought over from a cloud migration from a C7 to my C8. For some reason even though the group was just using two on/off switches, the group device was setup as a color LED dimmer. I removed the group and set it up again.

After deleting and setting it up again the device was just a simple on off switch. Still did not show a groupstate. I changed the state of the group switch a couple of times to make sure it was working and it was, but no groupstate. I also made a test RM rule to read back the groupstate, which I could do, so it was a valid attribute, but it read back as null. I finally rebooted the hub and then it showed up. So maybe something to watch for.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.