This object is in archive! 

How to successfully make two changes to a virtual switch within the same rule

David Pritchard shared this idea 8 years ago
Under Consideration

I have rules where I evaluate some conditions and set a virtual switch (variable) to a boolean value (say, autumn/winter, public holiday, working day, or what have you). Often the most convenient approach is to initialise to "false", and then test a series of conditions for setting to "true". However, this doesn't work in the Zipabox. For some reason, two changes in quick succession don't work - only the first registers.


After doing some tests it seems like inserting a 10-second delay between the two changes using the "Wait" puzzle piece makes it work. A shorter delay may also be OK.


This might help somebody.

Replies (6)

photo
1

Did you try the refresh puzzle?

photo
1

No, I haven't. I've had a ticket open for a while with this problem and haven't heard anything, so I decided to try finding a workaround myself.

I'll try using refresh.

photo
1

No, refresh doesn't work. It's not about refreshing the states - I think it's a delay in the state change taking effect in the device (switch). Without knowing how it's implemented internally, it may be that the device is locked whilst the first state change is taking place, and when the rule attempts to make the second change, it's unable to.

photo
1

I did another test and a 1-second delay is enough to make the successive changes take effect.

photo
1

Ok, good to know this for later.


I really think this kind of queueing should be bookkept (is that a word :) ) on the controller...

photo
3

I had same issue and adding a "Wait 2 seconds" after changing a switch status (virtual switch or not) solved that problem. 1 second was not enough to reach a satisfying level of reliability.

Leave a Comment
 
Attach a file