Single button flow

Hello,

I am quite new to Homey, still wrapping my head around flows.

I have four zigbee bulbs in my living room that I would like to control by using a single zigbee button. I want to use single press only to control these lights as the WAF (Wife Acceptance Factor) on single button remote seems tolerable, however anything beyond that produces a fail to compute error.

I was hoping to run them in a cyclic fashion, Example; press button once turns one light on, press button once again second light comes on, press button once again third light comes on, press button the fourth time and the fourth light comes on. Fifth button press starts back vs at light 1.

I was able to set this configuration up using four different moods. My new ChatGPT girlfriend assisted me in setting up the enclosed advanced flow. It seems to work reasonably well, however, it often misses one or two lights, seems slow and it’s difficult to get one individual mood consistently. It also seems to delay between button presses.

Can anyone please suggest a flow that is more elegant/reliable?

Thanks in advance.

Is the “mood” you set in your zigbee available as a status (I donexpect).

In that case you can skip the variable and use that ststud in the logic..

Not sure if this solves your problem, but you could use the better Better Logic Libary app to use the card “add 1 to variable current mood” (not totally sure what the English version is of the name of the card , I have it in Dutch).

Than you could press the button once, the current mood variable will be set 1 higher. Than you check which number is the mood like you do now and start the mood. (So you can remove the “Set current mood to” in your last steps). Only for the fourth mood you have to set the variable current mood to 0.

Maybe because you set the variable earlier it goes better. Again not sure if this solves the problem, but you could test this setup :slight_smile:

You could also set a delay after the “set current mood 1 higher” for like 1 or 2 seconds to be sure the variable has been updated.

Without a counter the flow could look as simple like this:

You have to do some debugging to detect were things go not as expected. So add cards to send a message to the time line. It might be that setting a mood for 4 bulbs at once might not work consistently, in that case nothing is wrong with your flow.
You can also manually start the flow from any point to see what the result is.

Your use of moods complicates things. Might be better to control the lights explicitly i.e. if current mood is 1, turn couch on and the others off. If current mood is 2, turn stairs on, etc. I would also set current mood first then link from that card to the desired action(s) in serial. By running cards in parallel there’s a possibility a second press while the action is taking place will be ignored.

If your button supports a long press, it would be a better option than a double press to turn the lights off so there’s no scope for confusing two presses with a double press.

Andy

Instead of “Moods” You could use groups. Easily created & managed with the “< group >” app.

That’s exactly the method I use, and it works perfectly!
However, you don’t need the Better Logic app for this, it also works with the built-in Logic Flow cards:


(Info: I’ve blurred the Flow cards for adjusting brightness with other buttons)

I was not aware you could it that way with the default logic card! New day, something new learned! :smiley:

Thank you all so much for your help.