I had an alarmsystem working on Blockly. Recently I moved to DzVents. And I'm very happy with that move. But now I have something unexpected. One script won't trigger.
I have several scripts related to alarm. If there is an alarm (Alarm Home or Alarm Away) the dummy switches with the names 'Alarmsituatie Thuis', or 'Alarmsituatie Niet Thuis' are switched on. This is working well. But when one of these switches is turned on, I would expect some defined actions like I defined in below script. This script is turned On.
Code: Select all
return
{
on =
{
devices =
{
'Alarmsituatie Thuis',
'Alarmsituatie Niet Thuis',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
},
execute = function(dz)
local alarmt = dz.devices('Alarmsituatie Thuis')
local alarmnt = dz.devices('Alarmsituatie Niet Thuis')
local sirene = dz.devices('Sirene Studeerkamer')
local dialtone = dz.devices('BT-Play dialtone')
dz.log('Alarmsituatie Thuis, state: ' .. alarmt.state, dz.LOG_DEBUG)
dz.log('Alarmsituatie Niet Thuis, state: ' .. alarmnt.state, dz.LOG_DEBUG)
dz.log('Sirene Studeerkamer, state: ' .. sirene.state, dz.LOG_DEBUG)
dz.log('BT-Play dialtone, state: ' .. dialtone.state, dz.LOG_DEBUG)
if alarmt.state == 'On' then
sirene.switchOn().silent()
dz.log('Alarm Thuis geactiveerd, maar Sirene niet aan', dz.LOG_INFO)
dz.notify('Alarm', 'Alarm Thuis geactiveerd, maar sirene niet aan', dz.PRIORITY_HIGH, dz.SOUND_DEFAULT,nil, dz.NSS_TELEGRAM)
elseif alarmnt.state == 'On' then
sirene.switchOn().silent()
dz.notify('Alarm', 'niet Thuis geactiveerd, sirene aan!', dz.PRIORITY_LOW, dz.SOUND_DEFAULT,nil, dz.NSS_TELEGRAM)
dz.log('Alarm Thuis geactiveerd, Sirene aan!', dz.LOG_INFO)
dialtone.switchOn().silent()
end
end
}Do you see why this script is not triggered?
