Announcement

Collapse
No announcement yet.

Event Condition Sequence

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

    Event Condition Sequence

    I have certain conditions when I want to trigger and event, e.g. when coming home I want to control lights based on the time of day. So I created an event with the condition

    IF This event is MANUALLY triggered
    AND IF The time is 1h, 0m before sunset
    AND IF The time is 30m after sunrise

    That all works fine if I enter the conditions in the listed sequence (see the bottom part of the attached image).

    However, in another instance I first entered the time condition

    AND IF The time is 1h, 0m before sunset
    AND IF The time is 30m after sunrise

    Then I wanted to add the "IF This event is MANUALLY triggered". However, it is not available as you can see in the dropdown list of the screenshot. So my questions are:

    * Why is it not available?
    * How can I rearrange the sequence without having to redo everything (sometimes I have similar events with different criteria but when entering it I often choose (not by intention) a different sequence. I would be nice to rearrange the sequence so it's easy to see any potential differences.
    Attached Files

    #2
    Originally posted by mulu View Post
    I have certain conditions when I want to trigger and event, e.g. when coming home I want to control lights based on the time of day. So I created an event with the condition

    IF This event is MANUALLY triggered
    AND IF The time is 1h, 0m before sunset
    AND IF The time is 30m after sunrise

    That all works fine if I enter the conditions in the listed sequence (see the bottom part of the attached image).

    However, in another instance I first entered the time condition

    AND IF The time is 1h, 0m before sunset
    AND IF The time is 30m after sunrise

    Then I wanted to add the "IF This event is MANUALLY triggered". However, it is not available as you can see in the dropdown list of the screenshot. So my questions are:

    * Why is it not available?
    * How can I rearrange the sequence without having to redo everything (sometimes I have similar events with different criteria but when entering it I often choose (not by intention) a different sequence. I would be nice to rearrange the sequence so it's easy to see any potential differences.
    "AND IF" is a condition, so it cannot be a trigger. If you want a second trigger in a single event, it must be "OR IF". You might look at this thread in the Event Clinic forum.

    Also looking at this event:
    IF This event is MANUALLY triggered
    AND IF The time is 1h, 0m before sunset
    AND IF The time is 30m after sunrise
    This will never work. If you run it manually the conditions are ignored to the action will be launched. However the time can never be 1h, 0m before sunset AND 30m after sunrise, so if the conditions are honored, it will not run.

    Additionally a Manually Triggered event with a condition "The time is 1h, 0m before sunset" would only run if you triggered at that exact time. Even though time in HomeSeer is expressed as HH:MM or HH:MM:SS, behind the scenes it is down to microseconds, making it virtually impossible to trigger an event at an exact time, unless the exact time IS the trigger.

    You also might be misunderstanding a manual trigger. This post might help"

    Last edited by randy; October 14, 2017, 11:32 PM.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Randy,

      Thanks for the reply. So basically

      * Each OR/OR IF is a trigger. A trigger is something that happens at a VERY specific time. It's virtually impossible that two triggers happen at the same time, hence HomeSeer only allows one trigger like door was opened, light turned on, etc.
      * Each AND IF is a condition. A condition is something that lasts for a period of time. To take the same examples as above, it would be the door is open, the light is on, etc.
      * A trigger is defined by an OR/OR IF so it's always at the top of a group.
      * A condition always required a trigger and hence comes after an OR/OR IF statement.

      This all makes sense now but it surely is not very intuitive.

      As for my impossible even, what I tried to achieve is that certain lights come on if an event happens between 1 hour before sunset and 30 minutes after sunrise, i.e. during night time but modifying the reference points a bit. I now see that approach is wrong because the reference point is the current time (same day) so the condition is impossible to meet. For now I selected nighttime. If I really feel the need to modify the sunset/sunrise points then I guess I have to work with some OR IFs.

      The only item I am not quite sure about yet is your comment that a manually triggered event will ignore conditions. On one hand I see the argument that if you "manually" tell an event to run then it should simply run. But why that restriction? Here is my scenario. I have a camera outside. When this camera sees motion it sends a signal to HomeSeer, i.e. triggers an event. This event will check the time and if it is night time it will execute my "manual" event to turn on certain lights. Based on your comment this will probably work because my "turn on certain lights on" is being triggered by an action. However, why would you restrict this to that scenario short of certain testing scenarios.

      Comment


        #4


        If you want the conditions to be checked when you manually run the event @rprade mentioned you can check the box above. That has worked for me in the past

        Comment


          #5
          Originally posted by mulu View Post
          For now I selected nighttime. If I really feel the need to modify the sunset/sunrise points then I guess I have to work with some OR IFs.
          In situations like this I define a virtual device to capture the time interval of interest. In your case, one event would turn the device on an hour before sunset and another event would turn it off 30 min after sunrise. Then you can use the status of that device as a condition on other events, so they only run when the device is on. You can also use EasyTrigger to define a time span.
          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


            #6
            You can use EasyTrigger to do something like this. This will run if the time is after sunset - 30 minutes when you call it.
            Attached Files

            Comment


              #7
              Originally posted by mulu View Post
              Randy,

              Thanks for the reply. So basically

              * Each OR/OR IF is a trigger. A trigger is something that happens at a VERY specific time. It's virtually impossible that two triggers happen at the same time, hence HomeSeer only allows one trigger like door was opened, light turned on, etc.
              * Each AND IF is a condition. A condition is something that lasts for a period of time. To take the same examples as above, it would be the door is open, the light is on, etc.
              * A trigger is defined by an OR/OR IF so it's always at the top of a group.
              * A condition always required a trigger and hence comes after an OR/OR IF statement.

              This all makes sense now but it surely is not very intuitive.

              As for my impossible even, what I tried to achieve is that certain lights come on if an event happens between 1 hour before sunset and 30 minutes after sunrise, i.e. during night time but modifying the reference points a bit. I now see that approach is wrong because the reference point is the current time (same day) so the condition is impossible to meet. For now I selected nighttime. If I really feel the need to modify the sunset/sunrise points then I guess I have to work with some OR IFs.

              The only item I am not quite sure about yet is your comment that a manually triggered event will ignore conditions. On one hand I see the argument that if you "manually" tell an event to run then it should simply run. But why that restriction? Here is my scenario. I have a camera outside. When this camera sees motion it sends a signal to HomeSeer, i.e. triggers an event. This event will check the time and if it is night time it will execute my "manual" event to turn on certain lights. Based on your comment this will probably work because my "turn on certain lights on" is being triggered by an action. However, why would you restrict this to that scenario short of certain testing scenarios.
              You have gotten some good answers. Let me go through a few points you raised.
              • When you wrote OR/OR IF it is actually IF/OR IF, both being triggers within the same event. All triggers are going to fire at a single "moment in time", but there are a few that can trigger repeatedly (once a second) unless there is a condition changed within the event that stops it from running. Here are three, there may be another I am not thinking of
                • A Device has been for at least... will continually trigger when the value is true and has been for more than the time parameter in the trigger -
                  until the device changes value.
                • A Timer's value is greater than will trigger once a second as long as the timer continues to run
                • A Counter's value has become greater than, will trigger every time the counter's value is changed as long as it remains greater than the value in the trigger
              • You can have 5 events with an identical trigger and all 5 will be triggered
              • You can have a single event with 5 identical triggers and it will only run once when the trigger is true and if the conditions applied to the trigger are true. Even if the trigger and condition(s) are true on more than one set, the event will only run once
              • There are primarily four ways a manually triggered event can be run
                • If it is run from the Event Management page run button, in which case the conditions will ALWAYS be ignored
                • If it is run from an Alexa command, the conditions will also ALWAYS be ignored
                • If it is run from HSTouch, either with the default project or a custom project, the conditions will ALWAYS be ignored
                • If it is run from the action of another event, the conditions will be ignored by default, but the action can be configured to "Run Only If Other Event Conditions are TRUE" as Tyborg illustrated

              If you want to use HomeSeer's built in conditions, it is impossible to have an offset from Sunset or Sunrise in the conditions. The event would be

              Click image for larger version

Name:	Capture1.PNG
Views:	1
Size:	21.6 KB
ID:	1192702

              If you want to condition an event with offsets before sunset and after sunrise with HomeSeer's built in functions, you will need a virtual device. This virtual device, we'll call it "NightLighting" Will be controlled by a pair of events such as

              Click image for larger version

Name:	Capture4.PNG
Views:	1
Size:	37.4 KB
ID:	1192705

              Then an event could be constructed like this

              Click image for larger version

Name:	Capture5.PNG
Views:	1
Size:	22.2 KB
ID:	1192706

              As andyf stated, Easy Trigger is a good solution for time issues. The schedule is the easiest way. You can create a daily schedule that spans a period from before sunset until after sunrise. Here is an example of a schedule that runs from 3 hours before sunset until 3 hours after sunrise that I use for basement motion controlled lighting.

              Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	29.0 KB
ID:	1192703

              You would use the schedule in an event like this:

              Click image for larger version

Name:	Capture3.PNG
Views:	1
Size:	21.7 KB
ID:	1192704

              I highly recommend Easy Trigger, there are dozens of functions that solve a number of limitations in the standard HS Triggers, Conditions and Actions.

              If you will give an example of exactly what you want to achieve with your event, I am certain you will get several different approaches to a solution, all of them good.
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment

              Working...
              X