#Prevent double trigger on automation

1 messages · Page 1 of 1 (latest)

boreal mural
#

I have a trigger (some node red connected module) that tends to trigger twice in a very short time (1-2s) at the same time when activated.
I could built my automation to first flip a variable, wait a few seconds and then flip it back and also check whether it is flipped to prevent this.

I saw you can set triggers to disabled, not sure if I can disable them at the start of automatisation and reenable them as last step.

I am thinking there is probably already a good and clever solution for this.

dim coyote
#

One way if it's a mode:single automation is to just add a few second delay to the end of the automation

#

then it can't be retriggered in that window

#

depends on if you can block the entire automation from being triggered (by other triggers), or if you need to just block that specific trigger only

boreal mural
#

I have a waiting block inside the automation, so usually the 2nd trigger happens while it is still running...
That might mean I have a flaw in the logic somewhere...
I'm only using that one specific trigger

dim coyote
#

what mode is automation set to?

#

by default it should ignore new triggers while it is still executing

boreal mural
#

mhh single
I just checked the traces.. and there's 2 executions with the exact same timestamp.. so not 1-2s but literally same centisecond

#
alias: Desktop-Logic
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_button.desktop_button
conditions: []
actions:
...
mode: single

Did I implement the trigger wrong?
Does that button always change state twice ?
(it is a helper that is adressed by node-red)

dim coyote
#

seems like that would be fine to me 😕

boreal mural
#

mhh, then I might need to fix it on the node-red side... but it might be just as complicated... I'll start with a little delay...

vale peak
#

Add a delay of a couple of seconds to the end of your automation and make sure the mode is set to single. That way any subsequent triggers happening while the delay is running will be ignored

boreal mural
#

Lemme paste the last 2 traces

#

OH! I'm dumb
It can run 2 ways, and one way is actually without any real time delay -.-

#

Okay, thx. I can't test it right now (since it is controlling the power to my computer (checking whether it is running or not from power draw))
But that should already do the trick.
When switching on it just plain goes through and flicks a switch, which is done so fast it appears as the same timestamp.