Hi All
i have a simple automation that doesn’t work
I need to turn on a plug when a temperature sensor is over 28°c and the time is 2pm.
I did that but the plug never start
If i’m removing the “if” all works
what is the issue?
thanks
Hi All
i have a simple automation that doesn’t work
I need to turn on a plug when a temperature sensor is over 28°c and the time is 2pm.
I did that but the plug never start
If i’m removing the “if” all works
what is the issue?
thanks
would you mind to share the yaml configuration? thank you
This is not what your trigger does. It will turn on the plug if the temperature goes from 28 to 29, but only if it is after 2pm. If the temperature is already over 28 at 2pm nothing will happen.
Change your numeric state trigger to a template trigger.
Numeric state requires you to cross the threshold for it to trigger. Template trigger simply has to evaluate if the condition is true.
I do something similar to monitor the temperature of some external hard drives:-
{{ states('sensor.main_hdd_temperature')|int(0) > 44 }}
Assuming you mean “at 2pm or later” rather than “at 2pm exactly”
To run the action when two things are true at once, you need two triggers:
and two conditions:
Possible sequences of events:
(cold)
(hot)
Your current automation will not run the action if the temperature is already above 28 at 14:00.
If you want the automation to only run at 2pm if the temperature is high, and you don’t care what the temperature is earlier or later, then switch your trigger and condition around: trigger at 14:00, check the temperature.
That’s not the problem…
Both numeric state trigger and template triggers (and every other trigger) will always only fire if the trigger changes from false to true.
if the trigger (either numeric or template) is already true at 2pm then the automation will never run the actions regardless of what type of trigger you use.
You’re right. My logic was not sound.
I was thinking about a generic entity state trigger that would fire whenever the state of the entity changed (regardless of its value), then use a template in the condition and misremembered another automation I thought did the same thing.
yes if you use a stateless state trigger (by leaving the “to:” blank or omitting it altogether) the trigger will turn true on every state change. so you are correct in that. but since they only care about a specific state change (from 28 to 29+) then just use that instead of trying to trigger on every state change.
alias: Accendere - Ventilatore Dreo 28°c
description: “”
triggers:
hi
thanks
i did it
alias: Accendere - Ventilatore Dreo 28°c
description: “”
triggers: