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