Announcement

Collapse
No announcement yet.

Counter default value when reset

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

    Counter default value when reset

    I'm using counters as flags in the system to determine whether some functionality is on or off.

    Scenario:
    I have a multisensor in the bathroom that senses humidity. When humidity increases > 60% turn on the bath fan. (normal operation).

    Now, if I want to turn this feature on or off, I can set my counter to 1(on), or 0 (off). Ideally I want the system to default to 1(on) on a restart. (Yes, I know I can put something in the startup script), but...

    On the Counters page, there's a statement "Increment and Decrement are by '1', and Reset is to '0', unless another value is entered here: <box>"

    3 questions:

    1) Is this box supposed to change the increment or decrement value? (ie, increment by 2... 2, 4, 6, 8 , etc..)

    2) OR is this box supposed to change the default value when reset is used? (ie, reset to 1, instead of 0)

    3) Does this box DO anything? If I put a value in there, it just seems to be lost.
    -- if I put 2 in the box, increment and decrement are still by 1, and reset goes to 0. The box is cleared when I click increment, decrement, or reset. I don't get it. There's no "Done" button at the bottom to commit anything, just the "Submit" when I put in my value.

    #2
    Counters (and timers) do not default at a restart. Counters will retain their value and timers will continue to run even when HomeSeer is not running. All other devices will retain their values over a restart, unless you have a power failure or other disorderly shutdown. If you want a counter (or timer or device) at a predefined value at startup, you will need to handle that with a startup event or code within the startup script.

    The box on the counters page apparently no longer works. If I remember correctly it did work at one time, but I do not have the need to control counters outside of events, so I rarely visit that page. I will sometimes increment or decrement a counter when testing events, but I haven’t visited that page in a very long time. The increment, decrement and reset buttons work as they should.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Originally posted by mjgtp View Post
      I'm using counters as flags in the system to determine whether some functionality is on or off.

      Scenario:
      I have a multisensor in the bathroom that senses humidity. When humidity increases > 60% turn on the bath fan. (normal operation).

      Now, if I want to turn this feature on or off, I can set my counter to 1(on), or 0 (off). Ideally I want the system to default to 1(on) on a restart. (Yes, I know I can put something in the startup script), but...

      On the Counters page, there's a statement "Increment and Decrement are by '1', and Reset is to '0', unless another value is entered here: <box>"

      3 questions:

      1) Is this box supposed to change the increment or decrement value? (ie, increment by 2... 2, 4, 6, 8 , etc..)

      2) OR is this box supposed to change the default value when reset is used? (ie, reset to 1, instead of 0)

      3) Does this box DO anything? If I put a value in there, it just seems to be lost.
      -- if I put 2 in the box, increment and decrement are still by 1, and reset goes to 0. The box is cleared when I click increment, decrement, or reset. I don't get it. There's no "Done" button at the bottom to commit anything, just the "Submit" when I put in my value.

      you need to create an event to control the counter.....increment counter by....moves the counter by the number you supply. so if your counter is currently 0, and you have increment by 4...then the counter everytime it is tripped would go 4,8,12 etc.


      then there is "increment" counter always increments by "1"



      for example lets say I want to increment a counter everytime a light comes on. my event would look like this.


      if "light" is on
      then increment counter light "this will move my counter by 1"



      now the light is set to on 5 times = the counter will equal 5




      lets say I want the counter to advance by 3 everytime the light comes on...


      if light becomes on
      then increment counter by 3 "this will move my counter by 3"



      now the light is set to on 5 times = the counter will equal 15

      Comment


        #4
        I use vDevices to enable/disable events. It simply becomes a condition in any event you decide to use it it.





        Sent from my SM-G950U using Tapatalk

        Comment


          #5
          Yep, all good info. Really my question was around that textbox on the counters page, whether it was working as designed...and what was the intent of it.

          I have my default counter values initialized in startup. Really wanted a on/off behavior (like VDs), but didn't want all that overhead for something so minimal. Not to mention it's yet ~another~ device to clutter up the devices page.

          For those of you using virtual devices for your on/off features.... how do you keep them separated from the rest of your actual devices? Just using location 1 & 2, hiding them on the page? Have you maybe modified the devices page, or created a second one, to not show them?

          Comment


            #6
            Originally posted by mjgtp View Post
            Yep, all good info. Really my question was around that textbox on the counters page, whether it was working as designed...and what was the intent of it.

            I have my default counter values initialized in startup. Really wanted a on/off behavior (like VDs), but didn't want all that overhead for something so minimal. Not to mention it's yet ~another~ device to clutter up the devices page.

            For those of you using virtual devices for your on/off features.... how do you keep them separated from the rest of your actual devices? Just using location 1 & 2, hiding them on the page? Have you maybe modified the devices page, or created a second one, to not show them?
            As I wrote above the box on the counters page used to work where you could set a counter to a value by entering it in the box. That no longer works.

            I have quite a number of virtual devices and I separate them by using different locations or hiding them. I have some lighting groups with a number of virtual devices for default levels, motion control, etc. I group all of the devices using Jon00’s device grouping script. Then the group is located by “Lighting Defaults” and room. I do not use “Room” and “Floor” for locations, instead opting for “Functional Group” (Lighting, Lighting Defaults, Power, utility, etc.) and “Room Location Subfunction”. I view devices in the Device Manager I filter only on devices I want to see. This makes it easy to select all devices used for “Heating” or only “Heating” “Valve Actuator”. I described it here, here and here.
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7

              Comment

              Working...
              X