triggerInfo.trigger for device change?
Posted: Wednesday 17 January 2018 13:19
Hi,
According to the dzVents wiki, triggerInfo.trigger only works for timer rules and for security state.
Is it possible to use this when devices changes also?
Check the example script below, is this possible?
According to the dzVents wiki, triggerInfo.trigger only works for timer rules and for security state.
Is it possible to use this when devices changes also?
Check the example script below, is this possible?
Code: Select all
return {
active = true,
on = {
security = {
domoticz.SECURITY_ARMEDAWAY,
domoticz.SECURITY_DISARMED,
},
devices = {
'$Alarm - Detekterat',
},
},
execute = function(domoticz, device, triggerInfo)
if (triggerInfo.trigger == domoticz.SECURITY_ARMEDAWAY) then
domoticz.devices('$Alarm - Delay Active').switchOn().forMin(1)
domoticz.devices('Siren').switchOn().forSec(1)
elseif (triggerInfo.trigger == domoticz.SECURITY_DISARMED) then
domoticz.devices('$Alarm - Siren Trigger').switchOff()
domoticz.devices('$Alarm - Detekterat').switchOff()
domoticz.devices('Siren').switchOff()
domoticz.devices('$Alarm - Delay Active').switchOff()
elseif (triggerInfo.trigger == '$Alarm - Detekterat') then
if (device.state == 'On') then
domoticz.devices('$Alarm - Siren Trigger').switchOn().afterSec(30)
domoticz.devices('Siren').switchOn().forSec(1)
end
end
end
}