Z-Wave Event and Alarm Listener (ZEAL)

Posted on
Wed Jan 04, 2017 5:43 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Z-Wave Event and Alarm Listener (ZEAL)

Download link

I'm making a new plugin that will listen for Z-wave alarms and notifications as well as battery reports. As I have a limited number of devices to test on, I'd appreciate feedback on how it behaves with different devices, as well as other feedback, before I proceed with the plugin.

Notification and alarm reports
Basically you can create triggers that will listen for notification and alarm reports for selected or all devices. Normally you won't know which notification reports the device will send, so the idea is that you can create inclusion filters for many or all notification reports, and then later on choose to exclude those you don't want to trigger on. There is no limit to the number of filters.
Skjermbilde 2017-01-05 kl. 00.27.06.png
Received notification trigger
Skjermbilde 2017-01-05 kl. 00.27.06.png (180.41 KiB) Viewed 4902 times


Battery reports
You will be able to make triggers for a set battery level or low battery report for selected or all devices.
Skjermbilde 2017-01-05 kl. 00.31.39.png
Received battery report trigger
Skjermbilde 2017-01-05 kl. 00.31.39.png (79.86 KiB) Viewed 4902 times


Good to know
  • Alpha test - features and setup may change at a later stage
  • There are some differences between early Z-wave alarm reports (version 1) and later notification reports (v2-v8). Alarm reports (version 1) is not implemented as trigger yet
  • To minimize load when commands are received, the plugin stores a list of indigo devices, refreshes every hour. Can be refreshed manually by reloading the plugin.
  • Triggers for battery level can be set not to repeat until reset (avoid spamming every time device reports battery level). The trigger can be reset automatically when above set battery level or manually through plugin menu item.

Planned features
  • Trigger for alarm report v1
  • Plugin action(s)
  • Possibly integration to my notification plugin, which will be updated
  • ++
Last edited by krissh on Thu Jan 05, 2017 1:29 pm, edited 1 time in total.

Posted on
Wed Jan 04, 2017 8:42 pm
matt (support) offline
Site Admin
User avatar
Posts: 18509
Joined: Jan 27, 2003
Location: Texas

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Great idea – thanks for sharing it!

Image

Posted on
Thu Jan 05, 2017 4:40 am
DaveL17 offline
User avatar
Posts: 4156
Joined: Aug 20, 2013

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Looks like a great plugin. I'll give it a whirl.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Jan 05, 2017 1:30 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Thanks for your comments.

v0.1.2 posted - small bugfix

Posted on
Thu Jan 05, 2017 2:18 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Usage examples

Trigger on battery level
Log output:
Code: Select all
   Z-Wave                          received "013 - Zipato keypad lyd" status update battery level 79%
   Trigger                         test zeal battery
   ZEAL Warning                    Received "Zipato keypad lyd" battery level below trigger threshold, battery level 79
(trigger level was set to 90% just to force the trigger)

Trigger for low battery report
Log output:
Code: Select all
   Z-Wave                          received "035 - Motion Sensor" status update battery level 0%
   ZEAL Debug                      received: 01 09 00 04 00 23 03 80 03 FF AE (node 035, endpoint None)
   ZEAL Debug                      Command class:      0x80 (Battery command class)
   ZEAL Debug                      Command:         3
   ZEAL Debug                      Battery level:      255
   ZEAL Debug                      Triggering trigger id 1565992738 "test zeal battery", node id 035, device "035 - Motion Sensor"
   Trigger                         test zeal battery
   ZEAL Warning                    Received "035 - Motion Sensor" low battery report
Note that Indigo incorrectly sets the battery level to 0%. The battery level is actually 50%, the battery level of 255 is reserved for "low battery report"

Fibaro dimmer 2, overload
Log output:
Code: Select all
   Z-Wave                          sent "Gang Bad" on
   Z-Wave                          received "Gang Bad" status update is off
   Trigger                         test zeal
   ZEAL                            Received "Gang Bad" notification report "Over-load detected", type 8, event 8


Fibaro dimmer 2, burnt out bulb detected
Log output:
Code: Select all
   Z-Wave                          sent "Gang Bad" set brightness to 60
   Z-Wave                          sent "Gang Ytter" set brightness to 60
   Trigger                         test zeal
   ZEAL                            Received "Gang Bad" notification report "Load error", type 8, event 9


