Announcement

Collapse
No announcement yet.

Counter help

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

    Counter help

    I have a mailbox with a open close sensor. I want to trigger this event only the first time. I would like to use the counter. I'm 0 out it at midnight. When the mailbox gets open by the post office and the counter is 0 then warn me with a light on. The subsequent opening will not trigger the light on. I have attached the event. Unfortunately it seems that the if counter is only on "become" and not on "Is" counter 0. What should I user for counter?
    Attached Files

    #2
    I used a similar trigger and conditions on my mailbox door sensor and for the counter condition I used "A Counter's Value is this Absolute Value" with zero. I added a trigger to increment the counter in the same event.​

    My first event triggers ok and alerts me the mailbox was open. The subsequent events do not trigger my alerts as expected.

    Although the counter condition wording is strange as it is not an action it does work. Seems like the author needs to update the line.

    Click image for larger version

Name:	image.png
Views:	122
Size:	13.1 KB
ID:	1616415

    Comment


      #3
      Originally posted by alphatech View Post
      I have a mailbox with a open close sensor. I want to trigger this event only the first time. I would like to use the counter. I'm 0 out it at midnight. When the mailbox gets open by the post office and the counter is 0 then warn me with a light on. The subsequent opening will not trigger the light on. I have attached the event. Unfortunately it seems that the if counter is only on "become" and not on "Is" counter 0. What should I user for counter?
      It is incorrect wording from HST, a Condition never “becomes”, it “is”. A counter’s value becomes 0 will work, because the value is 0 is the more correct interpretation. A Counter’s value is this absolute value will also work, it only ignores whether the number is negative or positive. 0 is neither.
      HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

      Comment


        #4
        I was sure i tried that, that is why I posted it. Small note, I tried by running the event manual few times with the same result, the counter increase by one but the event still trigger. I will post more results, thanks for the help.

        Sent from my SM-S906U using Tapatalk

        Comment


          #5
          if you run your event manually (or any event for that matter) they will trigger regardless of conditions, that's been around for a while.

          I temporarily replaced my mail box door device trigger for a light switch that I toggled and that was how I tested the conditional counter event.

          Comment


            #6
            I have started to include a Counter in one of my events. Counter is really a bit of a misnomer because what I really want is some way to test a device that can have multiple states. In my case, I use a counter that says that nothing happens at State 0, State 1 says that the Event is armed, but it requires a variety of different things have to happen before it changes to State 2 which is when the Event fires and the lights turn on. I know it sounds a little awkward but it works quite well.

            However, what I am wrestling with is how to test a counter that is "Less Than" a stated value. I can test it the counter is greater, etc but I cannot test if the counter is less than. Does anyone have any suggestions??

            Comment


              #7
              Originally posted by brmeeke View Post
              I have started to include a Counter in one of my events. Counter is really a bit of a misnomer because what I really want is some way to test a device that can have multiple states. In my case, I use a counter that says that nothing happens at State 0, State 1 says that the Event is armed, but it requires a variety of different things have to happen before it changes to State 2 which is when the Event fires and the lights turn on. I know it sounds a little awkward but it works quite well.

              However, what I am wrestling with is how to test a counter that is "Less Than" a stated value. I can test it the counter is greater, etc but I cannot test if the counter is less than. Does anyone have any suggestions??
              ​Why not use a multi state Virtual Device? Here’s one with 5 states, there is no limit.

              Click image for larger version  Name:	image.png Views:	0 Size:	63.2 KB ID:	1623025
              HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

              Comment


                #8
                Brilliant idea.... I need to play with it a bit more but I really like the approach.

                Thank you

                Comment

                Working...
                X