www.homeseer.com    
 

Go Back   HomeSeer Message Board > Ultilities (Plug-ins) > Utilities Discussion > SDJ-Health Plug-in (3P)

Reply
 
Thread Tools Display Modes
  #1  
Old December 27th, 2016, 11:43 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Plugin to monitor Z-Wave battery device Health - CLOSED

Edit - This thread is now closed refer to the sub-forum for new information

Edit - Current version is attached to message #241 of this thread(page 13)

If anybody is interested I've written a Health Plugin to monitor Z-Wave battery powered devices and report when they lose contact. It'll be free as it's primarily written for my own use, but if anyone thinks it might be useful then reply here and I will post the plugin.

I find battery reporting pretty hit and miss for Z-Wave devices and the level at which they die is inconsistent. Up until now I had been using a log monitor plugin to check for wakeup calls but this required 2 events and a timer setting up for each device, with each configured for the particular wakeup period of that device. The purpose of the Health plugin is to automate the process and only require 1 event in total for all notifications whilst adapting automatically to any additions or changes to devices.

When it first runs, the plugin creates a Parent device for monitoring. The plugin then monitors wake up calls in the log and each time a new device wakes up a child device is created and added to the group. The sleep period is set by subsequent wakeups of the device and from then on the plugin can watch for missed wakeups. There is no user intervention required although there are various parameters that can be tweaked.

Any failed wakeups are reported to the parent device so all devices found can be monitored by a single event triggered by the Parent device. The Parent Device string shows the device that has failed so this can be reported in say an email or pushover message. I’ve replaced 11 timers and 22 events by a single event in my system.

The attached screen shot shows part of my group with a failed device shown.

Steve
Attached Images
 

Last edited by SteveMSJ; September 30th, 2017 at 05:51 AM.
Reply With Quote
  #2  
Old December 27th, 2016, 05:43 PM
Fischi Fischi is offline
Seer Master
 
Join Date: Oct 2012
Location: Germany
Posts: 518
Smile

Hi Steve,

I'm very interested.

Regards, Fischi
Reply With Quote
  #3  
Old December 27th, 2016, 06:24 PM
eole's Avatar
eole eole is offline
Seer Deluxe
 
Join Date: Sep 2006
Location: France
Posts: 169
Hi Steve,
Nice idea. I'm interested too.
Thanks.
Yves
__________________
HS 3.0.0.318 Pro virtualized
Plugins & Scripts : APCUPSD, BLBackup, BLLan, Device History, HSTouch, IPX800, IRTrans, NetCam, PHLocation, ProgTV, Reveils, RFXCOM, SNCF, UltraCID3, Z-Wave, 1-Wire, WhoIs, EasyTrigger, RaspberryIO
HW : HPN54L with Esxi 5.5,
RFXCom LAN, IRTrans LAN+USB, USBModem, Oregon Scientific Sensors, 1-Wire, IPX800, Z-Wave devices
Reply With Quote
  #4  
Old December 27th, 2016, 06:25 PM
waynehead99 waynehead99 is offline
Super Seer
 
Join Date: May 2015
Location: Colorado
Posts: 1,974
Yes, this looks very nice. Please post plugin
Reply With Quote
  #5  
Old December 27th, 2016, 06:54 PM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,808
yep me to.

Greig.
__________________
Zwave = Z-Stick, 3xHSM100™ 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts =
Various
Reply With Quote
  #6  
Old December 27th, 2016, 07:07 PM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Ok. I'll post it in the morning.
Steve
Reply With Quote
  #7  
Old December 28th, 2016, 06:23 AM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
*UPDATE* 11/03/17
More advanced beta version added at message #192 of this thread

*UPDATE* 13/02/17
Latest version (3.0.2.8)
Bug Fix - Error message in log when more than one wakeup message within refresh interval.

*UPDATE* 12/02/17
Latest version (3.0.2.7) attached to this message. Now can handle devices such as ZSmokes which don't send wakeup, can't be polled but send a Heartbeat. I say 'such as ZSmokes' but so far these are the only devices I have come across that send a Heartbeat so it may or may not work with similar devices. Thanks to TechFan for testing and feedback on this feature.

Release notes for 3.0.2.7 (since 3.0.2.1)
-Minor and major bug swatting.
-Heartbeat monitoring added. Plugin now supports three methods of monitoring that a ZWave battery device is alive or dead>
a) Monitoring wakeup messages - Automatic
b) Polling of battery devices that don't send wakeups - Devices need to be selected from a list of Available Devices
c) Monitoring Heartbeats - Automatic (if option set to True)
-Location and/or Location2 can optionally be included in the displayed name of monitored devices to make them easier to identify, depending on your naming convention.
-The Location and/or Location2 defaults can be set to blank in which case when a monitoring child is created it will adopt the locations of the device it is monitoring rather than a defined value. There are also buttons to rebuild the child devices so that ones that have already been created can be relocated.
-The displayed information in the Health Root device can be configured by control buttons to Status Only, Short Report or Full Report. Anything other than Status Only may not fit in the web page display but work well when included in an email, notification message or HSTouch textbox.
I have updated the instructions in this message below.
I am now working on a more fully featured version of the plug-in which should add battery level, discharge rate and life monitoring as well as adding the ability to override settings for individual monitoring devices where required.

*UPDATE* 13/01/17
Update - Latest version (3.0.2.1) now attached to this message, handles multiple networks and can monitor listening (non sleeping) battery devices by simulating wake-ups.
*UPDATE* 02/01/17
Multiple network version coming soon.
*UPDATE* 31/12/16
NOTE the current version only works with single networks. It won't work with multiple networks with duplicate node numbers at the moment.
*UPDATED* 30/12/16
OK. I’ve attached a zip file with the latest version 3.0.1.7.

**NOTE – This should be treated as a beta so backup your full HS3 installation before installing it. There shouldn’t be any damage it can do but it’s always wise to be safe.**

Installation only requires ‘HSPI_SDJHealth.exe’ putting in the root folder of your HS3 installation. You should then be able to enable the plugin from the Plug-Ins>Manage page. No other files are required. It will create an INI file in the ‘Config’ folder but there is also a Config page in the plugin for tweaking parameters.
To update, disable the plugin then replace the HSPI_SDJHealth.exe file with the new version and re-enable the plugin.

IMPORTANT – It is also necessary to have ‘Log Poll and Wake-up Messages’ checked in ‘Plugins>Z-Wave>Z-Wave Network and Options’. I haven’t found anyway of detecting Z-Wave wakeups other than by monitoring the log.

Shortly after enabling, the plugin will create a parent device called ‘Health Root’. This is the device to use as a trigger for any notification events you want to create.

For ZWave battery powered devices that normally sleep, the plugin monitors the log and as wake-up notifications are reported child devices are created, grouped with the ‘Health Root’ parent. Initially the status of the device will show as ‘Waiting’. The second time a device wakes the sleep period will be set and the status will change to ‘Ok’. Over time a full set of child devices will be created corresponding to all Z-Wave devices in your system that report wake-ups. If you add devices to your system the plugin will pick them up the first time they wake. If you remove a device from your system the corresponding child will be removed on a restart of the plugin or you can delete the child manually.

The sleep period is updated on every wakeup, so if you change the sleep settings for a device the plugin will adapt.

At regular intervals the plugin checks the status of all the child devices and if any have missed a wakeup, by more than a set amount, the status of the child will change to ‘Wakeup Missed!’ The status of the parent ‘Health Root’ will also be set and the device that failed will be shown in the status string. The information that is displayed in the Root Device can be changed by the control buttons on the root device:
Status Only - This just gives the number of devices monitored and how many are in each state.
Short Report - Global Status plus a report on each device that is showing an alert.
Full Report - Global Status plus a report on each monitored device.

To report, trigger an event on the ‘Health Root’ device using ‘This device has a value set to..’ ‘Missed Wakeup’. If you include the replacement variable $$DTR:###: (change ### to the Ref of your ‘Health Root’ device) the full text string of the root device, formatted as Status Only, Short Report or Full Report can be included in an email or pushover notification. You can also display this information in an HSTouch scrolling textbox. Remember that you can swap between the different formats of report from event actions as well as manually.

The plugin can also monitor battery devices that are 'Listening', i.e. don't sleep and don't therefore send wake-up notifications. These devices have to be manually selected but the plugin will then poll them at regular intervals and log a simulated wake-up notification if they are alive. They will then be monitored the same way as 'Non Listening' devices.

The plugin can also monitor battery devices that don't send wakeups, aren't pollable but send Heartbeats, e.g. ZSmokes. Note this has only been tested on ZSmokes. You need to set MonitorHeartbeats to True to start this. The plugin will monitor device changes and if it detects an 'Alarm Heartbeat' it will create a monitoring child device. Device Callback are such that HS3 only notifies the plugin if a devices value changes, not if it is set to the same value. The ZSmokes don't reset the 'Alarm Heartbeat' value and therefore the plugin creates a new Status Pair (11.355,Heartbeat Acknowledged) as long as there is not already a status pair set for this value. Each time the plugin detects an 'Alarm Heartbeat' it sets the value to 'Heartbeat Acknowledged' so that it will get a callback when the ZSmoke sends the next 'Alarm heartbeat'.

Parameters that can be set from the ‘Config’ page of the plugin:

RefreshInterval – (default 120 seconds, i.e. 2 minutes) The interval in seconds that the plugin runs a check on the status of all the monitored devices. The plugin doesn’t have much overhead but there is little point in setting this very short.

MissedWakeFactor - (default 0) If you want to allow 1 or more missed wakeups set this to 1 or more.

OverRun – (default 60 minutes) The time in minutes beyond a scheduled wakeup before a ‘Missed Wakeup’ is triggered.
If MissedWakeFactor>0 then the actual time allowed before a 'Missed Wakeup' is triggered is (The Last Sleep Period) x (MissedWakeupFactor+1) + Overrun.

NameDeviceBy - Use the name of the 'Root' or 'Battery' child device when reporting on and naming monitoring devices.

Location and Location2 – defaults used when the plugin creates new monitoring devices. Select blank for either of these values if you want the monitoring child to adopt the Location and or Location2 of the devices it is monitoring.

There are buttons to Rebuild and Rename any child monitoring devices that have already been created.

IncludeLocInNames - Ticking this will include the Location of the monitored device in the reports.
IncludeLoc2InNames - Ticking this will include the Location2 of the monitored device in the reports.

ShowDeviceAddress - Controls whether the device Technology Address is shown in addition to the name in the reports. Depending on your particular naming convention and use of floors, rooms, etc it may or may not be helpful to display the address as well. Originally this was On but now that you can incorporate Location and or Location2 in the name it isn't usually necessary.

MinWakePeriod – (default 10 secs) It maybe a bug in HS3 but I sometimes get multiple wakeups reported in the log for a device,
usually all on the same second. This ignores them otherwise the plugin will think the device has a very short SleepPeriod.

LogLevel – (default 1) Setting to 0 will reduce log reporting to Errors only. Setting to 2 will produce a lot of log messages useful for debugging.

THE FOLLOWING PARAMETER SHOULD BE USED WITH CAUTION
ForceBackToRoot – (default False) I find that for some devices the root loses its ‘Parent’ status which is changed to ‘Standalone’ on reboots of HS3 (or restarts of the ZWave plugin). This may be an HS3 bug or a device firmware issue. I used to notice it on my StellaZ radiator valves but I have noticed it on one or two other devices as well. Normally the only effect is that the parent doesn’t show grouped with its children in the ‘Device Management’ page. This plugin monitors root devices even if they have incorrectly had their status set to 'Standalone' so there is no need to use this parameter. However, if you set ‘ForceBackToRoot’ to true then once a device is being monitored the Plugin will change its relationship status to ‘Parent_Root’ even if HS3 reboots and changes it back to ‘Standalone’. The benefit is that the Parent and Child devices will show correctly grouped in the 'Device Management' window. HOWEVER, I don't know whether there are any other implications with changing this status, so use at your own risk.

Devices Require Polling - This section is used if you need/want to monitor battery devices that are always listening and don't therefore raise wake-up notifications. An example is my Everspring Siren and many locks. Click on the 'Select Devices' button and a selector widget opens with a list of devices on the left which can be added. This list is made up of all root devices which have a battery child that claims to be pollable. 'Non Listening' devices shouldn't appear in the list as they should report as non-pollable. You definitely don't want to add a 'Non Listening' device to be polled by the plug-in. There are many devices that can be battery powered or usb powered and these will be in the list even if they are running from usb power. You don't want to add these to 'selected devices', although you can if you like and they will be monitored. I can't determine whether they are running on batteries or not so they are all in the list. Move devices into the 'Selected Items' list that you want to monitor by polling, then press the 'Submit' button. The devices should then show in a list next to the 'Select Devices' button. This is all a bit clunky and I've struggled with some issues with the HS jQuery controls but it works of a fashion. One day I will revisit this and clean it all up.

PollingInterval - This is affectively the simulated wake-up period. From my experience polling with Z-Wave takes a couple of seconds, if a device is awake, or up to 10 seconds if the device is dead. I don't know what the impact is on the system but it's best to keep polling fairly infrequent. If you have selected several devices their polling will be spread out over the polling interval so they aren't all polled at the same time. For example if the PolingInterval is 60 minutes and you have 4 devices selected each will be staggered by 15 minutes.

When a device is successfully polled it is processed by the plugin in a similar way to a wakeup.

