Announcement

Collapse
No announcement yet.

Battery Value Always Matches

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

    Battery Value Always Matches

    Hello all,

    I've create two events that will alert me if any of my battery powered devices have a low battery. The first event is a timed event that runs once a day and will run the second event if its conditions are true. The second event will send me an email with the status of all my batteries if any of them are low. The problem is that the email always gets sent, even though none of my batteries are less than 60%. I've tried "low=Low Battery Warning" and I've tried "low= less than 10%" and the email event is always triggered. I'm hoping someone can point out the mistake in my logic.

    Here is the first event:
    Click image for larger version

Name:	Screen Shot 2017-08-09 at 10.50.06 AM.png
Views:	1
Size:	42.0 KB
ID:	1211304

    And here is the second event:
    Click image for larger version

Name:	Screen Shot 2017-08-09 at 10.53.55 AM.png
Views:	1
Size:	170.0 KB
ID:	1211305

    #2
    Originally posted by ian351c View Post
    Hello all,

    I've create two events that will alert me if any of my battery powered devices have a low battery. The first event is a timed event that runs once a day and will run the second event if its conditions are true. The second event will send me an email with the status of all my batteries if any of them are low. The problem is that the email always gets sent, even though none of my batteries are less than 60%. I've tried "low=Low Battery Warning" and I've tried "low= less than 10%" and the email event is always triggered. I'm hoping someone can point out the mistake in my logic.

    Here is the first event:
    [ATTACH]62690[/ATTACH]

    And here is the second event:
    [ATTACH]62693[/ATTACH]
    It is because your second event is all Triggers. Triggers in called events are always ignored - otherwise most called events would never run. You can add a condition after each trigger that is identical to the trigger, then it should work.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Here is a nice little script that will generate a formatted battery report in your email. Just edit the to and from email addresses and the other parameters at the top of the script. I would give credit to who wrote the script, but I forgot to note it. It will report the value of any device that has the word "battery" in the device type.

      Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	96.8 KB
ID:	1191849
      HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        Hi Randy,

        Thanks for the replies. Unfortunately I'm on Linux, so a script isn't an option for me. I'm still confused though. The second event should only be run "if the event conditions are true". They are not, at least the way I'm reading it. So why does the second event run?

        ETA: So after playing around in the event editor a bit, it looks like the first "IF" in any condition block (any blue block in an event) is considered a "Trigger" and is not parsed when an event is called by another event. Hence your thermostat thread (which has been an awesome reference BTW) has "If this event is manually triggered" as the first "IF" for the events called by other events. Is that correct?

        Comment


          #5
          Here's the new second event. It all works as desired now. I will note that editing this event was a PITA. There's a bug in the javascript somewhere that breaks the redraw of the event when adding a condition (AND) to the trigger (IF) after I've created a certain number of triggers. This happens on Safari, Firefox, and Chrome on Mac.

          Click image for larger version

Name:	Screen Shot 2017-08-09 at 1.50.38 PM.png
Views:	1
Size:	240.5 KB
ID:	1191852

          Comment


            #6
            Originally posted by ian351c View Post
            Hi Randy,

            Thanks for the replies. Unfortunately I'm on Linux, so a script isn't an option for me. I'm still confused though. The second event should only be run "if the event conditions are true". They are not, at least the way I'm reading it. So why does the second event run?

            ETA: So after playing around in the event editor a bit, it looks like the first "IF" in any condition block (any blue block in an event) is considered a "Trigger" and is not parsed when an event is called by another event. Hence your thermostat thread (which has been an awesome reference BTW) has "If this event is manually triggered" as the first "IF" for the events called by other events. Is that correct?
            Yes. An IF or OR IF is a Trigger and is ignored. You can still use those triggers within your event so it will run autonomously, but if you also add an additional AND IF condition to each trigger that matches the trigger, it can run autonomously or manually with the conditions honored. For example your event would look like:

            Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	37.5 KB
