I’ve automation to turn off the fan when the temperature drops below 24.5 degrees, only during 11 pm and 9 am in the morning. However, when the temperature drops below 24.5 at 10:30 pm as example, the automation condition has failed due to the time and then when the temperature is even 22 degrees after 11 pm , it doesn’t work. The code is below. Any help is appreciated
In this case, there’s no need to repeatedly check the temperature. Employing a Time Pattern Trigger is inefficient compared to simply checking the temperature once at the beginning of the time period.
Doesn’t checking the temp once mean that if the temperature drops below 24.5 after 21:00, nothing will happen? - or have I misread this?
I would have thought the “and” condition would work - temp drops below 24.5 “AND” it is after 21:00 etc. Nothing happens until the temp triggers and then it starts checking the time.
There are two triggers, a Numeric State Trigger and a Time Trigger.
In the following two scenarios, the switch is assumed to be on.
If the temperature decreases below 24.5 the Numeric State Trigger will trigger. If the current time is within the desired time period (21:00-09:00), all three conditions will be true and the action will be executed.
If the temperature decreases below 24.5 the Numeric State Trigger will trigger. If the current time is not within the desired time period, the Time Condition will be false and the action will not be executed. When the time becomes 21:00 (the start of the desired time period), the Time Trigger will trigger, all three conditions will be true (because the temperature had decreased below 24.5 prior to 21:00) and the action will be executed.
Thanks for the explanation. Once I put it into Visual Editing mode it made sense. In effect each trigger is also a condition and vice-versa - or at least that’s the way my logic flow sees it!