NOTE A child monitoring device will not be created until the first successful poll so if you select 1 device and a PollingInterval of 60 minutes it will be 60 minutes before the device is polled and a monitoring child created. Be patient.

MonitorHeartbeats - If you tick this then the plugin will register with HS3 for callbacks on device value changes. Firstly it checks through all ZWave devices for any that have a status of "Alarm Heartbeat". For any that are found the value is changed so that when the device sets a new 'Alarm Heartbeat' a devicevalue change is called. The Plugin then watches for devicevalue changes to 'Alarm Heartbeat' and these are processed in a similar way to a wakeup. A child monitoring device will not be created until after the first Heartbeat is received. On ZSmokes the value for Alarm heartbeat' is 11.255. After detecting as heartbeat the plugin sets the displayed value to 11.355 so it can detect the next Heartbeat. It uses this value rather than 0-'No Notifications' so that it doesn't intefear with any events you may have set up for your device which alert you when a real alarm event has ended. As long as there is no existing status pair for 11.355 then the plugin will set one up with a status of 'Heartbeat Acknowledged'.

My system is windows 10 based but I briefly tested the plugin on linux and it appears to run with no problems.

Feedback welcomed.

Steve
Attached Images
  
Attached Files
File Type: zip SDJ-Health 3-0-2-8.zip (33.4 KB, 164 views)

Last edited by SteveMSJ; March 11th, 2017 at 05:23 AM. Reason: Updated version
Reply With Quote
  #8  
Old December 28th, 2016, 09:23 AM
waynehead99 waynehead99 is offline
Super Seer
 
Join Date: May 2015
Location: Colorado
Posts: 1,974
Thanks Steve. I will work to get this installed today.
Reply With Quote
  #9  
Old December 28th, 2016, 09:31 AM
ServiceXp's Avatar
ServiceXp ServiceXp is offline
Seer Master
 
Join Date: May 2015
Location: USA
Posts: 812
Would love to see other battery devices (non - Z-wave) added.
__________________
RJ_Make On YouTube
Reply With Quote
  #10  
Old December 28th, 2016, 11:17 AM
denisl denisl is offline
Seer Deluxe
 
Join Date: Dec 2014
Location: New Jersey
Posts: 330
Just installed on Linux. Waiting for devices to report in but installation was simple. Thanks for sharing this. Very helpful.
__________________
-Denis
HomeSeer Version: HS3 Pro Edition 3.0.0.383
Linux Ubuntu 14.04 ESXi 5.5 VMware, Z-NET (3.0.1.144)
Plugins: BLBackup, BLLAN, BLOccupied, EasyTrigger, HSTouch, Nest, PHLocation, Pushover 3P, UltraWeatherWU3, UltraNetCam3
Reply With Quote
  #11  
Old December 28th, 2016, 11:51 AM
sparkman's Avatar
sparkman sparkman is offline
OverSeer
 
Join Date: Oct 2001
Location: Calgary, Alberta, Canada
Posts: 6,001
Thanks for posting Steve! Have it running for a few hours and it's picked up about half my battery powered devices so far. Are there any issues with renaming the child devices the plugin has created?

Thanks
Al
__________________
HS3Pro 3.0.0.318 on Jetway JBC501F9Q-Q87-B i7 8GB 1874 Devices, 955 Events, 28 Plugins
Z-Wave 3.0.1.131 Z-Net 105 nodes:Leviton Vizia,Kwikset,FortrezZ Valve/Sensors,Everspring Sensors/Modules/Outlets,CT30 Stats,MIMOLites,Aeotec Smart Switches
RFXCom W800,RFXrec433,RFXtrx433|APCUPSD|Pushover|Squeezebox|weatherXML|HS Phone W2C|APCUPSD|UltraLog
UltraGCIR GC-100|UltraNetcam|UltraPioneer|Ultra1Wire|DSC PC1832|BLLED|BLTVGuide|ImperiHome|jon00 Utilities|MySensors

PHLocation|X10 CM11A IOLinc,etc
Reply With Quote
  #12  
Old December 28th, 2016, 12:06 PM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Quote:
Originally Posted by sparkman View Post
Thanks for posting Steve! Have it running for a few hours and it's picked up about half my battery powered devices so far. Are there any issues with renaming the child devices the plugin has created?

Thanks
Al
You can rename child devices as you like. The plugin keeps track based on the reference ID only.

Steve
Reply With Quote
  #13  
Old December 28th, 2016, 12:09 PM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Quote:
Originally Posted by ServiceXp View Post
Would love to see other battery devices (non - Z-wave) added.
That might be a possibility but it would depend on whether the devices issue some kind of regular signal/heart beat that a plugin could react to.

