Código: Seleccionar todo
-- ------------------------------------------------------------------------------------------------------------------
-- ℹ Inicialización de la configuración del switch (cambiar si es necesario)
-- ------------------------------------------------------------------------------------------------------------------
local myDevice = 114; -- Idx del Dispositivo o Dispositivos
local myDevice2 = 48;
-- ------------------------------------------------------------------------------------------------------------------
-- ℹ Iniciando el Script (No tocar si no es imprescindible)
-- ------------------------------------------------------------------------------------------------------------------
return {
active = true,
on = {
devices = {
myDevice, myDevice2
}
},
execute = function (domoticz, device)
local Sw1 = domoticz.devices(myDevice)
local Sw2 = domoticz.devices(myDevice2)
if device.active then
Sw1.switchOn().checkFirst().silent()
Sw2.switchOn().checkFirst().silent()
else
Sw1.switchOff().checkFirst().silent()
Sw2.switchOff().checkFirst().silent()
end
end
}