Only first event in a series of repeat as trigger?

I have a auto off virtual switch that "flashes" for a visual chime of sorts during HSM arming delays. I want to trigger a rule off of the first "on" but not constantly retrigger after. Is this possible?

I'd suggest creating a local Boolean variable, setting it to true as the initial value, then using actions like:

IF (MyVariable is True) THEN 
  Set MyVariable to False
  (do stuff)
  Delay 0:10:00
  Set MyVariable to True 
END-IF

Of course, adjust the delay as needed to accommodate the length of time the switch "flashes" for or however long beyond that you want to wait.

You could use Private Boolean for this too, with fewer clicks at that, but a "real" variable is easy to manually set the value of if you ever need to.

2 Likes

So chime on would be the trigger and the boolean being true would prevent constant retrigger?

Chime on would be the trigger to get what you described. The boolean being false would prevent the "real" actions from running (it won't prevent retriggering per se, but the outcome is the same), though you could write the logic to work either way--that's just what I chose.

1 Like

This what I got.

Seems to be working but....
image

I'm using this rule to prevent run on if I choose to cancel the arming but the error is from the original rule

What does trigger and action logging (or just all logging) show for the first rule and look at those logs around the time you get the error?

This double end if is strange...Maybe I need to extend the delay? I think the chime may be still triggering.

image

More context might help (when are the trigger events happening?). The double "END-IFs" indeed seem odd, but it would make more sense with the rest of the logging to see when or why it's happening.



Edit: extending delay did not change anything

I wonder if it's freaking out about the fact that the delay is up around the same time it's being re-triggered. A workaround would be to use a hub variable instead of a local variable, then instead of using a conditional around your actions, use a required expression instead (this won't work with a local variable, though I think it would with PB if you wanted to go that route). Not sure about this, though. Hitting "Done" or "Update Rule" just to re-initialize things and trying again might help otherwise...

1 Like

Hell yeah! That was the trick! Thank you so much!

Just sharing the final rules....