Page 1 of 1

False trigger?

Posted: 18 Oct 2015 11:26
by hannez82
Hi,

I'm having a magnet sensor connected to my razberry. Over night I've have som false triggers that I see in the log. However, I don't see these events in the razberry gui so for some reason the gui filters these but my code that binds to the event gets triggered.

Is there some feature in the device perhaps that send an "I'm alive" event with the current status?

The log below is from the false trigger and it does not show up in the gui.

[2015-10-18 06:15:54.413] [D] [zway] RECEIVED: ( 01 1E 00 04 00 03 18 98 81 F9 81 22 C4 FC 12 DC 0C 14 FE 4B F9 F5 7C 54 6A 69 81 C7 E8 B2 E8 35 )
[2015-10-18 06:15:54.413] [D] [zway] SENT ACK
[2015-10-18 06:15:54.413] [D] [zway] SETDATA devices.3.data.lastReceived = 0 (0x00000000)
[2015-10-18 06:15:54.413] [zway] Node 3:0 CC Security: Received a secure message
[2015-10-18 06:15:54.413] [D] [zway] SETDATA devices.3.instances.0.commandClasses.152.data.firstPart = **********
[2015-10-18 06:15:54.413] [zway] Node 3:0 CC Security: passing decrypted packet to application level: [ 8f 01 04 03 80 03 64 09 71 05 00 00 00 ff 06 16 00 05 31 05
03 01 01 06 31 05 01 0a 00 47 ]
[2015-10-18 06:15:54.413] [D] [zway] SETDATA devices.3.instances.0.commandClasses.128.data.history.100 = 1445141754 (0x56231cfa)
[2015-10-18 06:15:54.413] [D] [zway] SETDATA devices.3.instances.0.commandClasses.128.data.last = 100 (0x00000064)
[2015-10-18 06:15:54.414] [D] [zway] SETDATA devices.3.instances.0.commandClasses.113.data.6.eventParameters = byte[0]
[2015-10-18 06:15:54.414] [D] [zway] ( zero-length buffer )
[2015-10-18 06:15:54.414] [D] [zway] SETDATA devices.3.instances.0.commandClasses.113.data.6.event = 22 (0x00000016)
[2015-10-18 06:15:54.415] [D] [zway] SETDATA devices.3.instances.0.commandClasses.113.data.6.eventString = ""
[2015-10-18 06:15:54.416] [D] [zway] SETDATA devices.3.instances.0.commandClasses.113.data.6.status = 255 (0x000000ff)
[2015-10-18 06:15:54.416] [D] [zway] SETDATA devices.3.instances.0.commandClasses.113.data.6 = Empty

Re: False trigger?

Posted: 18 Oct 2015 15:29
by pofs
Whether there's such a feature, it depends on your device.

But the packet from the log looks like there is. The device sends battery level, alarm status, luminosity and temperature as one packet. It is hardly a coincidence.

Gui probably checks the "phantom update" flag on change type, and your code should too.

Re: False trigger?

Posted: 18 Oct 2015 20:47
by hannez82
I see,

I found some code :

Code: Select all

zway.devices[4].instances[0].SwitchBinary.data.level.bind(function(type)
{
   if (type !==1){
     return;
   }
Is this what you mean? I'm having trouble understand what the type-variable is. I've tried the code but sometime my magnet sensor sends 65 when it's a correct event. Very confusing.

Re: False trigger?

Posted: 18 Oct 2015 23:18
by pofs
Yes, it is. You may peek at type constants in ZWave module:

Code: Select all

this.ZWAY_DATA_CHANGE_TYPE = {
	"Updated": 0x01,       // Value updated or child created
	"Invalidated": 0x02,   // Value invalidated
	"Deleted": 0x03,       // Data holder deleted - callback is called last time before being deleted
	"ChildCreated": 0x04,  // New direct child node created

	// ORed flags
	"PhantomUpdate": 0x40, // Data holder updated with same value (only updateTime changed)
	"ChildEvent": 0x80     // Event from child node
};

Re: False trigger?

Posted: 19 Oct 2015 15:46
by hannez82
Ok thnx. It seems though that my pir-sensor from dlink always sends 65(DEC) as type and never 1. However it solved my problems regaring the magnet sensors.