Hey guys. I have these recessed lights in my living room. Flipping the switch on then off then back on puts them into night light mode. I have a ZB mini relay behind a physical switch. I need a rule to flip the switch on then off then back on but with a delay in between.
I made a rule before but it was too fast for the relay and it just made the lights flicker on and off forever. Half a second is still not long enough. I think it'd be good with about a 1 second delay.
Trying to understand... From the recessed light documentation, it almost sounds like it toggles between downlight and nightlight modes every time it is turned on?
Or is there some timing apsect to it, if left off for a while it comes back on in the same mode, but if off for a short period it switches modes?
If you already created a rule you could just try a few different delays for it and see which one works. A good test would be to try the switch manually yourself and see about how long it takes to do it that way. Then you can try to replicate that in a rule.
Then again... it could be a feature that only happens with manual presses. There might be some other way to enable the nightlight mode when you are doing it over ZigBee.
My intention is "Alexa turn on the living room lights" with one flip on which it already does via the ZBmini.
I would like "Alexa turn on the living room night lights" to turn the switch on, then off and then back on via the ZBmini.
Last time I made this rule I believe I could not make the delay more than 1 second which would make the relay go crazy in the wall and flicker the lights. The only way I was able to stop this was to turn it off via the devices page in Hubitat.
Should be able to achieve what you want with basic rules. Have Alexa turn on a virtual switch and then turn on your light, then add your required wait time, and then turn your light off, add the required wait time, then on again.
To turn the light off when not in use, make a second basic rule that just turns the light off when the virtual switch that Alexa is linked to turns off.
@user359 can you screenshot the top of your rule, including the trigger? If your trigger is the light turning on the first time, it would explain the loop you describe. I agree with @SmartHomePrimer, easiest way is to have a virtual switch that is exposed to Alexa for the "night light" routine, and use that virtual switch "on" as the trigger event.
Now the 1 second is working fine. I am triggering it with the Zbmini, never thought that it would loop like that. Ill try a virtual switch and see if that works.
Ex.
When Night Lights (virtual switch) turns on,
Turn on zbmini (ZigBee relay)
Wait 1s
Turn off zbmini
Wait 1s
Turn on zbmini
Before, if the trigger and actions was the zbmini, the last action (turning zbmini on) would trigger the rule to start again, leading to the flickering/flashing behavior you reported
Create the virtual device (you don't input any ID's). In your rule a trigger will turn on/off that virtual device which in turn will trip something else etc...
Of course theres a hangup now. i turn them off via "Alexa turn off the overhead lights" but this doesnt turn the virtual switch off so next time I go to turn on the "night lights" Alexa sees them as being on already and doesnt trigger the rule.
Is there a way to get that virtual switch to poll for its current state?