Announcement

Collapse
No announcement yet.

How To Create A Low Battery Level Event

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

  • How To Create A Low Battery Level Event

    Hi, I am trying to setup a low battery level notification event in HS3. I can think of 2 ways to do this (1) trigger the event when a battery hits low battery and send an email or (2) trigger the event each day at a specified time and only send an email if there is a low battery. I am trying to do more or less the second unless there is a way to do both (I want to be reminded as to not to forget to change the battery). Attached is an example of what I setup in a HS3 event.

    I am looking for any advice as well as examples of what others have done to track low batteries.

    If you could post screen prints of your event examples that would be very appreciated as it will let me and others see exactly how you are setting up your events in HS3.

    Also, I never used a "Battery Low Warning" device status before. Any comments on how this works would be appreciated.

    Thank you
    Attached Files
    Last edited by heatvent; June 1st, 2014, 12:16 PM.

  • #2
    This is partly ignorance, I suppose, but I do something similar in HS2 with a script. I call an event once a day to check batteries on all devices and set a virtual device to On if one of the batteries is low.

    Given the added abilities of HS3 events, it makes sense to use an event, but I don't understand why you are entering the battery state conditions as group conditions rather than event conditions. It's also not clear how using OR'd conditions interacts with the requirement that all group conditions must be true.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

    Comment


    • #3
      Originally posted by Uncle Michael View Post
      Given the added abilities of HS3 events, it makes sense to use an event, but I don't understand why you are entering the battery state conditions as group conditions rather than event conditions.
      I tried that but it didn't seem possible in HS3 to do a if it is 8:00 am AND a bunch of OR statements within the event itself. I seemed to achieve the same thing by putting all the OR's in the group condition instead.

      Originally posted by Uncle Michael View Post
      It's also not clear how using OR'd conditions interacts with the requirement that all group conditions must be true.
      Agreed. Lack of documentation on HS3 leaves one doing a bunch of trial and error to reverse engineer what HS3 is doing behinds the scene. I know it slows down programming, etc. and takes extra resources but it would be great if there was a good description of every selectable trigger, action, etc. and how it worked but that does not exist at this point. So I am hoping to get some other people's learnings.

      Comment


      • #4
        Looking at the event in the first post:
        • IF the time is at 8:00:00AM
        • OR IF The group Conditions Are All TRUE
        It would seem to me the logic is flawed, The event would be true at 8:00AM, but it would also be true if all of the group conditions are true. I also don't know how it is evaluated if all of the Group Conditions consist of OR IF conditions, but that also seems problematic. I would think that for the event to trigger at 8:00AM if any of the battery levels are low, provided the Group Conditions are evaluated properly the event SHOULD be:
        • IF the time is at 8:00:00AM
        • AND IF The group Conditions Are All TRUE


        The events that I use are below and I have confirmed that they work. I have one for my Multi-sensors and another for my thermostats.
        Attached Files
        Randy Prade
        Aurora, CO
        Prades.net

        PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

        Comment


        • #5
          How To Create A Low Battery Level Event

          Didn't notice that thanks for pointing out that I used an or statement. I think probably what happened is HS3 seems to be a little finicky when you try to pick OR or AND . if you don't check you sometimes get the wrong setting.

          I will correct and update the image I posted when I get chance. Thanks again.

          If I'm right in the way I've set things up, however, it seems using the group conditions might be a little more efficient than setting up the 8 AM condition for every or statement...assuming it works the same in either set up.
          Last edited by heatvent; June 1st, 2014, 04:55 PM. Reason: none

          Comment


          • #6
            Originally posted by heatvent View Post
            ...
            If I'm right in the way I've set things up, however, it seems using the group conditions might be a little more efficient than setting up the 8 AM condition for every or statement...assuming it works the same in either set up.
            If it works, it is one less step for each device and a little more 'efficient' to create, but it is no more or less efficient in execution as the event engine would still have to evaluate the trigger and a condition on each device. In my case it would also require creating two groups, a thermostat group and a multi-sensor group. That is the main problem I have with group actions - the fragmentation of my current group arrangement.
            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


            • #7
              Another thought. What if you have a simple event that triggers once a day and has an action to run a second manual event with conditons? The second event would have the OR'd conditions and the email as the action if any are true.
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

              Comment


              • #8
                Originally posted by Uncle Michael View Post
                Another thought. What if you have a simple event that triggers once a day and has an action to run a second manual event with conditons? The second event would have the OR'd conditions and the email as the action if any are true.
                That would work as well as long as HomeSeer respected conditions in the manually triggered event. The manually triggered event would still have to have stacked OR IF/AND IF groups like mine above because the low battery is not a trigger, but a condition. It would have to be:

                IF the event is manually triggered
                AND IF the device 1 is low battery

                OR IF the event is manually triggered
                AND IF the device 2 is low battery

                OR IF the event is manually triggered
                AND IF the device 3 is low battery

                OR IF the event is manually triggered
                AND IF the device 4 is low battery

                etc.

                I still have had some instances where conditions in a manually triggered event are ignored, despite having checked the box "Run Only If Other Event Conditions are TRUE", though I have not gone back and tried since updating to 3.0.0.96.

                You could also have an event that was based upon an IF the device changes to Battery Low Warning, OR IF the second device changes and becomes Battery Low Warning, etc., but that event would only trigger and run once as each battery in the event changed to that state. The other solutions would issue repeated reminders until the problem was resolved.
                Last edited by rprade; June 1st, 2014, 06:58 PM.
                Randy Prade
                Aurora, CO
                Prades.net

                PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                Comment


                • #9
                  Originally posted by rprade View Post
                  If it works, it is one less step for each device and a little more 'efficient' to create, but it is no more or less efficient in execution as the event engine would still have to evaluate the trigger and a condition on each device. In my case it would also require creating two groups, a thermostat group and a multi-sensor group. That is the main problem I have with group actions - the fragmentation of my current group arrangement.
                  I guess I was thinking the setup was more efficient. There may be some benefit to having multiple "groups" because then you can at least narrow down which type of device triggered the alert. Would be great if this could somehow be identified in the notification email. At the very least I am looking into substitution variables. Not sure if this is available in HS3 but it was in HS2 although I didn't use them ever. The idea would be to list the device value for every one of the devices in the condition as part of the email...kind of like a battery status report in the email. That way I can see which device needs batteries.

                  I will need to poke around a bit to see if this will work in HS3.

                  Comment


                  • #10
                    Originally posted by rprade View Post
                    That would work as well as long as HomeSeer respected conditions in the manually triggered event. The manually triggered event would still have to have stacked OR IF/AND IF groups like mine above because the low battery is not a trigger, but a condition.
                    That's a bummer! Of all the things HST could have fixed in HS3, grouped OR'd conditions linked by an AND seemed like a obvious one.

                    You might as well make each test its own event, and have the event action of each one call a manual event that sends the email.

                    My take on this is to do it with a script!
                    Mike____________________________________________________________ __________________
                    HS3 Pro Edition 3.0.0.548

                    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

                    Comment


                    • #11
                      Originally posted by Uncle Michael View Post
                      My take on this is to do it with a script!
                      Odd... my take on HS is to NEVER use a script!
                      website | products | support | youtube

                      Comment


                      • #12
                        I use the attached script to track battery levels once they drop to a specific level. Just change the battLevel constant to whatever clip-level you wish, and create an event for each battery child that you wish to monitor. The event should provide the battery child's full address (as specified in the Address column on the Homeseer home page) in the event's Parameter field.

                        The email sent will contain specific device information and current battery level for the given device so you don't have to search for it.

                        This assumes that the battery level change generates a notification on it's own of course ....thx.

                        Code:
                        Sub Main(ByVal strDevAdr As String)
                        
                            Dim intDevRef As Integer
                            Dim devObj As Object
                            Dim devStatObj As CAPIStatus
                            Const battLevel = 15
                        
                            intDevRef = hs.GetDeviceRef(strDevAdr)
                            devObj = hs.GetDeviceByRef(intDevRef)
                            devStatObj = hs.CAPIGetStatus(intDevRef)
                        
                            If int(devStatObj.Value) < battLevel Then
                                Dim msubject As String = "Low Battery Level Alert"
                                Dim message As String = "Source Device: " & devObj.Location2(hs) & " " & devObj.Location(hs) & " " & devObj.Name(hs) & ", Level=" & devStatObj.Value & "%"
                                hs.SendEmail("user1@email.com", "user1@email.com", "", "", msubject, message, "")
                            End If
                        
                        End Sub

                        Comment


                        • #13
                          Originally posted by macromark View Post
                          Odd... my take on HS is to NEVER use a script!
                          That was my impression as well, but this seems to be incredibly difficult with events. We must be missing something. Can you help explain how to do this test with an event?
                          Mike____________________________________________________________ __________________
                          HS3 Pro Edition 3.0.0.548

                          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

                          Comment


                          • #14
                            I'll put my flame retardant suit on for this
                            Originally posted by macromark
                            Odd... my take on HS is to NEVER use a script!
                            It is going to take a while for people to realize just how powerful the event engine is in HS3, how different the logic is from HS2 and to break the habit some have of writing a script when an event would do. It would be better if the help file didn't make the statement: "Events use simple "IF" "THEN" "ELSE" logic", because there is no "ELSE", either implicit or explicit. Once one gets a clear understanding of a trigger vs a condition and that an "OR IF" begins a fresh trigger/condition group that has no relationship to to prior triggers/conditions in the event, it all becomes a lot easier.

                            Originally posted by Uncle Michael View Post
                            That was my impression as well, but this seems to be incredibly difficult with events. We must be missing something. Can you help explain how to do this test with an event?
                            I didn't need the granularity of a specific message referencing the specific device, I just needed to be notified if a battery was low. I can then filter on device manager to look at all of the batteries. The two events I posted screenshots of in a post above, took all of 60 seconds to create. They function reliably and as expected just using events. I only broke it into two groups, one for thermostats and the other for multi-sensors. I built the first event, then used the copy function to create the second, then edited the title, devices and Pushover message. I read thoughts that an event like that is not as "elegant" as a script, but to me it is really easy to look at a stacked IF/AND - OR IF/AND statements in an event and see exactly what is going to happen. I realize that having to repeat the trigger *feels* a little redundant, but it is also very flexible. It allows different triggers and/or conditions resulting in the same actions within an event - even if it is the same trigger eight times, each with different conditions. .

                            If I wanted or needed the granularity of a customized Pushover message for every device it would take very little time to build a single event, triggered at a time, conditioned by a single device and sending a Pushover message specifying that specific device. Then use the copy event icon, edit the title, the device and the body of the Pushover message. Repeating this for thirteen different devices and creating thirteen additional events. While some would call this inelegant or cluttered, it actually makes it very easy to look at events and see what is intended in their design. With careful thought to event grouping and naming HS3 presents a well organized view of events.

                            I guess I just don't understand some of the aversion to using events. Some of the people who became script centric under HS2 would rather write five lines of script than to see five lines of conditions or a couple of different events. There are certainly some things that cannot be done without a script, but I see no reason to use a script for anything that can be accomplished within a normally structured event.
                            Randy Prade
                            Aurora, CO
                            Prades.net

                            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

                            Comment


                            • #15
                              I have events similar to these and send all device friendly names and batt percentages in a single pushover msg using replacement variables. Just saves going to search in the device page
                              cheeryfool

                              Comment

                              Working...
                              X