Help troubleshoot rule

Looking for help troubleshooting this rule. My intention is to have it turn on a fan daily at 715AM and then turn it off at 9PM. Last night the fan was still running well past 9PM. I noticed the rule log appears to show the logic is correct, but the output to the fan at 9PM is “on()” and not “off()” like I would expect. Thoughts?

The ‘time between’ condition is probably causing the issue here.

A common approach is to just pick an arbitrary time between your two triggers and use that.

Everyday 7:15 AM
Everyday 9:00 PM


IF ('Front Room Fan' is 'off') and (time is before 8:00 AM)
  Front Room Fan ▸ on()
  Front Room Fan ▸ off()

Thanks, @josh. I’ve changed my code and will update this post with my results.

I should also add that the 'Front Room Fan' is 'off' part of the condition isn’t necessary if you always want it to turn the fan on in the morning and off at night.

Otherwise if the fan is already on in the morning, the condition would not be met, so it would go to the else path and turn the fan off!