Announcement

Collapse
No announcement yet.

Do Battery Life Monitors Work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Do Battery Life Monitors Work?

    I have used a dozen battery powered devices on my HS3 zwave network over the last few years. Each one has advertised that it passes on its battery level when it transmits. I currently have 6.

    Not sure if this is a HS3 issue, device issue, or user issue. But since it has been the same experience for 2+ years and with different devices from different manufacturers, I am posting to the HS3 forum.

    My observations:
    * I do not *ever* recall seeing a value other than 100% or 0%.
    * I have events set up to notify me when battery is below 25%. They have never been triggered. Yet I have replaced at least 2 batteries and today have another which is dead.

    The devices I have set up right now are:
    * Aeotec Gen 5 recessed door sensor
    * Ecolink TILT-ZWAVE2 Garage Door Tilt Sensor
    * Everspring water sensor

    Do others have a better experience? If so, did you need to do anything in the device or in HS3 related to battery monitoring?

    #2
    I have a mixture of sensors myself and I do the the status changing on my aeotec stuff. But the door sensors I haven't seen change at all, but also haven't had any issues yet.

    I am not sure if it's accurate, but it has been working for me.
    Attached Files

    Comment


      #3
      Originally posted by waynehead99 View Post
      I have a mixture of sensors myself and I do the the status changing on my aeotec stuff. But the door sensors I haven't seen change at all, but also haven't had any issues yet.

      I am not sure if it's accurate, but it has been working for me.
      Thanks for the feedback. Good to know it is possible. Is your screen shot from a page you created? I am not familiar with that particular one. I do not recall ever seeing values like you show - so something is clearly different.

      Comment


        #4
        Yea it is a separate page I created.

        More Info, I did replace batteries in a bunch of devices a few days ago, so the 100's you are seeing are somewhat accurate.

        There are a couple sensors that I am concerned about that I haven't seen update, but they are still working.

        I saw somewhere on the forums someone that had created a script to look at last wake up and polling and is using that to determine if a device needs attention/new battery. I have considered doing something similar and its on my todo list, but low priority to some of the other things I am trying to finish up.

        Comment


          #5
          I've been using the low battery script, but didn't see the thread you mentioned about polling them. Just did a search and didn't find it either.

          Originally posted by waynehead99 View Post
          I saw somewhere on the forums someone that had created a script to look at last wake up and polling and is using that to determine if a device needs attention/new battery. I have considered doing something similar and its on my todo list, but low priority to some of the other things I am trying to finish up.
          Tom
          baby steps...starting again with HS3
          HS3Pro: Z-NET & 80 Z wave Devices,
          HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
          Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
          In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
          System: XP on Fanless Mini-ITX w/ SSD

          Comment


            #6
            I use the low battery script as well, it's actually the bases of the sql report I showed above (modified slightly).

            Did some searching thru my subscribed threads and found the idea. It may work for you...

            http://board.homeseer.com/showpost.p...6&postcount=24

            Comment


              #7
              I have a few battery operated devices that do report properly, although with any battery, it's hard to measure exactly how much life is left. The ones that report properly are the Kwikset deadbolts, the CT30 thermostats, the Everspring Luminance sensors and the HSM100 motion sensor. The Everspring and Fortrezz water sensors I have don't report battery percentage properly. I actually have some Fortrezz water sensors that alternate every day between 0 and 99% and have been doing this for months and still seem to be working fine. The good thing with them is that they do update HS every day with their battery, so I look at whether they stopped reporting as the trigger to swap the battery. The Everspring water sensors never seem to update.

              Cheers
              Al
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                are you using lithium ion. batteries? I was using energizer lithium AA and AAA and they showed the same behavior. they maintain voltage to the very end and die quick, where alkaline is what most devices expect have a slower (over weeks not days) voltage drop.

                Sent from my SAMSUNG-SM-G890A using Tapatalk
                Last edited by AgileHumor; April 22, 2016, 11:51 AM.

                Comment


                  #9
                  I use a script that I run weekly to enumerate through all my devices and evaluate any with "battery" in the type name. It then sends me an email for anything with <30%

                  Script below for anyone interested:

                  Code:
                      Public Sub CheckBatteryStatus(ByVal Parms As Object)
                          ' Enumerates through all devices.
                          ' Any device with Battery in the Device Type string will be evaluated
                          ' Values <30 or =255 or with "low" or "warning" in the description will be included in the warning email
                  
                          ' Email constants for sending out email alerts and updates
                          Const EMailRecipients As String = "me@mydomain.co.uk"
                          Const EMailFrom As String = "homeseer@mydomain.co.uk"
                          Const MinValue As Integer = 30 ' Battery values of this and below will be included in the error report
                  
                          Dim EMailSubject As String = "Battery status report for Landschultz Household as of " & Now()
                          Dim EMailBody As String = "The following devices have low battery status:" & vbCrLf & vbCrLf
                          Dim EmailToSend As Boolean = False
                  
                          Try
                              Dim dv As Scheduler.Classes.DeviceClass
                              Dim EN As Scheduler.Classes.clsDeviceEnumeration
                              EN = hs.GetDeviceEnumerator
                              Dim ref As Integer
                              Dim IncDev As Boolean = False
                  
                              If EN Is Nothing Then
                                  hs.WriteLog("Script", "Error getting Enumerator")
                                  Exit Sub
                              End If
                              Do
                                  dv = EN.GetNext
                                  If dv Is Nothing Then Continue Do
                  
                                  If InStr(dv.Device_Type_String(Nothing).ToUpper, "BATTERY") > 0 Then
                                      ' This is a battery device. Evaluate if it should be in the email
                                      ref = dv.Ref(Nothing)
                                      IncDev = False
                                      If hs.DeviceValue(ref) < 30 Or hs.DeviceValue(ref) = 255 Then
                                          IncDev = True
                                          EmailToSend = True
                                          EMailBody = EMailBody & dv.Location(Nothing) & " " & dv.Location2(Nothing) & _
                                              " " & dv.Name(Nothing) & " Current Value: " & hs.DeviceValue(dv.Ref(Nothing)) & "%" & vbCrLf & vbCrLf
                                          Debug.WriteLine(dv.Device_Type_String(Nothing).ToUpper) ' @DONOTEXPORT
                                      End If
                                  End If
                              Loop Until EN.Finished
                  
                              Debug.WriteLine(EMailBody) ' @DONOTEXPORT
                  
                              If EmailToSend Then
                                  EMailBody = EMailBody & vbCrLf & "Please note this list does not include devices with battery levels above " & MinValue & "%" & vbCrLf
                                  hs.SendEmail(EMailRecipients, EMailFrom, "", "", EMailSubject, EMailBody, "")
                              End If
                  
                          Catch ex As Exception
                              hs.WriteLog("Error", "Exception in script: " & ex.Message)
                          End Try
                  
                      End Sub
                  Nicolai L

                  Comment


                    #10
                    Originally posted by NicolaiL View Post
                    I use a script that I run weekly to enumerate through all my devices and evaluate any with "battery" in the type name. It then sends me an email for anything with <30%
                    I get these errors when running the script on HS3:
                    Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: 'Debug' is not declared. Debug object functionality is available in 'System.Diagnostics.Debug'.

                    Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: 'Debug' is not declared. Debug object functionality is available in 'System.Diagnostics.Debug'.

                    Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

                    Comment


                      #11
                      Originally posted by AgileHumor View Post
                      are you using lithium ion. batteries? I was using energizer lithium AA and AAA and they showed the same behavior. they maintain voltage to the very end and die quick, where alkaline is what most devices expect have a slower (over weeks not days) voltage drop.
                      I've seen similar behavior with Lithium and with good quality Alkaline.

                      Cheers
                      Al
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #12
                        Originally posted by AgileHumor View Post
                        I get these errors when running the script on HS3:
                        Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: 'Debug' is not declared. Debug object functionality is available in 'System.Diagnostics.Debug'.

                        Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: 'Debug' is not declared. Debug object functionality is available in 'System.Diagnostics.Debug'.

                        Apr-22 9:58:31 AM Error Compiling script S:\Tools\HomeSeer\scripts\BatteryCheck.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
                        My guess is that the reference to System.Diagnostics needs to be added to settings.ini
                        Last edited by langenet; April 22, 2016, 12:48 PM.
                        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                        Comment


                          #13
                          Looks to me there is a copy typo on something it thinks labeled as debug.

                          Comment


                            #14
                            Originally posted by langenet View Post
                            My guess is that the reference to System.Diagnostics needs to be added to settings.ini
                            Thanks! I pulled:
                            Debug.WriteLine(EMailBody) ' @DONOTEXPORT
                            and another Debug.X

                            Now the script gives me this error:
                            VB.Net script exception(0), re-starting: Object reference not set to an instance of an object.

                            Code:
                            Public Sub CheckBatteryStatus(ByVal Parms As Object)
                                    ' Enumerates through all devices.
                                    ' Any device with Battery in the Device Type string will be evaluated
                                    ' Values <30 or =255 or with "low" or "warning" in the description will be included in the warning email
                            
                                    ' Email constants for sending out email alerts and updates
                                    Const EMailRecipients As String = "x"
                                    Const EMailFrom As String = "x"
                                    Const MinValue As Integer = 40 ' Battery values of this and below will be included in the error report
                            
                                    Dim EMailSubject As String = "Battery status report for X Household as of " & Now()
                                    Dim EMailBody As String = "The following devices have low battery status:" & vbCrLf & vbCrLf
                                    Dim EmailToSend As Boolean = False
                            
                                    Try
                                        Dim dv As Scheduler.Classes.DeviceClass
                                        Dim EN As Scheduler.Classes.clsDeviceEnumeration
                                        EN = hs.GetDeviceEnumerator
                                        Dim ref As Integer
                                        Dim IncDev As Boolean = False
                            
                                        If EN Is Nothing Then
                                            hs.WriteLog("Script", "Error getting Enumerator")
                                            Exit Sub
                                        End If
                                        Do
                                            dv = EN.GetNext
                                            If dv Is Nothing Then Continue Do
                            
                                            If InStr(dv.Device_Type_String(Nothing).ToUpper, "BATTERY") > 0 Then
                                                ' This is a battery device. Evaluate if it should be in the email
                                                ref = dv.Ref(Nothing)
                                                IncDev = False
                                                If hs.DeviceValue(ref) < 30 Or hs.DeviceValue(ref) = 255 Then
                                                    IncDev = True
                                                    EmailToSend = True
                                                    EMailBody = EMailBody & dv.Location(Nothing) & " " & dv.Location2(Nothing) & _
                                                        " " & dv.Name(Nothing) & " Current Value: " & hs.DeviceValue(dv.Ref(Nothing)) & "%" & vbCrLf & vbCrLf
                            
                                                End If
                                            End If
                                        Loop Until EN.Finished
                            
                                        If EmailToSend Then
                                            EMailBody = EMailBody & vbCrLf & "Please note this list does not include devices with battery levels above " & MinValue & "%" & vbCrLf
                                            hs.SendEmail(EMailRecipients, EMailFrom, "", "", EMailSubject, EMailBody, "")
                                        End If
                            
                                    Catch ex As Exception
                                        hs.WriteLog("Error", "Exception in script: " & ex.Message)
                                    End Try
                            
                                End Sub

                            Comment


                              #15
                              There is stuff missing from the script you are using.

                              Here is the full script

                              Code:
                                  Dim filename As String = "C:\Program Files\HomeSeer HS3\BatteryReport.txt" ' full path and filename of report (if sending report as an email attachment)
                                  Dim mailTo As String = "Email@hotmail.com" ' email TO address
                                  Dim mailFrom As String = "Email@hotmail.com" ' email FROM address
                                  Dim ReportAsAttachment As Boolean = False ' set to 'True' if report should be emailed as a file (attachment), set to 'False' if report should be in email body
                                  '____ End of User Configuration ____
                              
                                  Public Sub Main(ByVal param As String)
                                      Dim myArray(0) As BatteryDevice
                                      Dim strDeviceString, centerSTR
                                              
                                      ' Header
                                      strDeviceString  = "<html><head><style type=" & chr(34) & "text/css" & chr(34) & ">TD{font-family: Arial; font-size: 10pt;}</style></head><body><p><table cellpadding=" & chr(34) & "4" & chr(34) & " WIDTH=" & chr(34) & "100%" & chr(34) & "border=" & chr(34) & "1" & chr(34) & "><tr><th>Ref ID</th><th>Battery %</th><th>Device Location / Name</th><th>Last Updated</th></tr>"
                                      centerSTR = "<td align=" & chr(34) & "center"  & chr(34) & "valign="  & chr(34) & "middle"  & chr(34) & ">&nbsp;"
                                                  
                                      Try
                                          Dim dv As Scheduler.Classes.DeviceClass
                                          Dim EN As Scheduler.Classes.clsDeviceEnumeration
                                          EN = hs.GetDeviceEnumerator
                                          If EN Is Nothing Then
                                              hs.WriteLog("BatteryReport", "Error getting Enumerator")
                                              Exit Sub
                                          End If
                              
                                          Do
                                              dv = EN.GetNext
                                              If dv Is Nothing Then Continue Do
                              
                                              ' Add to array if device type contains 'battery'
                                              If InStr(UCase(dv.Device_Type_String(Nothing)), "BATTERY") > 1 Then
                                                   ReDim Preserve myArray(UBound(myArray) + 1)
                                                  myArray(UBound(myArray) - 1) = New BatteryDevice
                              
                                                  myArray(UBound(myArray) - 1).refID = ("[" & dv.Ref(Nothing).ToString & "]")
                                                  If dv.devValue(Nothing) > 100 Then ' if battery value is larger than 100(%), battery is invalid state
                                                      myArray(UBound(myArray) - 1).devValue = "  0%"
                                                  Else
                                                      myArray(UBound(myArray) - 1).devValue = (dv.devValue(Nothing).ToString & "%").PadLeft(7)
                                                  End If                    
                                                  myArray(UBound(myArray) - 1).devName = dv.Location(Nothing) & " " & dv.Name(Nothing) 'dv.Location2(Nothing) & " " & 
                                                  myArray(UBound(myArray) - 1).lastChange = dv.Last_Change(Nothing).ToString
                                                  
                                              End If
                                          Loop Until EN.Finished
                              
                                          ReDim Preserve myArray(UBound(myArray) - 1)
                                          Array.Sort(myArray)
                                         
                                          Dim battdevice As Object
                                          For Each battdevice In myArray
                                              strDeviceString = strDeviceString & "<tr>" & centerSTR & battdevice.refID & "</td>" & centerSTR & battdevice.devValue  & "</td>" & "<td>" & battdevice.devName & "</td>" & centerSTR & battdevice.lastChange & "</td></tr>" 
                                          Next
                                          
                                           ' FOOTER
                                           strDeviceString = strDeviceString & "</table></p>"
                                           strDeviceString = strDeviceString & " [" & UBound(myArray) + 1 & " Battery Devices] - Report created " & Now.tostring 
                                           strDeviceString = strDeviceString & "</body></html>"
                                           
                                          ' SEND            
                                          If ReportAsAttachment Then
                                              System.IO.File.Delete(filename)
                                              My.Computer.FileSystem.WriteAllText(filename, strDeviceString, True, System.Text.Encoding.Default)
                                              hs.SendEmail(mailTo, mailFrom, "", "", "Battery Report", "Battery Report attached.", filename)
                                          Else
                                              hs.SendEmail(mailTo, mailFrom, "", "", "Battery Report", strDeviceString, "")
                                          End If
                                          
                                      Catch ex As Exception
                                          hs.WriteLog("BatteryReport", "ERROR:  Exception in script: " & ex.Message)
                                      End Try
                                      hs.WriteLog("BatteryReport", "Battery report created.")
                                      
                                  End Sub
                                  
                                  Public Class BatteryDevice
                                      Implements IComparable(Of BatteryDevice)
                              
                                      Public refID As String
                                      Public devValue As String
                                      Public lastChange As String
                                      Public devName As String
                              
                                      Public Function CompareTo(ByVal other As BatteryDevice) As Integer Implements IComparable(Of BatteryDevice).CompareTo
                                          Return Me.devValue.CompareTo(other.devValue)
                                      End Function
                                  End Class

                              Comment

                              Working...
                              X