multiple AND's in on-devices
Posted: Friday 06 July 2018 14:16
Hi,
I already read the wiki but it's not mentioned there.
How can i have multiple AND's in the on devices part?
I have a blocky i want to transform to DzVents but i'm confused, already saw the how-to video but that's not making it easier.
Part of my Blocky:
IF "Home" = ON AND "ZonOp" = OFF (ZonOp goes OFF 10min before sunset)
THEN "Lamp1" = ON Random in "1" minute
THEN "Lamp2" = ON Random in "1" minute
Below is my DzVents script so far, it's still missing a few things:
- timer: '10 minutes before sunset',
- AND, so Thuis = ON and 10 minutes before sunset
Another question, how can i make different IF ELSE statements in DzVents?
My blocky is 1 script and has multiple IFELSE for different situations (home, away etc)
I already read the wiki but it's not mentioned there.
How can i have multiple AND's in the on devices part?
I have a blocky i want to transform to DzVents but i'm confused, already saw the how-to video but that's not making it easier.
Part of my Blocky:
IF "Home" = ON AND "ZonOp" = OFF (ZonOp goes OFF 10min before sunset)
THEN "Lamp1" = ON Random in "1" minute
THEN "Lamp2" = ON Random in "1" minute
Below is my DzVents script so far, it's still missing a few things:
- timer: '10 minutes before sunset',
- AND, so Thuis = ON and 10 minutes before sunset
Code: Select all
return {
on = {
devices = {
'Home'
}
},
execute = function(domoticz, Home)
domoticz.log(Home.state)
if (Thuis.state == 'On') then
local lamp1 = domoticz.devices('lamp1')
lamp1.switchOn()
local lamp2 = domoticz.devices('lamp2')
lamp2.switchOn()
end
end
}
My blocky is 1 script and has multiple IFELSE for different situations (home, away etc)
