Problem with dead node and Alarm Script

Moderator: leecollings

Post Reply
candrea77
Posts: 32
Joined: Saturday 25 February 2017 18:42
Target OS: Linux
Domoticz version: 2021.1
Location: Milano, Italy
Contact:

Problem with dead node and Alarm Script

Post 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 ?
Sorry for any spelling mistake, English is not my native language.

DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post 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
The most dangerous phrase in any language is:
"We always done this way"
candrea77
Posts: 32
Joined: Saturday 25 February 2017 18:42
Target OS: Linux
Domoticz version: 2021.1
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post by candrea77 »

Hello,
device is not dead , but focus on real problem.

Can a "Dead node notification" trigger a device script ?
Sorry for any spelling mistake, English is not my native language.

DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
candrea77
Posts: 32
Joined: Saturday 25 February 2017 18:42
Target OS: Linux
Domoticz version: 2021.1
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post 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
Sorry for any spelling mistake, English is not my native language.

DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post 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
The most dangerous phrase in any language is:
"We always done this way"
candrea77
Posts: 32
Joined: Saturday 25 February 2017 18:42
Target OS: Linux
Domoticz version: 2021.1
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post 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 ....
Sorry for any spelling mistake, English is not my native language.

DomoticZ running on Ubuntu 20.04 LTS , dzVents Version: 3.1.7 , Python Version: 3.8.5
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Problem with dead node and Alarm Script

Post by emme »

milano SudEst, zona P.le Abbiategrasso

Ok.. allora avevo pensato la stessa cosa :P
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest