Tanks a lot!
Now i have another issue. I kind of understand why but i don’t know how to solve it:
Everytime i push the Switch the timer function (rule) is called again and this messes up the current timer (it posts updates from each instance of functions that is called).
to solve this i wanted to reset the counter to 0. When the rule is called (i assume in a new instance) the var counter is of course not the same as before so i cant just write:
var counter = 0
after the when.
So i decided to create a global variable in the items as a number. (just added:
Number counter “Zaehler”
to items. I don’t quite understand why this does not solve my problem and how to write to number variables.
i used sendCommand in the past but this won’t help if i use math-functions as in this case.
Why can i not just assign a value to the Number-Variable like:
counter = 0 (counter defined in items files as described above).