Apertura y cierre de puertas de armarios
Este script abre las 8 puertas de 2 armarios (de 4 puertas cada uno).
return
{
on = {
devices = {[65] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[68] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[71] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[74] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[77] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[80] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[83] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' },
[86] = {'at 06:50-23:45 on mon, tue, wed, thur, fri', 'at 09:00-23:45 on sat and sun' }
}
},
execute = function(dz, device)
local luz = dz.devices('Vestidor')
if (dz.devices(65).state == 'Open' or dz.devices(68).state == 'Open' or dz.devices(71).state == 'Open' or dz.devices(74).state == 'Open' or
dz.devices(77).state == 'Open' or dz.devices(80).state == 'Open' or dz.devices(83).state == 'Open' or dz.devices(86).state == 'Open') then
luz.switchOn().forMin(4)
dz.log('LOG: Vestidor encendido', dz.LOG_INFO)
elseif (dz.devices(65).state == 'Closed' and dz.devices(68).state == 'Closed' and dz.devices(71).state == 'Closed' and dz.devices(74).state == 'Closed' and
dz.devices(77).state == 'Closed' and dz.devices(80).state == 'Closed' and dz.devices(83).state == 'Closed' and dz.devices(86).state == 'Closed') then
luz.switchOff().afterSec(2)
dz.log('LOG: Vestidor apagado', dz.LOG_INFO)
end
end
}
Para cualquier duda o consulta tienes disponible el grupo de telegram «Domoticz a lo Spain» para entrar, ponerte cómodo y participar cuanto quieras.
Cualquier duda, sugerencia o comentario será bien recibida en la web!