Announcement

Collapse
No announcement yet.

Trigger for time periods that span two years...

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

  • Trigger for time periods that span two years...

    I am trying to wrap my head around a way to create a prompter for my wife that gives the probability of frost in our area. I have the dates, but not the logic. For instance, if I set a time where we could see 70% chance of frost it might be from October 15th of every year to March 15th of every year. I can't use 10/15/Y to 3/15/Y because that is a range of EVERY year and includes every time, ever. Is there a PI that will do the heavy lifting? Or have I missed something in the event engine? Script only? Thoughts?
    HomeSeer Version: HS3 Pro Edition 3.0.0.500
    Operating System: Microsoft Windows 10 Pro - Work Station

    Enabled Plug-Ins:
    2.1.0.119: AmbientWeather | 3.0.21.0: BLLock | 2.0.24.0: BLUPS | 1.3.6.0: Device History | 3.0.0.56: EasyTrigger | 3.1.0.7: MeiHarmonyHub | 3.0.6681.34300: UltraCID3 | 3.0.6644.26753: UltraLog3 | 3.0.6554.33094: UltraMon3 | 3.0.0.91: weatherXML | 3.0.1.245: Z-Wave | 3.0.51: HS Touch Designer | 3.0.0.40 Z-Seer+

  • #2
    You cannot use a date range like that for a trigger, as the trigger would occur every second from Oct 15 through Mar 15. Performance would suck during that time of year.

    So your trigger will need to be something like a specific time of day, say 8pm. Then you would have a condition after the trigger ("andif") that would have the date specification. Since you have two dates, you will need two triggers and conditions:

    If Time is 8pm -- Trigger
    AndIf Date is greater than 10/15/Y -- Condition
    OrIf Time is 8pm -- Second trigger
    AndIf Date is less than 3/15/Y - second condition
    Then speak "It is getting frosty out there"

    (In case it is not obvious, the first statement, the "If" or "OrIf" in an event declaration is a trigger, and should be a single moment in time. The "AndIf" statements are conditions that must also be met in order for that event to proceed.)

    Comment


    • #3
      I guess I wasn't terribly clear. I knew that the actual trigger would have to be a point in time. The problem I am having is that I need something that says essentially:


      If Time is 8pm -- Trigger
      AndIf Date is greater than 10/15/lastYear -- Condition
      OrIf Time is 8pm -- Second trigger
      AndIf Date is less than 3/15/thisYear - second condition
      Then speak "It is getting frosty out there"

      A date range formatted like 10/15/Y or 3/15/Y basically says "of ANY year present or past." It sees no distiction between > 10/15/2018 | < 3/15/2019 and > 10/15/2009 | < 3/15/2029
      HomeSeer Version: HS3 Pro Edition 3.0.0.500
      Operating System: Microsoft Windows 10 Pro - Work Station

      Enabled Plug-Ins:
      2.1.0.119: AmbientWeather | 3.0.21.0: BLLock | 2.0.24.0: BLUPS | 1.3.6.0: Device History | 3.0.0.56: EasyTrigger | 3.1.0.7: MeiHarmonyHub | 3.0.6681.34300: UltraCID3 | 3.0.6644.26753: UltraLog3 | 3.0.6554.33094: UltraMon3 | 3.0.0.91: weatherXML | 3.0.1.245: Z-Wave | 3.0.51: HS Touch Designer | 3.0.0.40 Z-Seer+

      Comment


      • #4
        Have you tried it? I think you will find that the event will do its thing only between Oct 15 and Mar 15. It will not run on Oct 14, or Mar 16. The year is irrelevant with those conditions as specified (unless you have installed Homeseer in a Tardis).

        Create the event, and see. Since we are outside that range, it will not fire.

        When specifying the date, be sure to check "Any year".

        Comment


        • #5
          Originally posted by ewkearns View Post
          A date range formatted like 10/15/Y or 3/15/Y basically says "of ANY year present or past." It sees no distiction between > 10/15/2018 | < 3/15/2019 and > 10/15/2009 | < 3/15/2029
          I think I see your confusion. You are thinking if you specify > 10/15/Y, then any day in 2020 will be greater than that. Not how it works.

          What HS probably does (I am not privy to the internal workings of course) is substitute the current year for the Y. So it would substitute 2019 this year. Come next January 1, HS will start substituting 2020 for the year. So the test currently is: Is Current date (3/30/2019) less than 3/15/2019. Come January 1, the test will become: is current date 1/1/2020 less than 3/15/2020.

          When testing, remember that a manual invoking of an event will ignore all conditions.

          Comment


          • #6
            From my post on date conditions in the Event Clinic forum covering almost the same date range:

            A date begins at 12:00:01 AM and ends at 11:59:59 PM. The condition "The date is before" is true until 12:00:00 AM on that date, similarly "The Date is After" is true after midnight on that date. There is a tremendous amount of flexibility in these conditions, but first we should cover one nuance similar to time events. HomeSeer assumes the year begins and ends at midnight on December 31, when you are choosing "Any Year" and when you choose “The date is before” you need to understand that the year begins at 12:00AM on January 1 making the statement “The date is before March 1” really means the date is after December 31 but before March 1. Similarly “The date is after October 31” assumes it is before January 1.

            The only way to have a time condition based upon "Any Year" that spans the December 31 dividing line is to use two separate trigger/conditions. To have the condition cover the time span from October 31 until March 1 is to use a more complex event construction tool, the “OR IF”. That is a topic we will cover later in building events, but it is in its simplest form:

            IF Trigger
            AND IF The date is after 10/31/Y

            OR IF Trigger
            AND IF The date is before 3/1/Y

            If you choose specific years as in the following example, HomeSeer knows to ignore the end of the year.

            IF Trigger
            AND IF The date is after 10/31/14
            AND IF The date is before 3/1/15
            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


            • #7
              Thanks for the clarification, guys. I *had* tried it, but I must have bollixed up something else.... I'll attack the problem, again....
              HomeSeer Version: HS3 Pro Edition 3.0.0.500
              Operating System: Microsoft Windows 10 Pro - Work Station

              Enabled Plug-Ins:
              2.1.0.119: AmbientWeather | 3.0.21.0: BLLock | 2.0.24.0: BLUPS | 1.3.6.0: Device History | 3.0.0.56: EasyTrigger | 3.1.0.7: MeiHarmonyHub | 3.0.6681.34300: UltraCID3 | 3.0.6644.26753: UltraLog3 | 3.0.6554.33094: UltraMon3 | 3.0.0.91: weatherXML | 3.0.1.245: Z-Wave | 3.0.51: HS Touch Designer | 3.0.0.40 Z-Seer+

              Comment


              • #8
                Another way to do this would be to turn on a virtual device on October 15 and turn it off on March 15. You could then use the status of that device as a condition.
                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.500

                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


                • #9
                  I did get it working. What I was missing, I believe, were the two triggers. Once I employed them, the logic worked as expected. Thanks, again!
                  HomeSeer Version: HS3 Pro Edition 3.0.0.500
                  Operating System: Microsoft Windows 10 Pro - Work Station

                  Enabled Plug-Ins:
                  2.1.0.119: AmbientWeather | 3.0.21.0: BLLock | 2.0.24.0: BLUPS | 1.3.6.0: Device History | 3.0.0.56: EasyTrigger | 3.1.0.7: MeiHarmonyHub | 3.0.6681.34300: UltraCID3 | 3.0.6644.26753: UltraLog3 | 3.0.6554.33094: UltraMon3 | 3.0.0.91: weatherXML | 3.0.1.245: Z-Wave | 3.0.51: HS Touch Designer | 3.0.0.40 Z-Seer+

                  Comment

                  Working...
                  X