Announcement

Collapse
No announcement yet.

Conditions - A Counter's Value Is...

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

    Conditions - A Counter's Value Is...

    In the earlier posts we covered what are likely the most common conditions based upon a time, a date or day and the value of a device. You will find the vast majority of events will use those elements as either the trigger and or conditions. The next two conditions are based upon timers and counters. These are elements you can use as either riggers or Conditions within events. A Timer always counts forward by the second and can be controlled by event actions. These actions allow you to set the timer to a specific value, restart (set to 0 and start), resume (begin running from its current setting) or stop (stop the counter at its curent value). Counters can be controlled by actions as well. Unlike timers they can be made to count up or count down by single digits or other whole numbers. They can be reset or set to a specific value.



    Counters and Timers can be created in advance under the Tools> Global Variables, Timers & Counters tab at the top of the HomeSeer Web Interface. You can use the screen to create or manipulate Counters





    There are quite a number of value checks for creating a condition based upon a counter, some of them are straight forward, some are so nuanced as to be unclear what their use would be and one is not clearly worded. Here is a screenshot of all of the choices.




    Let's just go through them and consider what they mean. Remembering that these are conditions, the wording on some of the choices are strange. Nevertheless, you can properly condition an event on the value of a counter
    1. A Counter's value becomes this: - This reads more like a trigger than a condition. In fact this is just poor wording, it would more correctly worded "A Counter's value is this:". Testing proves that this condition is true when the counter matches the value.
    2. A Counter's value is this or a multiple of this: - makes perfect sense. If you chose a value of 3, the condition would be true of the counter was 3, 6, 9, 12, etc.
    3. A Counter's value has exceeded this: - again straight forward, if you set the value as 3 it will be true when the counter is 4 or above.
    4. A Counter's value has exceeded this or a multiple of this: - this one is a little redundant. If you set the value to be 3 (or any number) once it has "exceeded this" the condition would be true. "a multiple of this" would ALWAYS "exceed this".
    5. A Counters value is this absolute value: - another one that is fairly clear, if you set the value to 3 it would be true if the counter's value is also 3. Since counters can be decremented to a negative number, it would also be true if the counter's value was -3. Absolute value can best be described as "distance from 0", so a negative value is treated as the same positive value.
    6. A counter is this or a multiple of this absolute value: The same as number 2 above, except the value is evaluated as as its absolute value regardless of whether it is positive or negative.
    7. A Counter's value has exceeded this absolute value: - the same as number 3 above, except the value is evaluated as as its absolute value regardless of whether it is positive or negative. if you set the value as 3 it will be true when the counter is greater than 3 or less than -3.
    8. A Counter's value has exceeded this or a multiple of this absolute value: - like number 4 above this one is also redundant. If you set the value to be 3 (or any number) once it has "exceeded this" the condition would be true. "a multiple of this" would ALWAYS "exceed this". The difference from number 4 is that the value is evaluated as absolute.


    I'm not sure when having an absolute value as a condition would see real world usage, but it is there if you need it.


    After you have selected the condition, the window will be populated with a new line where you can choose among counters you have already created.





    Or you can click on "Create/Edit Counters and you will be presented with a dialogue box allowing you to create a new Counter or to choose an existing counter. If you try to create a counter with the same name as an existing counter, you will be notified that it exists and you can choose a new name. Be very careful cutting from another document and pasting into this name. If you paste a character that does not belong to the basic ASCII character set, you can corrupt the counter database.





    If you click the same button with a Counter already selected, the dialogue box changes, allowing you to rename the timer, choose another or to create a new counter. As above be very careful cutting from another document and pasting into these windows. If you paste a character that does not belong to the basic ASCII character set, you can corrupt the counter database.






    Counters can be very useful and their values can be manipulated through an event's action. We will cover how they can be controlled later in posts covering Actions.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    #2
    condition/trigger "less than"

    Hi,

    counters can be increased and decreased. However, triggers and conditions only consider exceeding a threshold. It would be nice if also "less than" (undershoot) would be possible.

    This would make it easier for countdown counters, e.g. counting down left SMS messages in my pre-paid SMS budget.

    I know, this can also be done with increasing counters, but that is a non-intuitive way of programming.

    Maurice

    Comment


      #3
      Originally posted by mo046 View Post
      Hi,

      counters can be increased and decreased. However, triggers and conditions only consider exceeding a threshold. It would be nice if also "less than" (undershoot) would be possible.

      This would make it easier for countdown counters, e.g. counting down left SMS messages in my pre-paid SMS budget.

      I know, this can also be done with increasing counters, but that is a non-intuitive way of programming.

      Maurice
      You are better off putting that request here http://bugzilla.homeseer.com/bugzilla/ or add your comments to this similar one here http://bugzilla.homeseer.com/bugzill...ug.cgi?id=2444

      Or alternatively you can use a device value and just use the device value actions (less than) to trigger your events.

      Comment


        #4
        randy did you make some changes to your website? The top post in this thread has images that won't appear for me and the URL for the images all point to your personal website. I get error connecting using the browser developer tools.

        Comment


          #5
          It is due to my not having installed a certificate and changes in browser security. Usually affects Chrome and can easily be changed in settings. Safari, Explorer and Edge all work without issue. Some day I may install a certificate, but it is not at the top of my to do list.
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment

          Working...
          X