Steve
Reply With Quote
  #14  
Old December 28th, 2016, 12:17 PM
denisl denisl is offline
Seer Deluxe
 
Join Date: Dec 2014
Location: New Jersey
Posts: 330
Steve do you have the status icons available?
The green heart or red exclamation point?
__________________
-Denis
HomeSeer Version: HS3 Pro Edition 3.0.0.383
Linux Ubuntu 14.04 ESXi 5.5 VMware, Z-NET (3.0.1.144)
Plugins: BLBackup, BLLAN, BLOccupied, EasyTrigger, HSTouch, Nest, PHLocation, Pushover 3P, UltraWeatherWU3, UltraNetCam3
Reply With Quote
  #15  
Old December 28th, 2016, 12:21 PM
MrMxyzptlk MrMxyzptlk is offline
Seer Deluxe
 
Join Date: Aug 2015
Location: Peachtree City, GA
Posts: 478
Cool plugin...thank you!

All my Insteon door sensors report.
Reply With Quote
  #16  
Old December 28th, 2016, 12:58 PM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Quote:
Originally Posted by denisl View Post
Steve do you have the status icons available?
The green heart or red exclamation point?


They are standard Homeseer status icons I reference so they should show up without having to install anything additional.
Steve
Reply With Quote
  #17  
Old December 28th, 2016, 01:55 PM
denisl denisl is offline
Seer Deluxe
 
Join Date: Dec 2014
Location: New Jersey
Posts: 330
Ok I may need to update HS3. After the second poll I got the green heart on one of the devices. All good. Thanks
__________________
-Denis
HomeSeer Version: HS3 Pro Edition 3.0.0.383
Linux Ubuntu 14.04 ESXi 5.5 VMware, Z-NET (3.0.1.144)
Plugins: BLBackup, BLLAN, BLOccupied, EasyTrigger, HSTouch, Nest, PHLocation, Pushover 3P, UltraWeatherWU3, UltraNetCam3
Reply With Quote
  #18  
Old December 28th, 2016, 02:09 PM
SteveMSJ SteveMSJ is offline
Seer Master
 
Join Date: Jan 2012
Location: UK
Posts: 786
Quote:
Originally Posted by denisl View Post
Ok I may need to update HS3. After the second poll I got the green heart on one of the devices. All good. Thanks
Both the windows and linux versions I tested the plugin on had the icons. I'm running 3.0.0.300 on windows. For linux I downloaded and set up a trial with, I think, the same revision as windows.

The actual icon file names are:
/images/HomeSeer/status/alarm.png
/images/HomeSeer/status/clockwise-start.png
/images/HomeSeer/status/alarmheartbeat.png

Steve
Reply With Quote
  #19  
Old December 28th, 2016, 03:00 PM
bebaldin bebaldin is offline
Seer Deluxe
 
Join Date: Mar 2016
Location: Illinois
Posts: 471
Quote:
Originally Posted by denisl View Post
Just installed on Linux. Waiting for devices to report in but installation was simple. Thanks for sharing this. Very helpful.
Installed on my SEL about 7 hours ago but so far nothing is showing on it at all. Several of the battery devices have updated since the install. Not sure why it isn't creating any devices.
Reply With Quote
  #20  
Old December 28th, 2016, 03:06 PM
DSteiNeuro DSteiNeuro is offline
Seer Master
 
Join Date: Jan 2001
Location: Audrey Land (Somewhere near San Diego CA USA)
Posts: 755
Quote:
Originally Posted by bebaldin View Post
Installed on my SEL about 7 hours ago but so far nothing is showing on it at all. Several of the battery devices have updated since the install. Not sure why it isn't creating any devices.
Make sure that the correct device type is selected in the device view window. I missed that at first.
__________________
DSteiNeuro

HS3Pro

MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

Enabled Plug-Ins
BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does the z-wave plugin have something against battery status? - Solution! garyd9 HomeSeer Z-Wave Plug-in 79 May 7th, 2017 07:03 PM
Error Ultra1Wire3 ?Plugin Smart Battery Monitor Not all voice recognition aldo Ultra1Wire HSPI 1 January 6th, 2017 08:56 PM
Monitor open/closed but not alarm... virtualadam Envisalink Ademco Plugin (3P) 2 September 5th, 2016 09:52 PM
How to Monitor Interior Doors (Open/Closed) Warez HomeSeer General Discussion Area 11 August 30th, 2004 07:41 PM


All times are GMT -4. The time now is 02:24 PM.


Copyright HomeSeer Technologies, LLC