Page 1 of 1

While do

Posted: Thursday 16 July 2020 12:16
by Vikin
while domoticz.devices('hladina4').state == 'On' do
cerpadlo.switchOn().checkFirst ()
ventil4.switchOn().checkFirst ()
end

cerpadlo.switchOff().checkFirst ()
ventil4.switchOff().checkFirst ()

end

Is this entry possible?
Why doesn't the red part of the code execute?

Thanks
Vikin

Re: While do

Posted: Thursday 16 July 2020 12:23
by waaren
Vikin wrote: Thursday 16 July 2020 12:16 Is this entry possible?
This while loop does not make sense.

dzVents does receive the state of all devices at the start of the script and will not get devicestate updates during execution of the script. So if the devicestate = 'On' at the the start of the script. dzVents (but also true for classic Lua and Blockly) will see only this 'On' state.

Re: While do

Posted: Thursday 16 July 2020 12:40
by Vikin
Thank you for the explanation.