Trigger a flow after n occurences of a condition

Hi there

sometimes my network becomes not that stable (in particular when I upgrade the box from my provider :frowning: ) And I came to an idea : would it be possible for any flow to have a counter, and actually trigger the flow only when the conditions have been met continuously over a preset number of time ?

If I get you right, something like this should get it started?

When…
(Logics) A variable [[YourCounterVar]] changed
And…
(Logics) Variable [[YourCounterVar]] is equal to 5
Then…
(Chronograph) Start or replace timer ‘Network’ with running time of 5 minutes

When…
(Chronograph) Timer ‘Network’ has finished
And…
(Logics) Variable [[YourCounterVar]] is equal to 5
Then…
Do something

Sorry, nope, it would be rather like this:

  • Flow 1 :

    • when condition 1 is met

    • Then increment (variable)

  • Flow 2 (inversion of flow 1)

    • when condition 1 is not met

    • then decrement (variable). If (variable) <= 0 then (variable) = 0

  • Flow 3

    • when (variable) > (threshold) then trigger action

the idea is to eliminate false positives, where sometimes some conditions may be met (such as “device is not reachable”) just because the network is flapping.
Then I would like that the condition is met 2 or 3 times in a row before triggering the flow action

Well, then you could add the delay like this

  • Flow 3
    When…
    (variable) has changed
    And…
    (variable) > (threshold)
    Then…
    (Chronograph) Start or replace timer ‘Network’ with running time of 5 minutes
    Else
    (Chronograph) Pause timer ‘Network’

  • Flow 4
    When…
    (Chronograph) Timer ‘Network’ has finished
    And…
    (variable) > (threshold)
    Then…
    Start action

These are 2 flows

  • Flow 2A
    When…
    condition 1 is not met
    Then…
    Calculate (variable) as {{(variable)-1}}

  • Flow 2B
    When…
    (variable) has changed
    And…
    (variable) is equal or less than 0
    Then…
    Set (variable) to 0