While do

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Vikin
Posts: 3
Joined: Thursday 04 June 2020 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

While do

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: While do

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Vikin
Posts: 3
Joined: Thursday 04 June 2020 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: While do

Post by Vikin »

Thank you for the explanation.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest