Problem with numeric variables counting

Hello everyone,

I got my Homey pro a few days ago, and my first Logic problem.

I have numeric variable that starts at 0 and should count +1 every time the “else” condition is met… so I made {{var+1}} problem is, it does not stop counting… ever…

Details:
It’s for my nuki lock. I want it to check if my door is closed every minute and then close it

if
motion detector is off
and var = >0
and door is closed
then
lock door
set var to 0
else
var={{var+1}}
start the same flow again
(the I have another flow, that notifies me if var is above 10)

in theory, it should work, but the counting does not stop after one count it just continues…
Is there a solution? Thank you. :slight_smile:

It’s logical! Take a look at you flow!

Especially the last line!

I think you want only count + 1 after a motion was detected and goes off.

the else condition is a count… but I do not think that the flow is the problem, the flow works… the problem is, as far as I see it, that the logic card just keeps counting, if you count with the same var and not just once…

the flow loops only if the door is not locked and stays open.
It stops looping when the door is closed… but the var does not stop counting because it tries to finish it
In the test modus it never gets a green checkmark… it just continues.

Edit:
Okay, I take it back… It is the flow… but I don’t see what I have done wrong lol

If you var =>O
and your door is Open
Then the else will be executed.
With the Aktion

you create a loop.