Stop automatic opening of the garage door [Solved]
Posted: Monday 25 December 2023 22:06
Good evening, I have a problem with my script that I can't solve on my own. I've looked at many sites but haven't found the right one. My script opens my garage door when I work that day. Because I mostly ride my motorcycle, it's practically impossible to always reach for the remote control. So far I have done the automatic opening with my cell phone (Tasker). This made it possible for me to stop the automatic opening if I didn't finish work normally. Maybe someone knows better how I can stop the countdown.
Happy holidays
Happy holidays
Code: Select all
return
{
on =
{
devices =
{
'Schichtkalender', -- Name of your device
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Schichtkalender',
},
execute = function(dz, item)
local variables = dz.variables('Schichtende')
if item.text == '' then
dz.variables('Frühschicht').set('0')
dz.variables('Spätschicht').set('0')
dz.variables('Nachtschicht').set('0')
dz.variables('Schichtende').set('0')
elseif variables.value == 1 then
dz.variables('Frühschicht').set('0')
dz.variables('Spätschicht').set('0')
dz.variables('Nachtschicht').set('0')
elseif item.text == 'Frühschicht' and variables.value == 0 then
dz.variables('Frühschicht').set('1')
dz.variables('Spätschicht').set('0')
dz.variables('Nachtschicht').set('0')
dz.devices('Rolltor Öffnen').switchOn().at('13:49')
elseif item.text == 'Spätschicht' and variables.value == 0 then
dz.variables('Frühschicht').set('0')
dz.variables('Spätschicht').set('1')
dz.variables('Nachtschicht').set('0')
dz.devices('Rolltor Öffnen').switchOn().at('21:49')
elseif item.text == 'Nachtschicht' and variables.value == 0 then
dz.variables('Frühschicht').set('0')
dz.variables('Spätschicht').set('0')
dz.variables('Nachtschicht').set('1')
dz.devices('Rolltor Öffnen').switchOn().at('05:49')
end
end
}