Single trigger for all motion sensors (that supports notification reports)
Skjermbilde 2017-01-05 kl. 21.14.27.png
Skjermbilde 2017-01-05 kl. 21.14.27.png (79.79 KiB) Viewed 4774 times

Posted on
Sun Jan 15, 2017 5:54 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Released version 0.2.0, download link always in first post

Changes:
  • Possible to trigger on outgoing z-wave commands:
    • No ack from device
    • Slow ack from device
  • Information on trigger and triggering device can be stored to variables
  • Made it possible to reset/repeat low battery or battery level alarms after set number of hours (i.e. devices that continuously repeat low battery reports, not trigger every time), in addition to the previous automatic reset on battery replacement etc.
  • Added same reset/repeat logic to low battery reports as for battery level reports
  • Minor tweaks

Configuration of variables is done in plugin config:
Skjermbilde 2017-01-16 kl. 00.48.52.png
Skjermbilde 2017-01-16 kl. 00.48.52.png (57.71 KiB) Viewed 4611 times


Trigger for outgoing z-wave commands:
Skjermbilde 2017-01-16 kl. 00.52.29.png
Skjermbilde 2017-01-16 kl. 00.52.29.png (46.22 KiB) Viewed 4611 times


As for the other trigger types, you can choose to trigger for all devices or selected devices.

Posted on
Mon Jan 16, 2017 3:37 am
yassi offline
Posts: 348
Joined: Sep 06, 2015
Location: Germany

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Cool, thank you!

Posted on
Mon Jan 16, 2017 6:14 am
DaveL17 offline
User avatar
Posts: 4156
Joined: Aug 20, 2013

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

This seems to be working too well! :D I woke up this morning to a bevy of No Ack triggers--only one of them is a true No Ack.

I think that the default trigger time of 300ms is too short for my network (Z Stick Gen 2) so I've upped the limit to 1000ms. This is still going to give me false No Ack triggers as my record (so far) is an Everspring Illumination Sensor with a response time of 7330ms. Seems silly, but I may have to up the plugin limit to 10000ms.

Alternatively, a potential enhancement to the plugin would be an ability to exclude devices from the trigger (I realize I can include all devices *except* the ones I want to exclude, but that would require going back and updating the plugin configuration every time a change is made to the network).

Thanks for the great plugin!
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jan 16, 2017 6:32 am
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Yes, I'm getting quite a few myself :D

In my network, I see that I typically get ~60 ms when controlling a single device, however turning off all lights in living room etc. causes some traffic on the network and the response time will typically be 2-300 ms or up to ~700 for the farthest devices.

I think that this trigger on "slow ack" could/should be used more as a diagnose tool to identify devices with poor reception etc.
The "no ack" trigger is probably more useful as it is now.

However, I have some plans for integrating this with my notification plugin, which I think will make also the "slow ack" more usable. What I'm planning is to make an option for sending periodic summary reports from the notification plugin, rather than instant notifications/e-mails.

The way I'm planning it is that you can make triggers with an action to the notification plugin. These will not be sent immediately, but when next summary report is sent. This way you should, for example, be able to get a list of slow responding devices etc. once a day or week instead of a lot of notifications.

The option to exclude devices is a good idea, I'll add that, as it should be quite easy to do :)

Posted on
Mon Jan 16, 2017 9:16 am
DaveL17 offline
User avatar
Posts: 4156
Joined: Aug 20, 2013

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

That's a good point. I've shut off the slow trigger for now to focus on No Ack and will turn on more features a bit more slowly this time. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jan 17, 2017 11:58 am
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

It seems that in cases where a sent Z-wave command fails, and Indigo immediately re-sends the command, which is then successful, Indigo won't report the first command as unsuccessful. The only command received by the plugin's zwaveCommandSent method is the last sent, successful one. Meaning I can't trigger on missing acknowledge if the re-send is successful.

Example:
Code: Select all
   Z-Wave Error                    no ack/nak/busy reply (021) for setMultiLevelValue (re-sending)
   Z-Wave                          sent "Gang Ytter" off
   ZEAL Debug                      sent: 01 0E 00 13 15 07 60 0D 01 01 26 01 00 25 10 8F (node 021 ACK after 66 milliseconds)


