zbot473
(zbot473)
April 3, 2018, 7:24pm
4
HomeAutomation:
There is a “}” missing at the end. I reformat it, then it is clear.
rule "Bionaire Speed"
when
Item BionaireSpeed changed
then
val prevstate=(BionaireSpeed.previousState.state as DecimalType)
val currentstate=(BionaireSpeed.state as DecimalType)
val reqclicks=currentstate-prevstate
if (reqclicks < 0)
{
reqclicks=6+reqclicks
}
val i=1
var boolean flag = true
while(flag)
{
Bionaire_TransmitCommand.sendCommand("Speed")
Thread::sleep(1000)
if (i=>reqclicks)
{
flag=false
}
} <==this one is missing!
end
Another hint. Maybe break; can end the while without the need of the flag check.
Yeah, i had fixed the } after i posted; sorry. Also, this wasn’t the first try. I also used the openhab tutorial here , but it didn’t work for my variable, only when i put a number.