Hello,
I need to count up a variable every 400ms as long (while) the Input of a KNX-Switch is “ON”.
I tried several things. Last one was:
[Code]
rule "Dimmertaster"
when
Item KNX_HWR_TestTaste received command
then
var Number percent = 0
while(receivedCommand==ON) {
Thread::sleep(400)
percent = percent + 5
postUpdate(Dimmer_Ingo, percent);
logInfo("ONN",now + ": StartZeit= " + StartTime_Ingo + "; Offf= " + StopTime_Ingo)
}
[/Code]
This is not working as the variable gets countet up, even if the input is not “ON” anymore.
What I want, only count up as long as the Input is “ON” and stop counting on when Input gets “OFF” again.
Thanks for reading (and helping) in advance,
Ingo