The only command reported to the plugin is the successful one with ack after 66 milliseconds.

Posted on
Wed Jan 18, 2017 2:40 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Some updates:

v0.2.1
  • Custom Z-wave device list in event dialogs -> Only one Indigo device per Z-wave node (one z-wave device may normally have multiple Indigo devices)
  • Possible to choose to trigger for all but selected Z-wave devices (exclude)

The limited device list was necessary for being able to exclude devices in triggers. As some Z-wave devices have 5-6 Indigo devices, all would have to be excluded etc.. There is some logic in the plugin attempting to figure out the "main" Indigo device for each z-wave node. So the device listed in the UI dialogs is the one the plugin finds as the "main" device. Please let me know how that works for your devices.

v0.2.2
  • Rough table print of z-wave node statistics to indigo log

I'll be working a bit more on the format of the table, column ordering, header names, sorting etc. but please do test it :) It will produce a table similar to this:
Code: Select all
  Node    maxAckTime    notification    avgAckTime    batteryReport    slowAck    noAck    minAckTime    in  Device                  out
------  ------------  --------------  ------------  ---------------  ---------  -------  ------------  ----  --------------------  -----
    24          1090              12      47.3333                 2          0        0             0    36  Dorsensor 1              24
    25             0               0       0                      0          0        0             0    40  Vaskerom                  0
    26            19               0      15.1154                 0          0        0            15   689  Bad                      26
    20          3709               0     101.952                  0          1        0            33   465  Gang Bad                166
    21          4765               0     167.122                  0          9        0            63   444  Gang Ytter              181
    23           118               0      68                      0          0        0            65    93  Soverom                  16
    28           120              13       1.81818                1          0        0             0   140  Bad bevegelse            22
    29             0               0       0                      0          0        0             0    41  Litjrom                   0
     3           527               0      49                      0          0        0            16    86  Stue Lyskuler            59
     5             0               0       0                      0          0        0             0   682  Gang Bevegelse            0
     6             0               0       0                      0          0        0             0   712  Stue Bevegelse            0
    11            18               0       0                      2          0        0             0    23  Flood Sensor (ST812)     23
    13           116               0       1.76                  25          0        0             0    50  Zipato keypad lyd        25
    15          5281               0     248.095                  0          7        0             1   370  Gang Soverom            158
    14           336               0      17                      0          0        0            16   232  Stue Downlights          74
    17          2986               0     461                      0          7        0            19   739  Kjokken Benkelys         58
    16           903               0      85                      0          0        0            17   164  Kjokken                  61
    19             0               0       0                      0          0        0             0    42  Treningsrom               0
    18            70               0      66.6667                 0          0        0            64    80  Kontor                   12
    35           274               0      15.5833                 2          0        0             0   117  035 - Motion Sensor      24
    34          1556               0     303                      0          1        0            65     0  Stue Lampe               17
    33          1273               0     142.384                  0          0        0            15   119  Aeotec RGB               73

Posted on
Sun Jan 22, 2017 5:08 pm
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

v0.3.0 released:
  • Better formatting and order for z-wave node statistics table
  • Action for statistics table added :
    • Can be sent as e-mail or output to indigo log
    • Supports device and variable substitution
    • When using Better E-mail plugin (> v7.1.0), e-mail can be sent in HTML format for better looking table. Need to enable this in plugin preferences and select a Better Email SMTP device for sending
    • Custom selection of columns to include
    • Selectable column to order by
    • Can set custom default value where stats are missing

The Better Email plugin was just updated with HTML e-mail support minutes ago, so this needs to be updated to use this feature.

The table looks like this:
Code: Select all
  Node  Device                  In    Out    OutNoReply    Notif.Rep.    Batt.Rep.    NoAcks    SlowAckTrigs.    AckMin.    AckMax    AckAvg