ID:	1191851
            HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              Randy,

              This works for me. Is it because the And If becomes a condition? The verbiage changes leading me to believe that it does.
              Attached Files
              Michael

              Comment


                #8
                Originally posted by Rvtravlr View Post
                Randy,

                This works for me. Is it because the And If becomes a condition? The verbiage changes leading me to believe that it does.
                Yes AND IF is a condition. IF and OR IF are triggers. Conditions only apply to the IF or OR IF at the top of the group. The next OR IF begins a new group which would use its own conditions.

                This is a good reference
                https://forums.homeseer.com/showthread.php?t=173196
                HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #9
                  Randy, I attempted to use your Battery Report script.. (thanxs by the way) it created a report but I get the following what am I missing?

                  UPDATE: Never mind... After reviewing "target machine" IP address it dawned upon me, that I needed to setup my SMTP and POP server particulars within the Setup>E-Mail tab.. works like a champ. Thanxs Randy for the neat script. Mike
                  Attached Files
                  Last edited by MNB; August 19, 2017, 06:19 PM.
                  Computer: CUK Intel NUC7i7BNH
                  Op System: Windows10 Pro - Work Station
                  HS Version: HS4 Pro Edition 4.2.19.0

                  Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                  Comment


                    #10
                    Originally posted by MNB View Post
                    Randy, I attempted to use your Battery Report script.. (thanxs by the way) it created a report but I get the following what am I missing?

                    UPDATE: Never mind... After reviewing "target machine" IP address it dawned upon me, that I needed to setup my SMTP and POP server particulars within the Setup>E-Mail tab.. works like a champ. Thanxs Randy for the neat script. Mike
                    You're welcome. I didn't write the script, I wish I could remember who did so I could give proper credit.
                    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                    Comment


                      #11
                      How often are you running this script, are you using a time of day/date to trigger event? I've currently have it run every day at 12:01 a.m. which seems to be too frequent it would be nice if it would trigger for any battery levels that were below a prescribed level your thoughts?
                      Computer: CUK Intel NUC7i7BNH
                      Op System: Windows10 Pro - Work Station
                      HS Version: HS4 Pro Edition 4.2.19.0

                      Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                      Comment


                        #12
                        Originally posted by MNB View Post
                        How often are you running this script, are you using a time of day/date to trigger event? I've currently have it run every day at 12:01 a.m. which seems to be too frequent it would be nice if it would trigger for any battery levels that were below a prescribed level your thoughts?
                        I have an event that runs it on the morning of the first Friday of every month. That way I have the report so I can change batteries over the weekend if needed. I use 20% as a minimum. The same event has multiple OR IF triggers that will cause it to run if any battery shows less than 10% remaining. I have never had a battery that was more than 20% at the time of the report fail completely before the next report.
                        HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                        Comment


                          #13
                          Randy, many thanxs for the pointers. I've incorporated them within one of my events (see below). Mike
                          Attached Files
                          Computer: CUK Intel NUC7i7BNH
                          Op System: Windows10 Pro - Work Station
                          HS Version: HS4 Pro Edition 4.2.19.0

                          Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                          Comment


                            #14
                            Originally posted by MNB View Post
                            Randy, many thanxs for the pointers. I've incorporated them within one of my events (see below). Mike
                            Your event will work fine. The AND IF Conditions after each battery level won't hurt anything, but they are likely unnecessary. The only value they can give is to allow the Event to be run from another Event honoring those conditions. I don't see the need to call this Event from another. I would just leave them in place, since they will not hurt anything.
                            HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                            Comment


                              #15
                              Thank-you Randy, I was imitating your example from an earlier posting (see below). I'm a little slow but after reviewing it wasn't sure why I needed to logic wise to declare the same thing twice (thought maybe it had something to do with HS quirk(s)). As this is not the reason, I think I will remove the AND IF's as they do not add any value and would reduce the Event size. Mike

                              Yes. An IF or OR IF is a Trigger and is ignored. You can still use those triggers within your event so it will run autonomously, but if you also add an additional AND IF condition to each trigger that matches the trigger, it can run autonomously or manually with the conditions honored. For example your event would look like:

                              Attachment 62704
                              Computer: CUK Intel NUC7i7BNH
                              Op System: Windows10 Pro - Work Station
                              HS Version: HS4 Pro Edition 4.2.19.0

                              Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                              Comment

                              Working...
                              X