OK, who has a nice script that will text me if a low-battery warning is received from any motion sensor? Preferably it will include the location of the sensor, but not absolutely necessary.
Announcement
Collapse
No announcement yet.
Low Battery Warning Script?
Collapse
X
-
Originally posted by JimSpy View PostOK, who has a nice script that will text me if a low-battery warning is received from any motion sensor? Preferably it will include the location of the sensor, but not absolutely necessary.
Mike posted a script in this post that will generate a nicely formatted report of all batteries.
I use the virtual device to trigger a message with the full report when any battery is low. I also email the report to me on the first friday of each month so I can replace batteries over the weekend.Last edited by randy; January 11, 2016, 01:37 PM.HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon
-
Originally posted by JimSpy View PostI tried this script, but I get an exception in the Log:
Jan-10 1:54:43 PM Error Exception in script LowBatteryCheck: Object reference not set to an instance of an object.
Comment
-
Originally posted by JimSpy View PostI see that it is designed for Z-wave; will it also work with Insteon motion sensors?
Code:If StrComp(dv.Device_Type_String(Nothing), "Z-Wave Battery") = 0 Then 'Only work with devices with a battery
Comment
-
Originally posted by waynehead99 View PostI am sure you can make it work. Right now it is looking for a device type of Zwave batteries... you would just need to change this line to match what it is for insteon... I don't have any so I am not sure what it will look like:
Code:If StrComp(dv.Device_Type_String(Nothing), "Z-Wave Battery") = 0 Then 'Only work with devices with a battery
HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon
Comment
-
Originally posted by rprade View PostThe report I pointed to above uses "if device type contains 'battery'", so it catches all battery devices. I'm sure the script could be changed accordingly. I never bothered, because all of my battery operated devices are Z-Wave.
Thanks.
EDIT: Actually, never mind. As far as I know, Motion Sensors are the only Insteon devices that report a battery condition, so I could just strComp on Motion Sensor Battery Low or whatever.
Jim Speiser
38-year veteran of Home Automation
Still don't know squat
Comment
-
Originally posted by JimSpy View PostI would need to take a refresher course on vbscript. Can you tell me the function name I would use to replace strComp (which IIRC is a full string comparison) to do a partial string comparison (or just "does the string contain")?
Thanks.
EDIT: Actually, never mind. As far as I know, Motion Sensors are the only Insteon devices that report a battery condition, so I could just strComp on Motion Sensor Battery Low or whatever.
Code:If InStr(UCase(dv.Device_Type_String(Nothing)), "BATTERY") > 1 Then
HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon
Comment
Comment