[userModule] Niffler - An event notification updater

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
Post Reply
jensmoes
Posts: 57
Joined: 10 Jan 2015 21:48
Location: San Diego
Contact:

[userModule] Niffler - An event notification updater

Post by jensmoes » 07 Jun 2015 19:27

Last version 1.0.1: 2015-05-08
Tested with: v2.0.1-rc37
STATUS: Stable
Latest development: Github

Issue: Many switches don't send out an unsolicited report when they are pressed. This results in the HA and application UI's getting out of sync with the state of the switch. The reason for the lack of this feature is most often due to manufacturers electing not to pay Lutron for their patent related to this functionality.(Sending a command when a switch is pressed)

Solution: As a workaround many manufacturers send a Node Information Frame when a switch is toggled. This frame is not a command, so it does not violate the Lutron patent. It also does not contain any state information about the switch though.

Niffler (https://github.com/jensmoes/Niffler) will listen for these frames and query the device status
Due to the need for sending a status request, this workaround will cause a slight delay in the updates compared to a device that does support unsolicited reports.
It currently works for switches and door locks using the Alarm command class to report status changes.

Enjoy!

elmoray
Posts: 8
Joined: 09 Jun 2015 05:28

Re: [userModule] Niffler - An event notification updater

Post by elmoray » 09 Jun 2015 05:49

I am having an issue loading the Niffler module with the rc33. I get the following error: Cannot instantiate module: Niffler-master: TypeError: undefined is not a function. Any ideas on what is causing this?

jensmoes
Posts: 57
Joined: 10 Jan 2015 21:48
Location: San Diego
Contact:

Re: [userModule] Niffler - An event notification updater

Post by jensmoes » 09 Jun 2015 05:56

Looks like the folder name is incorrect. It should be Niffler.
Github names the zip "Niffler-master" when you download it. Just delete the -master part

elmoray
Posts: 8
Joined: 09 Jun 2015 05:28

Re: [userModule] Niffler - An event notification updater

Post by elmoray » 09 Jun 2015 06:10

That was it. The module works great! Thank you for all your work!

hp1
Posts: 22
Joined: 09 Jun 2015 07:00

Re: [userModule] Niffler - An event notification updater

Post by hp1 » 13 Jun 2015 04:12

I couldn't get it to work. I loaded it into the automation/userModules and I see it loads in the logs:

pi@raspberrypi /var/log $ cat z-way-server.log |grep -i nif
[2015-06-12 19:06:07.955] [core] Loading module Niffler from userModules/Niffler

however turning the device on locally, I refresh the razberry control devices, and don't see the state change. I click the update, the see it on. I turn it off locally and again don't see the state change. Click 'update' and it shows off.

jensmoes
Posts: 57
Joined: 10 Jan 2015 21:48
Location: San Diego
Contact:

Re: [userModule] Niffler - An event notification updater

Post by jensmoes » 13 Jun 2015 09:56

hp1 wrote:I couldn't get it to work. I loaded it into the automation/userModules and I see it loads in the logs:

pi@raspberrypi /var/log $ cat z-way-server.log |grep -i nif
[2015-06-12 19:06:07.955] [core] Loading module Niffler from userModules/Niffler

however turning the device on locally, I refresh the razberry control devices, and don't see the state change. I click the update, the see it on. I turn it off locally and again don't see the state change. Click 'update' and it shows off.


Did you add the devices you wish to Niffle in the smart home UI configuration? (If you are on rc33+ it will be under apps->Active->Niffler if logged in as an admin. Previous versions it will be in the widgets section I think it was called?)
You should see something like this in the log:

Code: Select all

[I] [core] Niffler: Niffling device  ZWayVDev_zway_6-0-38
for each of the devices you selected in the module config.

hp1
Posts: 22
Joined: 09 Jun 2015 07:00

Re: [userModule] Niffler - An event notification updater

Post by hp1 » 15 Jun 2015 05:59

Yup that did it! I now see local state changes:

[2015-06-14 19:49:59.416] [core] --- Starting module Niffler
[2015-06-14 19:49:59.438] [core] Niffler: init
[2015-06-14 19:49:59.456] [core] Niffler: Niffling device ZWayVDev_zway_2-0-38
[2015-06-14 19:49:59.462] [core] Niffler: getdeviceindex: ZWayVDev_zway_2-0-38
[2015-06-14 20:13:49.856] [D] [zway] RECEIVED: ( 01 15 00 49 84 02 0F 04 11 04 26 27 2B 2C 85 72 86 91 77 73 EF 82 B4 )
[2015-06-14 20:13:49.856] [D] [zway] SENT ACK
[2015-06-14 20:13:49.857] [zway] Node info received: 2
[2015-06-14 20:13:49.857] [D] [zway] SETDATA devices.2.data.basicType = 4 (0x00000004)
[2015-06-14 20:13:49.857] [D] [zway] SETDATA devices.2.data.genericType = 17 (0x00000011)
[2015-06-14 20:13:49.857] [D] [zway] SETDATA devices.2.data.specificType = 4 (0x00000004)
[2015-06-14 20:13:49.861] [D] [zway] SETDATA devices.2.data.deviceTypeString = "Multilevel Scene Switch"
[2015-06-14 20:13:49.861] [D] [zway] SETDATA devices.2.data.nodeInfoFrame = byte[12]
[2015-06-14 20:13:49.861] [D] [zway] ( 26 27 2B 2C 85 72 86 91 77 73 EF 82 )
[2015-06-14 20:13:49.861] [D] [zway] SETDATA devices.2.data.lastReceived = 0 (0x00000000)
[2015-06-14 20:13:49.872] [zway] Adding job: Basic Get
[2015-06-14 20:13:49.873] [D] [zway] SENDING (cb 0x2b): ( 01 09 00 13 02 02 20 02 25 2B C9 )
[2015-06-14 20:13:49.874] [D] [zway] RECEIVED ACK
[2015-06-14 20:13:49.877] [D] [zway] RECEIVED: ( 01 04 01 13 01 E8 )
[2015-06-14 20:13:49.878] [D] [zway] SENT ACK
[2015-06-14 20:13:49.878] [D] [zway] Delivered to Z-Wave stack
[2015-06-14 20:13:49.890] [D] [zway] RECEIVED: ( 01 05 00 13 2B 00 C2 )
[2015-06-14 20:13:49.890] [D] [zway] SENT ACK
[2015-06-14 20:13:49.891] [zway] Job 0x13 (Basic Get): Delivered
[2015-06-14 20:13:49.891] [D] [zway] SETDATA devices.2.data.lastPacketInfo.delivered = True
[2015-06-14 20:13:49.891] [D] [zway] SETDATA devices.2.data.lastPacketInfo.packetLength = 5 (0x00000005)
[2015-06-14 20:13:49.891] [D] [zway] SETDATA devices.2.data.lastPacketInfo.deliveryTime = 12 (0x0000000c)
[2015-06-14 20:13:49.892] [D] [zway] SETDATA devices.2.data.lastPacketInfo = **********
[2015-06-14 20:13:49.892] [D] [zway] SendData Response with callback 0x2b received: received by recipient
[2015-06-14 20:13:49.892] [D] [zway] SETDATA devices.2.data.lastSend = 17358389 (0x0108de35)
[2015-06-14 20:13:49.892] [D] [zway] Job 0x13 (Basic Get): success
[2015-06-14 20:13:49.892] [zway] Removing job: Basic Get
[2015-06-14 20:13:49.898] [D] [zway] RECEIVED: ( 01 0A 00 04 00 02 04 22 01 00 00 D4 )
[2015-06-14 20:13:49.898] [D] [zway] SENT ACK
[2015-06-14 20:13:49.898] [D] [zway] SETDATA devices.2.data.lastReceived = 0 (0x00000000)
[2015-06-14 20:13:49.898] [D] [zway] SETDATA devices.2.data.lastSend = 17358689 (0x0108df61)
[2015-06-14 20:13:49.899] [zway] Job 0x13 (Basic Get): Rejected by device application layer. Retrying after 3 seconds
[2015-06-14 20:13:50.824] [D] [zway] RECEIVED: ( 01 08 00 04 00 02 02 82 01 70 )
[2015-06-14 20:13:50.824] [D] [zway] SENT ACK
[2015-06-14 20:13:50.825] [zway] Got frame from device 2 to controller, but command class 0x82 is not implemented
[2015-06-14 20:13:50.825] [D] [zway] SETDATA devices.2.data.lastReceived = 0 (0x00000000)
[2015-06-14 20:13:53.052] [D] [zway] SENDING (cb 0x2b): ( 01 09 00 13 02 02 20 02 25 2B C9 )
[2015-06-14 20:13:53.054] [D] [zway] RECEIVED ACK
[2015-06-14 20:13:53.057] [D] [zway] RECEIVED: ( 01 04 01 13 01 E8 )
[2015-06-14 20:13:53.057] [D] [zway] SENT ACK
[2015-06-14 20:13:53.058] [D] [zway] Delivered to Z-Wave stack
[2015-06-14 20:13:53.070] [D] [zway] RECEIVED: ( 01 05 00 13 2B 00 C2 )
[2015-06-14 20:13:53.070] [D] [zway] SENT ACK
[2015-06-14 20:13:53.070] [I] [zway] Job 0x13 (Basic Get): Delivered
[2015-06-14 20:13:53.071] [D] [zway] SETDATA devices.2.data.lastPacketInfo.delivered = True
[2015-06-14 20:13:53.071] [D] [zway] SETDATA devices.2.data.lastPacketInfo.packetLength = 5 (0x00000005)
[2015-06-14 20:13:53.071] [D] [zway] SETDATA devices.2.data.lastPacketInfo.deliveryTime = 12 (0x0000000c)
[2015-06-14 20:13:53.071] [D] [zway] SETDATA devices.2.data.lastPacketInfo = **********
[2015-06-14 20:13:53.072] [D] [zway] SendData Response with callback 0x2b received: received by recipient
[2015-06-14 20:13:53.072] [D] [zway] SETDATA devices.2.data.lastSend = 17358697 (0x0108df69)
[2015-06-14 20:13:53.072] [D] [zway] Job 0x13 (Basic Get): success
[2015-06-14 20:13:53.072] [I] [zway] Removing job: Basic Get
[2015-06-14 20:13:53.077] [D] [zway] RECEIVED: ( 01 09 00 04 00 02 03 20 03 00 D0 )
[2015-06-14 20:13:53.077] [D] [zway] SENT ACK
[2015-06-14 20:13:53.077] [D] [zway] SETDATA devices.2.data.lastReceived = 0 (0x00000000)
[2015-06-14 20:13:53.077] [D] [zway] SETDATA devices.2.instances.0.commandClasses.32.data.level = 0 (0x00000000)
[2015-06-14 20:13:53.077] [D] [zway] SETDATA devices.2.instances.0.commandClasses.38.data.level = 0 (0x00000000)
[2015-06-14 20:14:13.181] [D] [zway] Job 0x13: deleted from queue

Post Reply