------  --------------------  ----  -----  ------------  ------------  -----------  --------  ---------------  ---------  --------  --------
     3  Stue Lyskuler          109     68             1             .            .         .                .         16       514        67
     5  Gang Bevegelse         749      .             .             .            .         .                .          .         .         .
     6  Stue Bevegelse        1049      .             .             .            .         .                .          .         .         .
    11  Flood Sensor (ST812)    28      2            26             .            2         .                .         17        17        17
    13  Zipato keypad lyd       28      .            28             .            .         2                .          .         .         .
    14  Stue Downlights        240     71             .             .            .         .                .         15      1297       101
    15  Gang Soverom           495    203             .             .            .         .                7         64      5802       281
    16  Kjokken                205     71             .             .            .         .                .         16       223        39
    17  Kjokken Benkelys      1028     71             .             .            .         .                5         67      2635       331
    18  Kontor                  55      .             .             .            .         .                .          .         .         .
    19  Treningsrom            104     16             .             .            .         .                .         65       270        80
    20  Gang Bad               605    224             .             .            .         .                3         65      3243       161
    21  Gang Ytter             590    224             .             .            .         .                3         64      5020       216
    23  Soverom                105     14             .             .            .         .                .         65        71        68
    24  Dorsensor 1             42      2            28            12            2         .                .         70       118        94
    25  Vaskerom               113     16             .             .            .         .                .         15       572        55
    26  Bad                   1049     64             .             .            .         .                .         15       478        25
    28  Bad bevegelse          210      2            28            33            2         .                .        223       271       247
    29  Litjrom                 55      .             .             .            .         .                .          .         .         .
    33  Aeotec RGB             110    101             .             .            .         .                1         15      1518       134
    34  Stue Lampe               .     21             .             .            .         .                .         34      1196       232
    35  035 - Motion Sensor    148      2            27             2            2         .                .        225       274       250


Explanation to the columns:
In: Number of received Z-wave commands
Out: Number of sent Z-wave commands where Indigo was expecting a reply
OutNoReply: Number of sent Z-wave commands where Indigo was not expecting a reply
Notif.Rep.: Number of received notification reports from the device
Batt.Rep.: Number of received battery reports from the device
NoAcks: Number of sent z-wave commands with no acknowledge
SlowAckTrigs.: Number of times the plugin has triggered on slow ack for the device
AckMin: Minimum ack time for the device
AckMax: Maximum ack time for the device
AckAvg: Average ack time for the device (for sent commands where Indigo was expecting a reply)

The table can be output to log from the plugin menu or from a customizable action:
Skjermbilde 2017-01-23 kl. 00.03.06.png
Skjermbilde 2017-01-23 kl. 00.03.06.png (105.21 KiB) Viewed 4319 times


By default it will send plain text e-mails, for which the table will not look very good. If enabling Better E-mail in ZEAL plugin prefs, HTML e-mails with better looking tables can be sent:
Skjermbilde 2017-01-23 kl. 00.04.27.png
Skjermbilde 2017-01-23 kl. 00.04.27.png (109.44 KiB) Viewed 4319 times


The node statistics can be reset from plugin menu or from an action that can be triggered periodically etc.

Posted on
Tue Feb 07, 2017 2:11 am
Albatros offline
Posts: 126
Joined: Feb 07, 2015

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Thanks for this great plugin.


When I want to "Reset All Z-wave node statistics" It does not reset and I see this error in the log file.


ZEAL Error Error in plugin execution UiAction:

Traceback (most recent call last):
TypeError: resetNodeStats() takes at most 2 arguments (3 given)

Posted on
Tue Feb 07, 2017 5:10 am
krissh offline
Posts: 102
Joined: Nov 18, 2012
Location: Norway

Re: Alpha test: Z-Wave Event and Alarm Listener (ZEAL)

Hi,

I believe this is fixed, but I hadn't released the code yet, as there is one issue I wanted to fix first. I've just released 0.3.1 where the reset should work. Since I'm away for at least 10 more days, I don't think I'll be able to fix the remaining issue, so you should be aware:
The ZEAL plugin checks at startup whether or not the Better Email plugin is running. If you have chosen to use the Better Email plugin, and during Indigo restart the ZEAL plugin is loaded before Better E-mail plugin, this option will be disabled and have to be re-enabled. I will change this to check a few times before giving up in next release

Who is online

Users browsing this forum: No registered users and 2 guests

cron