Announcement

Collapse
No announcement yet.

Counters in Events Break the Event

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

    Counters in Events Break the Event

    Just got my system today and the first thing I wanted to setup was an event to turn on/off my outside Christmas lights at sunset/sunrise.

    I got everything installed (HS3, Insteon plug-in, PLM, outdoor plug-in on/off modules, and Insteon mini remote). I got the event configured for the times I want and I decided to add some additional logic in case I wanted to manually turn the lights on or off using the mini remote. It was easy enough with the OR IF conditional. So now the sunset/sunrise and mini remote are working just fine (or at least I'll find out in the morning if sunrise is working).

    Now I started to think about after the season when I unplug and pack away the Insteon outdoor plug-in on/off modules. HS3 will still be firing those sunset/sunrise events and lowering the "comm reliability" of the unplugged devices. Not really an awful thing, but something I'd like to avoid. My first thought was to create a Global Variable as a boolean and make it a condition of the event (true=turn on/off and false=don't do anything for the off-season). Alas, I can't reference Global Variables in event conditionals as well as they are not carried over between restarts of HS3. I did notice that I could use a counter and counters said nothing about being stateless (so I presume they are stateful?). So, I'll simply set the counter to 0 in the off-season and 1 during the holidays.

    The problem I'm running into now is that no matter how I configure the counter in the event conditional, the event never fires. When I remove the counter conditional (leaving the remaining conditional items), the event fires. I feel like I'm missing something obvious here, but I just can't see it. Any help would be greatly appreciated!

    I'm running HS3 Pro Edition 3.0.0.548.

    #2
    Check out Virtual Switches. A very powerful tool.

    Most people with create a virtual switch (call it "Christmas Time"), and set the virtual switch to "on" on December 1 and "off" on December 26 (or January 1). Then add a condition to your light "turn on" event to check the status of that virtual switch.

    I also have a "Manual" virtual switch that is checked in all of my time events. That way I can easily disable the schedule, say for a party or other special event.

    I think my virtual switch count is up to around 40.

    Comment


      #3
      Originally posted by Hossy View Post
      I feel like I'm missing something obvious here, but I just can't see it. Any help would be greatly appreciated!
      Welcome to the HS Board.

      I agree with the previous post that the most direct way to do what you want is to create a HS device (usually referred to on the Board as a 'virtual' device, because it has no corresponding physical device associated with it) and use it as a binary variable or switch.

      With regard to the counter: they don't behave quite the way one would expect - as you've noticed.
      In the General tab of Tools/Settings, under 'Other Settings' there is an option for creating devices for counters and timers. If you tic that box you should see a new device for each counter and timer you create. (You can delete the ones you don't need or just ignore them.) The device that corresponds to your counter should work the way you intend in your event, but a virtual device is a good deal simpler solution, I think.

      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        Originally posted by Hossy View Post
        Just got my system today and the first thing I wanted to setup was an event to turn on/off my outside Christmas lights at sunset/sunrise.

        I got everything installed (HS3, Insteon plug-in, PLM, outdoor plug-in on/off modules, and Insteon mini remote). I got the event configured for the times I want and I decided to add some additional logic in case I wanted to manually turn the lights on or off using the mini remote. It was easy enough with the OR IF conditional. So now the sunset/sunrise and mini remote are working just fine (or at least I'll find out in the morning if sunrise is working).

        Now I started to think about after the season when I unplug and pack away the Insteon outdoor plug-in on/off modules. HS3 will still be firing those sunset/sunrise events and lowering the "comm reliability" of the unplugged devices. Not really an awful thing, but something I'd like to avoid. My first thought was to create a Global Variable as a boolean and make it a condition of the event (true=turn on/off and false=don't do anything for the off-season). Alas, I can't reference Global Variables in event conditionals as well as they are not carried over between restarts of HS3. I did notice that I could use a counter and counters said nothing about being stateless (so I presume they are stateful?). So, I'll simply set the counter to 0 in the off-season and 1 during the holidays.

        The problem I'm running into now is that no matter how I configure the counter in the event conditional, the event never fires. When I remove the counter conditional (leaving the remaining conditional items), the event fires. I feel like I'm missing something obvious here, but I just can't see it. Any help would be greatly appreciated!

        I'm running HS3 Pro Edition 3.0.0.548.
        1. Can you post a screenshot of the event broken by the counter?
        2. As was written above, a virtual device is the easiest solution. Read here. That thread should explain how you can configure a Virtual Device to meet any need, whether for storing a value or being controlled. They are quite powerful. Virtual Devices are actually Global Variables that are persistent. Their values are stored in the HS database, so the value will survive a restart. They can be configured to store any numeric value, can be treated as a boolean or store a string for any Event.
        HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          Thank you everyone for the replies and the welcome! I think I agree with the virtual device option and will try that now, but I definitely want to explore (for later, more complex operations) the suggestion by Uncle Michael about enabling the creation of devices for counters/timers!

          Comment


            #6
            Originally posted by rprade View Post
            1. Can you post a screenshot of the event broken by the counter?
            Click image for larger version

Name:	screenshot-172.16.0.100-2019.12.png
Views:	99
Size:	73.1 KB
ID:	1345296

            Comment


              #7
              I don’t trust group conditions. They have had any number of issues over the years. What happens if you use the counter as a condition instead of as a group condition? While they generally work with Devices, I remember some problems with counters and timers.
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment


                #8
                Originally posted by rprade View Post
                I don’t trust group conditions. They have had any number of issues over the years. What happens if you use the counter as a condition instead of as a group condition? While they generally work with Devices, I remember some problems with counters and timers.
                The same failure happens whether I use the counter as shown in Group Conditions or individual conditions -- it always resolves to FALSE.

                Comment


                  #9
                  Originally posted by Hossy View Post
                  The same failure happens whether I use the counter as shown in Group Conditions or individual conditions -- it always resolves to FALSE.
                  Can you post a screen shot of the event with the counter as an individual condition? Are you using the associated device value as the condition?

                  Mike____________________________________________________________ __________________
                  HS3 Pro Edition 3.0.0.548, NUC i3

                  HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                  Comment

                  Working...
                  X