Add shutdown script
Posted: Sunday 20 September 2020 16:43
Hello to all. Who will help the script to finalize so that the light would burn for 20 minutes and when the light is turned off in some way, I have 3 of them (xiaomi wireless off, button, Yandex Alice) - the sensor would no longer work until the next time zone
Code: Select all
return {
active = true,
on = {
devices = {
'hall sensor'
}
},
logging = {
level = domoticz.LOG_ERROR
},
execute = function(domoticz, device)
local Light = domoticz.devices('hall 1', 'hall 2', 'hall 3')
local t = domoticz.time
if (device.state == 'On') then
if (Light.state == 'Off') then
if (t.matchesRule('at 19:00-08:00')) then
Light.dimTo(100)
domoticz.log('step in the hall - Свет 100%')
end
end
else
if (Light.state ~= 'Off') then
Light.switchOff()
end
end
end
}