Announcement

Collapse
No announcement yet.

Event After Time Has Passed, But Conditions Still Met

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

  • Event After Time Has Passed, But Conditions Still Met

    Greetings,

    I see that I can add a "Wait..." or a "After Waiting..." value to my events, however I am wondering if they will still execute if the conditions required for that event are no longer applicable.

    Here is my use case:

    I want to set my thermostat (Nest) into away mode only after being away for 4 Hours. If however I get back before 4 hours has past and homeseer is no longer in "Away Mode", would it still execute after the remaining time?

  • #2
    Welcome to the HomeSeer Board. You can create an event (or sequence of events) that will behave as you want. I'd suggest reading through the Event Clinic as a starting point. Come back with specific questions if you get stuck.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548

    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


    • #3
      As an example, here is an event I use to wait until we have left to continue setting up the house after we arm the alarm. Note that the event is set to run only if the conditions are true. So, in this case, if we forgot something, say, and came back an canceled the alarm, it will not run.

      Click image for larger version

Name:	confirm.PNG
Views:	96
Size:	109.9 KB
ID:	1326007
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548

      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


      • #4
        I found that to be problematic when i created events, adding Then Wait (x time) as a step as a separate items worked but not the top option at the bottom of an event. If the option posted by Uncle Michael doesn't work for some reason then try the wait step.Click image for larger version  Name:	Annotation 2019-09-12 154318.png Views:	0 Size:	86.8 KB ID:	1326014

        Comment


        • #5
          Originally posted by Uncle Michael View Post
          As an example, here is an event I use to wait until we have left to continue setting up the house after we arm the alarm. Note that the event is set to run only if the conditions are true. So, in this case, if we forgot something, say, and came back an canceled the alarm, it will not run.

          Click image for larger version

Name:	confirm.PNG
Views:	96
Size:	109.9 KB
ID:	1326007
          I think my question was not conveyed correctly

          I am aware of the wait function - however if after the wait time has passed and the conditions are no longer met (in this case, I have returned home) I no longer wanted the event to finish executing.

          Comment


          • #6
            Originally posted by Socks View Post

            I think my question was not conveyed correctly

            I am aware of the wait function - however if after the wait time has passed and the conditions are no longer met (in this case, I have returned home) I no longer wanted the event to finish executing.
            Uncle Michael's example would do what you're looking for. It will wait the prescribed period (3m, 30s in his example), then run the 2nd event (Security Confirm Armed State). If the conditions in the 2nd event are not met, then it won't fire. His statement that he's set it to only run the event if the conditions are true is critical. That's a setting in the first event action where the 2nd event is called.
            -Wade

            Comment


            • #7
              Originally posted by Feral View Post
              If the option posted by Uncle Michael doesn't work for some reason then try the wait step.
              I would avoid a wait action longer than a few minutes.

              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548

              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


              • #8
                Originally posted by Socks View Post
                I am aware of the wait function - however if after the wait time has passed and the conditions are no longer met (in this case, I have returned home) I no longer wanted the event to finish executing.
                A wait action and the delayed execution of an event are not the same (see Event Clinic). A critical advantage of a delayed event is that you can explicitly require the event conditions to be true for the event to run after the delay.

                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.548

                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
                  Originally posted by Socks View Post

                  I think my question was not conveyed correctly

                  I am aware of the wait function - however if after the wait time has passed and the conditions are no longer met (in this case, I have returned home) I no longer wanted the event to finish executing.
                  Do you have a way to determine when you are away? I would just keep it simple and base it on the amount of time that your device has changed to Away.

                  -If Away device has been away for exactly 4 hours
                  -And if Nest Thermostat status is not in Away mode
                  -Then set Nest Thermostat to Away

                  If you were to come home before the 4 hours then your thermostat won’t go into away mode. Does this cover all of the conditions you are looking for?


                  Sent from my iPad using Tapatalk
                  HS3 3.0.0.500 &HSTouch Designer 3.0.71 with 782 Devices, 479 Events
                  Plugin's:
                  BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee,
                  EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                  weatherXML, Jon00 Alexa Helper, Network Monitor, Z-Wave 3.0.1.252

                  Comment


                  • #10
                    Originally posted by Uncle Michael View Post
                    A critical advantage of a delayed event is that you can explicitly require the event conditions to be true for the event to run after the delay.
                    Additionally, you can remove/delete the delayed event upon returning home.

                    Comment


                    • #11
                      Originally posted by Uncle Michael View Post
                      As an example, here is an event I use to wait until we have left to continue setting up the house after we arm the alarm. Note that the event is set to run only if the conditions are true. So, in this case, if we forgot something, say, and came back an canceled the alarm, it will not run.

                      Click image for larger version

