Help - Day or Night condition not working

Hi Richard.
I have a condition that I cannot figure out why it’s running at a particular time.
I want my blinds to close automatically at night, but no earlier than 4PM and no later than 9PM.
The input is the from the Day or Night plugin and I have one condition:
Name=is_nighttime; Description=Day or Night indicates Night time.

Name=close_blinds_night; Repeat=No; Expression = (is_nighttime and (is_nighttime;NOW>2:00) and (16:00:00;NOW;21:00:00) ) OR (21:00:00;NOW;21:01:00)

As you can see by the attached status report the condition of close_blinds_night became true at 9:31:23 this morning, eventhough the is_nighttime indicates that it’s not nighttime.

I put the portion of (is_nighttime;NOW>2:00) in the condition recently, because I thought the false triggers were coming from the day or night plugin having the wrong status momentarily, so I thought a delay would help. It doesn’t. Can you tell me what is wrong with my condition?

The Expression:

(is_nighttime;NOW>2:00) i

Is only false for 2 minutes a day!
It’s false as soon as daytime becomes true, and for the the next two minutes … Then for the next 23 Hours 58 minutes it’s true.

This expression does NOT look at the value of is_nighttime … it ONLY looks at the timestamp of when it was last true!

Also looking over your Report … you have almost twice as many triggers as you need.
If something is binary (tripped/notripped, on/off, closed/open …) you do not need to define both triggers.

So if you have Open and Closed triggers you can remove the Closed trigger and replace all references with !Open
The ! means NOT, you can also used Not Open …

Hi Richard. Yes, the reason that I used the expression:
is_nighttime and (is_nighttime;NOW>2:00)
was because I found that the Day & Night plugin would sometimes momentary report as being night time during the day. So I added the 2 minute “delay”, so that I would only trigger the action if the plugin reported it as night time for at least 2 minutes.
But in this most recent situation, I can see that the Day & Night plugin was correctly reporting as “Daytime”, so the “is_nighttime” condition would be false, eventhough the (is_nighttime;NOW>2:00) would be true, the overall condition should be false, but it wasn’t. Any ideas?

Thanks for the tip on reducing my triggers and using the “NOT” qualifier. I’ll use that.