Announcement

Collapse
No announcement yet.

Monthly Low Battery Check

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

    Monthly Low Battery Check

    Randy,
    I didn't want to hijack the other thread, but how exactly are you having your battery devices being checked on the first Saturday of each month and then send you an email. This is great idea, and very handy.

    So is the condition IF "device changes and becomes" Motion Sensor Battery "Battery Low Warning"

    Originally posted by rprade View Post
    That should restart it if it crashes. I would also look at the HS3 logs to see if there is any pattern just before it fails.

    Anecdotally I had a situation last year that was relative to a bug in HomeSeer. The bug was any event that had the condition the first day (Monday, Tuesday, Wednesday, etc.) of any month would cause HS3 to just exit. I had HSSentry running, so it would immediately restart. I didn't even know it was happening, until i realized my logs always started at about 8:00 in the morning every day. Then I realized HomeSeer was shutting down and restarting at exactly 8:00 AM every morning. When I looked at the last event in the logs just before it restarted it was my monthly battery check.The event sends me an email on the first Saturday of every month with the battery levels of every device in my system, so I can replace any that might be getting low over the weekend.

    That event was:
    IF The time is 8:00 AM
    AND IF the day is the first Saturday of every month
    THEN send email
    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

    #2
    Originally posted by TomTom View Post
    Randy,
    I didn't want to hijack the other thread, but how exactly are you having your battery devices being checked on the first Saturday of each month and then send you an email. This is great idea, and very handy.

    So is the condition IF "device changes and becomes" Motion Sensor Battery "Battery Low Warning"
    It is not nearly as tough as all that. The monthly battery check sends me an email with the status of every Z-Wave battery in the house. It is just to help me be preemptive, if the batteries are below a certain level I will change them. It now runs at 8:00 PM on the first Friday of every month so that I can change any that are getting low over the weekend. The body of the email is simply:

    $date- $time

    Door Sensor battery levels

    Mailbox: $$DSR:1406:
    Garage Door: $$DSR:1422:
    Garage side door: $$DSR:1915:
    ~~~

    Leak Detector battery levels

    Boiler Closet: $$DSR:1919:
    Media Room: $$DSR:1924:
    Kitchen: $$DSR:1929:
    ~~~

    Multi-sensor battery levels

    Workshop: $$DSR:114:
    Garage: $$DSR:1236:
    Living Room: $$DSR:240:
    ~~~

    Thermostat battery levels

    US Bathroom: $$DSR:1217:
    Living Room: $$DSR:169:
    Master BR: $$DSR:1583:
    ~~~

    Window Sensor battery levels

    Workshop 1: $$DSR:2189:
    Workshop2: $$DSR:2200:
    Back Porch 1: $$DSR:2210:
    ~~~


    I have separate events that will trigger if a battery reports low at any time. They are in groups of 5-10 devices with multiple triggers Their triggers are:

    IF the device DS BR MS Battery changes and becomes Battery Low Warning

    OR IF the device US BR MS Battery changes and becomes Battery Low Warning

    .....

    THEN Send Pushover message

    The pushover message contains the replacement variables for the devices in the triggers. If for some reason my preemptive battery replacement allows one to go to low before the next monthly email, I will get an immediate notice. So far that hasn't happened.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Randy this is such a great idea, it should be a sticky. This is easy to do but for what ever reason I never thought of doing it way. Most folks have battery devices(locks, motion, water, etc) and will find this very useful.
      These lil touches make HA life easier Thanks
      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


        #4
        +1

        Comment


          #5
          I've used "Battery Low Warning" in my alert events as well. What is it's value, and where is that defined/edited?

          Comment


            #6
            Battery Report Script

            I added so many battery devices recently, I wanted a better way to report battery status w/o having to identify each device manually.

            I created a script that will email a battery report for all 'battery' type devices in HS3.

            Code:
             
             
            RefID Battery  Device Location / Name                         Last Changed
            ----- -------  ----------------------                         ------------
            [1369]      0%  Z-Wave Mailbox Battery                         1/1/0001 12:00:00 AM  
            [1119]      0%  Z-Wave Downstairs Bathroom Door Battery        1/1/0001 12:00:00 AM  
             [164]     25%  RFXCOM Wine Cellar Thermometer Battery         7/9/2015 4:58:47 AM   
             [462]     50%  Z-Wave Living Room Door Lock Battery           6/9/2015 2:50:27 AM   
            [1085]     50%  Z-Wave Porch Motion Battery                    7/26/2015 2:40:01 PM  
             [457]     60%  Z-Wave Garage Door Lock Battery                3/10/2015 12:14:55 PM 
             [158]     75%  RFXCOM Backyard Hot Tub Battery                3/6/2015 7:15:25 AM   
             [643]     75%  RFXCOM Garage Server Temperature Battery       10/8/2014 8:43:37 PM  
             [160]     75%  RFXCOM Pond Thermometer Battery                8/25/2014 9:20:30 PM  
             [171]     75%  RFXCOM Master Bedroom Thermometer Battery      8/25/2014 9:34:04 PM  
             [167]     75%  RFXCOM Downstairs Bathroom Thermometer Battery 12/23/2014 1:48:35 PM 
             [162]     75%  RFXCOM Living Room Fish Tank Battery           8/25/2014 9:23:01 PM  
            [1044]     75%  Z-Wave Downstairs Bathroom Vent Battery        7/26/2015 2:58:05 PM  
            [1100]     82%  Z-Wave Spare Motion Battery                    7/26/2015 3:28:46 PM  
             [475]     90%  Z-Wave Outside Side Gate Battery               7/25/2015 2:34:18 PM  
             [568]     90%  Z-Wave Kitchen Smoke/CO2 Detector Battery      7/22/2015 4:27:40 PM  
            [1163]    100%  Windows Living Room North Window Battery       7/25/2015 10:23:45 PM 
            [1167]    100%  Windows Guest Bathroom Window Battery          7/23/2015 10:29:20 PM 
            [1127]    100%  Z-Wave Kitchen Slider Battery                  6/19/2015 12:49:27 PM 
            [1201]    100%  Windows Master Bath Window Battery             6/13/2015 5:11:17 PM  
            [1123]    100%  Z-Wave Garage Slider Battery                   5/9/2015 1:36:41 PM   
            [1171]    100%  Windows Guest Room 2 Window Battery            7/18/2015 5:07:57 PM  
            [1185]    100%  Windows Z-Wave Spare - Battery                 7/9/2015 11:01:45 AM  
            [1205]    100%  Windows Master Bedroom West Window Battery     7/19/2015 6:31:22 AM  
            [1193]    100%  Windows Family Room Window Battery             7/20/2015 2:03:01 PM  
            [1197]    100%  Windows Kitchen Window Battery                 7/11/2015 3:56:14 PM  
            [1189]    100%  Windows Office Window Battery                  7/25/2015 5:15:06 AM  
            [1418]    100%  Node 4 Z-Wave Battery                          7/25/2015 3:41:07 PM  
            [1175]    100%  Windows Master Bedroom East Window Battery     7/6/2015 6:39:24 AM   
            [1208]    100%  Windows Guest Room 1 Window Battery            7/26/2015 3:52:41 PM  
            [1181]    100%  Windows Living Room West Window Battery        6/29/2015 6:12:52 AM  
             [450]   ERROR  Z-Wave Laundry Room FortrezZ Battery           7/19/2015 9:56:41 AM  
             [32 Battery Devices] - Report created 7/26/2015 5:30:45 PM
            To use, open the vb script with your favorite vb/txt editor, configure the first four lines, that's all that's to it. No attributes need to be sent to the script.

            The script can email the battery report as an attachment, or as the message body in the email [ReportAsAttachment = True/False].

            It defaults with a sort by lowest battery values first. It includes the device's 'Last Changed' value, so you can determine if the device is or is not reporting as expected.

            In the printout above, the last of my battery devices is reporting "ERROR". I discovered this device has an 'Invalid' range (as observed in device management) - so this is helpful to know as well.

            Note, the formatting is based on fixed-font spacing. So the attachment report looks pretty decent when viewed in Notepad, but the email body report viewed in Outlook loses some spacing characteristics. I'm over trying to clean this up any further - lol.

            Remove the .txt extension from the attached.
            Attached Files
            Last edited by mwaite; October 12, 2015, 08:53 PM. Reason: Updated script - HTML table format now for better viewing in email
            Mike

            Comment


              #7
              Wow, nice! Thank you !!!


              Sent from my iPhone
              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


                #8
                just tried it, this is awesome.
                Yes, my battery devices are increasing every day and this will really help.
                Love how it puts the lowest battery level devices first.

                THANK YOU for sharing your hard work!
                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


                  #9
                  Originally posted by TomTom View Post
                  just tried it, this is awesome.
                  Yes, my battery devices are increasing every day and this will really help.
                  Love how it puts the lowest battery level devices first.

                  THANK YOU for sharing your hard work!
                  +1. The script is an excellent solution.
                  HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #10
                    Thanks! Works great (and easy)!

                    Comment


                      #11
                      Great addition. Thanks a lot for sharing!

                      Comment


                        #12
                        Solved

                        Forget everything. I changed it to a vb extension and all is well. I knew it was silly .

                        >>>>
                        OK I must be doing something really silly. I saved this script as a .txt file on my HS3 server and edited the first few lines as requested. I then created an event to run a script file and pointed it to the .txt file. However when I run the event manually I get the following error:

                        Running script, script run or compile error in file: C:/Program Files/HomeSeer HS3/scripts/BatteryReportScript.txt1025:Expected end of statement in line 1 More info: Expected end of statement

                        Does this need to be saved with a vb extension? I am not sure which is actually Line 1 from the error message point of view. Is it the actual first line int he script which is the Dim filename as String... or is it the first line int he Try block? And finally what does the "Expected end of statement" actually mean? Should there be a semicolon after each line. It's been a while since i did any VB stuff.
                        <<<<

                        Thanks
                        Last edited by Gunneyk; July 27, 2015, 09:20 AM. Reason: Solved issue

                        Comment


                          #13
                          +1
                          love the script!! Thanks for sharing!
                          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

                          Google Search for HomeSeer Forum

                          Comment


                            #14
                            Will this work for x10 motion sensor?
                            Hector
                            ____________________________________
                            Win.2003 OS, HS3
                            BLDSC,BLstat,BLRadar,BLRamdom,BLOccupied
                            BLups,BLrain8,HSTouch,Ultrajones Weatherbug,
                            MyTrigger,ACRF2,W800,Zwave
                            AP800,Honeywell Stat

                            Comment


                              #15
                              Originally posted by Rotech View Post
                              Will this work for x10 motion sensor?
                              If it has the word 'battery' in the Device Type, then yes!
                              Attached Files
                              Mike

                              Comment

                              Working...
                              X