Name:	confirm.PNG
Views:	96
Size:	109.9 KB
ID:	1326007
                      This actually did answer my question. This is the exact solution I was looking for - a few extra steps, but it works.

                      Thank you all for your help - my issue has been resolved leveraging the above method in the quote.

                      Comment


                      • #12
                        Originally posted by Socks View Post

                        This actually did answer my question. This is the exact solution I was looking for - a few extra steps, but it works.

                        Thank you all for your help - my issue has been resolved leveraging the above method in the quote.

                        Assuming you're using a 4 hour delay instead of the example's 3 hour 30 second, consider what happens if you leave (Arm Away), then come back in, say, a half-hour, then leave (Arm Away) again at the 1 hour mark.
                        You would end up with the main event triggering twice (the first time you Arm Away) and then again when you leave at the hour mark.
                        In this case, it seems the "After waiting 4 hours" event would also trigger twice/ I.e., at the 4 hour mark from the first departure then again at the 5 hour mark based on the second departure. If this is unacceptable in your scenario, you might need to use the cancel delayed event function mentioned in post 10 to cancel the delayed event. Basically, every time the "main" (i.e., first) event in the series triggers, the first thing you do is perform a cancellation on all of the potential delayed sub-events (if there are none delayed, then I think this does nothing), then if you happen to have a command that re-runs the sub-event, you should only have 1 outstanding instance of that "delayed" event waiting.

                        Comment


                        • #13
                          I would agree with jvm, when using the wait, you will have to make sure to cancel the first trigger. However, it seems to me that if you just set the trigger to "If the house has been in Away Mode for exactly 4 hours" you won't have a 4 hour "Wait" nor will you have an event that you need to cancel. No need to make events more complicated than they need to be.
                          HS3 3.0.0.500 &HSTouch Designer 3.0.71 with 782 Devices, 479 Events
                          Plugin's:
                          BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee,
                          EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                          weatherXML, Jon00 Alexa Helper, Network Monitor, Z-Wave 3.0.1.252

                          Comment


                          • #14
                            Originally posted by jvm View Post


                            Assuming you're using a 4 hour delay instead of the example's 3 hour 30 second, consider what happens if you leave (Arm Away), then come back in, say, a half-hour, then leave (Arm Away) again at the 1 hour mark.
                            You would end up with the main event triggering twice (the first time you Arm Away) and then again when you leave at the hour mark.
                            . . .Basically, every time the "main" (i.e., first) event in the series triggers, the first thing you do is perform a cancellation on all of the potential delayed sub-events (if there are none delayed, then I think this does nothing), then if you happen to have a command that re-runs the sub-event, you should only have 1 outstanding instance of that "delayed" event waiting.
                            You are correct.

                            Three points, though, are worth noting:
                            1. I deliberately did not include all details, but referred the OP to the Event Clinic. There are several subtle complexities in setting this up correctly, but I wanted to address the primary question and leave the details for another time.
                            2. In my example, the delay is 3 and a half minutes. I do not expect to be able to change my mind, reenter the house, disable the alarm, then rearm the system in that amount of time, so I did not provide for that eventuality.
                            3. If there is a possibility of the situation you describe, the way to deal with it is to include as the first action of the primary event, a cancellation of the delayed event. That is included in the more thorough explanation in the Event Clinic topic. (In the scenario described, though, it would probably not be a significant issue, since a brief return during a 4 hour period probably wouldn't alter the initial intent, and having the thermostat placed into 'Away' mode a redundant second time is unlikely to create a problem, but you are absolutely right, in the general case it does need to be addressed.)
                            In post #10 there is another important point. When returning home there should be an event that deletes the delayed event if it is still active, which would also help to avoid unintended consequences.
                            Mike____________________________________________________________ __________________
                            HS3 Pro Edition 3.0.0.548

                            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


                            • #15
                              Originally posted by The Profit View Post
                              I would agree with jvm, when using the wait, you will have to make sure to cancel the first trigger. However, it seems to me that if you just set the trigger to "If the house has been in Away Mode for exactly 4 hours" you won't have a 4 hour "Wait" nor will you have an event that you need to cancel. No need to make events more complicated than they need to be.
                              One of the great things about HS is the variety of ways it enables to address a situation and/or solve a problem. I agree, that if the real situation is as straightforward as the example described, your simpler solution may very well be preferable.
                              Mike____________________________________________________________ __________________
                              HS3 Pro Edition 3.0.0.548

                              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

                              Working...
                              X