Page 1 of 1

Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 7:01
by candrea77
Hello,
this night I was wake up by my alarm script.

Now I'm checking the log and I found this issue :

Code: Select all

Mar 21 04:08:26 domoticzstable domoticz: OpenZWave: Received Node Dead notification from HomeID: 4081278406, NodeID: 82 (0x52)
Mar 21 04:08:26 domoticzstable domoticz: EventSystem: Script event triggered: AllarmeRileva
Mar 21 04:08:26 domoticzstable domoticz: 2017-03-21 04:08:26.457  (ZWAVE CONTROLLER) Light/Switch (PIR ALARM CUCINA2)
[/i]

Please note that NodeID: 82 is "PIR ALARM CUCINA2"

The script "AllarmRileva" is activated by Device event , and check for source device in order to know if trigger the "Siren".
Here you are a little part of the script :

Code: Select all

tc=next(devicechanged)
switch=tostring(tc)

if uservariables["AlarmActive"] ~= 0 and uservariables["AlarmDetected"] == 0 then
    if otherdevices['Domoticz Security Panel'] == 'Arm Away' then
        if (switch:sub(1,9) == 'PIR ALARM') then
	    	ScriveLog('PIR ALARM motion detected : '..switch)
	    	commandArray['Variable:AlarmDetected'] = '1'
        end
Is possibile that Dead notification can trigger the a "Device" activated script and false my alarm system ?

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 9:19
by emme
Ciao,
first of all... the device is really dead?
- Do you need to NOT consider it anymore? (trie dto simpli rename it with something different than 'PIR ALARM'... like 'PIRdALARM'.... mmh... it does not sounds good in italian :P :P)
- hail the ZWave network or go to the OZWCP and remove dead nodes... this will remove the device also

Dead nodes should not have inpact in the otherdevice (maybe even on the devicechanged, but check its last timestamp) tables.... but if the node dead in ON state.... it could be that it triggers your script

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 12:08
by candrea77
Hello,
device is not dead , but focus on real problem.

Can a "Dead node notification" trigger a device script ?

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 13:39
by candrea77
Sorry Emme ,
I haven't read your last phrase : Dead nodes should not have impact in the otherdevice (maybe even on the devicechanged, but check its last timestamp) tables.... but if the node dead in ON state.... it could be that it


I'll try to insert some Log and hope to don't have same problem anymore (but in case log some action)

In my code hadn't checked for "On" status : now I've added it!!!

Code: Select all

if uservariables["AlarmActive"] ~= 0 and uservariables["AlarmDetected"] == 0 then
    if otherdevices['Domoticz Security Panel'] == 'Arm Away' then
        if (switch:sub(1,9) == 'PIR ALARM') then
            ScriveLog("PIR STATUS : "..otherdevices[switch])
            if otherdevices[switch] == "On" then
                if uservariables["ManualAlarm"] == 0 then
	    	        ScriveLog('PIR ALARM motion detected : '..switch)
	    	        commandArray['Variable:AlarmDetected'] = '1'
	    	    end
	        end
        end

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 14:15
by emme
try also a:

Code: Select all

ScriveLog("PIR STATUS : "..otherdevices[switch].." Ultimo Aggiornamento: '..otherdevices_lastupdate[switch])
this would confirm if a dead node trigger the devicehanged table... (maybe the attempt to contact it works like an update)

...btw...
ScriveLog().... quite curios to see what's in this function and see the difference between the normal print()... but this is my own personal curiosity :P :P
ciao
M

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 14:56
by candrea77
ScriveLog is a simple fuction that before issue print command check for local debug variable.
if set to 1 then issue the print command, otherwise don't do nothing.

This night debug was set to 0 :D

Esattamente di dove sei ? Milano città o provincia ? Io sono in provincia di MB ....

Re: Problem with dead node and Alarm Script

Posted: Tuesday 21 March 2017 15:06
by emme
milano SudEst, zona P.le Abbiategrasso

Ok.. allora avevo pensato la stessa cosa :P