So your script works as you wrote it to me
Code: Select all
return {
on =
{
timer = { '20 minutes after sunset','59 minutes after sunrise' },
devices = {'Jardin'},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Volets'
},
execute = function( dz, item )
local keyIFTTT = 'xxxxxxxx'
local salon = 'salon'
local cuisine = 'cuisine'
local open = 'ouverture'
local close = 'fermeture'
-- domoticz.triggerIFTTT is a native dzVents method for version >= 2.4.18
local function triggerIFTTT( action, ... ) -- ... accepts 1 - many parms
for _, room in ipairs({...}) do -- walk through all ... parms
dz.openURL('https://maker.ifttt.com/trigger/Volet_' .. room .. '_' .. action .. '/with/key/' .. keyIFTTT ) -- call IFTTT webhook
end
end
if item.isDevice and item.state == 'Off' and dz.time.matchesRule('at nighttime') then
triggerIFTTT(close, salon, cuisine )
elseif dz.time.matchesRule('20 minutes after sunset') then --coucher du soleil
triggerIFTTT(close, salon, cuisine )
elseif dz.time.matchesRule('59 minutes after sunrise') then -- lever du soleil
triggerIFTTT(open, salon, cuisine )
end
end
}
so I change for school days and weekends and protect eat garden light on no close shutter after finish eat light off the shutter close Thank you again for your help
Code: Select all
return {
on =
{
timer = { '20 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 )
local keyIFTTT = 'xxxxx'
local salon = 'salon'
local cuisine = 'cuisine'
local open = 'ouverture'
local close = 'fermeture'
-- domoticz.triggerIFTTT is a native dzVents method for version >= 2.4.18
local function triggerIFTTT( action, ... ) -- ... accepts 1 - many parms
for _, room in ipairs({...}) do -- walk through all ... parms
dz.openURL('https://maker.ifttt.com/trigger/Volet_' .. room .. '_' .. action .. '/with/key/' .. keyIFTTT ) -- call IFTTT webhook
end
end
if item.isDevice and item.state == 'Off' and dz.time.matchesRule('at nighttime') then
triggerIFTTT(close, salon, cuisine )
elseif dz.time.matchesRule('20 minutes after sunset') and dz.devices('Jardin').state == 'Off' then
triggerIFTTT(close, salon, cuisine )
elseif dz.time.matchesRule('at 7:30 on mon,tue,thu,fri') then
triggerIFTTT(open, salon, cuisine )
elseif dz.time.matchesRule('at at 8:30 on wed,sat,sun') then
triggerIFTTT(open, salon, cuisine )
end
end
}