Lights Off-Cancelable if Motion Sensor is Active

I thought I had this figured out but the lights don't turn on when the motion is active, if I set the trigger to change then the light turns on when the motion is action and inactive. What am I not seeing.

You don't have the time periods nested below the Motion active. You have them at the same level because you used an Else-If. Change your first Else-If to a regular IF. Then put an End-If right above your Else, to close out the If part for the times with your lights. Then you've have the correct structure.

1 Like

Your time restrictions will never ever come into play.

Your trigger is Motion Active
This will ALWAYS be true, no exceptions
Thus only your Cancel Delayed Actions will ever come into play using your IF structures.

Using the same trigger you have:
Cancel Delayed Actions
Simple If Time1 Dim 100
Simple If Time2 Dim 40
Simple If Time3 Dim 20
Off Delay 3m Cancelable

  • 5 lines total!
1 Like

Thank you @Ryan780 and @GatVlieg for your help. I did as you suggested and so far so good!. Here's the final configuration.

1 Like

Looks good but you have a dead spot in your rule. If the motion is active and time is between 12:01 and 12:02 no action will occur. You could change the 12:02 in the second ELSE-IF to 12:01 or
you could change the second ELSE-IF to an ELSE. Either was should work fine.

1 Like

Your right, I saw that earlier but I forgot to fix it.

Since they are Else if, there's nothing wrong with having them overlap by one minute either. The first of the two will be the one that runs. So, you can have one end at 12:01 and the next begin at 12:01 and it won't cause an issue.

Yeah the overlap question is why I originally wrote it that way, wasn't sure If there would be a double trigger at the 12:01 time.

No, you don't actually. The end time take up to 59 seconds after the minute...so it triggers whenever the minute is equal to that. There is no rounding, it's truncated . So, if the time is 12:01:59.9999, the rule will still use the 2nd range because the time is still 12:01.

From bruce:

So, if 12:00 is the ending time, it will trigger until 12:00:59.9999.

Yours is correct. But there is nothing wrong with them overlapping if they are in else-if's, especially if you are in doubt about how they work.

1 Like

That isn't correct. If 12:00 is the ending time, it will trigger until 11:59:59.9999

If the time is single minute, not a range, then 12:00 is valid from 12:00:00 until 12:00:59.9999

Please read the post from Bruce I linked to above.

@bravenel, little backup please?
If your time range in a conditional action is 1:00- 2:00, will the last trigger point be:
a) 1:59:59.9999
b) 2:00:59.9999

Thanks!

It treats a single minute as a special case, where anytime within the 60 seconds is true. It treats a range of minutes such as 1:00 to 2:00 as true between 1:00:00.000 and 1:59:59.999.

Try this rule with times appropriate to what time it is:

Thanks for the confirmation!

1 Like

What do you consider the "ending minute" in your example?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.