I noticed that the script that worked ok in the lastest beta 2020.2 (build 12554)
stopped working.
The entire script below
Code: Select all
return
{
on =
{
timer = {'every 2 minutes and between 4 minutes after sunrise and 58 minutes after sunset , between 59 minutes after sunset and 3 minutes after sunrise'},
devices = {'Opady'}
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Oczko ogród',
},
execute = function( dz, item)
if item.isTimer then
dz.log('Time trigger is: ' .. item.trigger,dz.LOG_INFO )
if (dz.time.matchesRule('between 4 minutes after sunrise and 58 minutes after sunset') and dz.devices('Opady').state == 'Off') then
dz.devices('Gniazdo Oczko').switchOn()
dz.log('Oczko włączone')
elseif (dz.time.matchesRule('between 59 minutes after sunset and 3 minutes after sunrise') or dz.devices('Opady').state == 'On') then
dz.devices('Gniazdo Oczko').switchOff()
dz.log('Oczko wyłączone')
end
end
end
}
Code: Select all
return
{
on =
{
timer = {'every 2 minutes'}
devices = {'Opady'}
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Oczko ogród',
},
execute = function( dz, item)
if item.isTimer then
dz.log('Time trigger is: ' .. item.trigger,dz.LOG_INFO )
if (dz.time.matchesRule('between 4 minutes after sunrise and 58 minutes after sunset') and dz.devices('Opady').state == 'Off') then
dz.devices('Gniazdo Oczko').switchOn()
dz.log('Oczko włączone')
elseif (dz.time.matchesRule('between 59 minutes after sunset and 3 minutes after sunrise') or dz.devices('Opady').state == 'On') then
dz.devices('Gniazdo Oczko').switchOff()
dz.log('Oczko wyłączone')
end
end
end
}
Time.lua does not support timeRules ?