My script works by cons when I add a condition this one does not work anymore and and I can not understand the mistake I made
elseif dz.time.matchesRule('25 minutes after sunset') and dz.devices('Jardin').state == 'Off' then MY SCRIPT WORK
elseif dz.time.matchesRule('25 minutes after sunset') and dz.devices('Jardin').state == 'Off' and dz.devices('Volet cuisine').state == 'On' then MY SCRIPT NO WORK
Code: Select all
return {
on =
{
timer = { '25 minutes after sunset','at 7:30 on mon,tue,thu,fri','at 8:30 on wed,sat,sun'},
devices = {'Jardin'},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Volets'
},
execute = function( dz, item, devices )
Cuisine = dz.devices('Volet cuisine') -- racourci des devices
Salon = dz.devices('Volet salon')
if item.isDevice and item.state == 'Off' and dz.time.matchesRule('at nighttime') then -- ferme les volets si le jardin pass en off
Cuisine.switchOff().silent()
Salon.switchOff().silent()
elseif dz.time.matchesRule('25 minutes after sunset') and dz.devices('Jardin').state == 'Off' then --coucher du soleil protection lumière on attend le off pour fermer les volets
Cuisine.switchOff().silent()
Salon.switchOff().silent()
elseif dz.time.matchesRule('at 7:30 on mon,tue,thu,fri') then -- lever du soleil
Cuisine.switchOn().silent()
Salon.switchOn().silent()
elseif dz.time.matchesRule('at at 8:30 on wed,sat,sun') then -- lever du soleil
Cuisine.switchOn().silent()
Salon.switchOn().silent()
end
end
}