Hi community.
sorry if it’s not the right forum for that kind of question.
I just tried to set up my first very simple automation using the visual editor. Just triggering the AC when insinde temperature above 21 C. The problem is, it is not triggering. If I test it manually, the AC starts so I think the action is correct but the trigger is not evaluated. Copied as YAML:
This triggers when the temperature crosses the threshold or when the system or automation is restarted, and the condition ensures that the AC isn’t turned on when triggered by a restart when it’s cold.
I’ve also changed your initial trigger from a device to an entity trigger, as it’s easier when manually editing, although this is just personal preference.
As an optional refinement, I would add a second condition that checks if the thermostat’s current state is notcool. That will prevent needlessly setting the thermostat to cool when it’s already in that mode (which can happen if the temperature continues to increase above the threshold value or on startup/reload).
Correction. Removed first of two conditions because it was mistakenly copied here from another automation that didn’t employ triggers for startup/reload.
I was composing an automation similar to yours when you posted your more complete version that handles startup/reloads. I blindly copy-pasted the conditions I already had without considering that the first one will now be subjected to startup/reload. I’ll remove it from my previous post.
Hi Tom,
just for understanding purposes… The way I did using a condition it won’t trigger if at 5pm the temperature is already above 21 degrees, right?
Having it as part of the trigger solves this issue. This would also trigger not only exactly 17:00:01 but also after 5 pm? How could I then also limit the rule to not trigger after e.g. 10 pm? Time-trigger seems to offer only “at” rules not before-after like the conditions do.
Correct. Conditions are only evaluated after the trigger occurs.
The way it is at the moment if it is already 21° at 5pm the time trigger starts your automation. And the conditions are then checked to make sure it is above 21°.
If it is below 21° but goes above 21° at any time the numeric_state trigger starts your automation, then the conditions are evaluated to see if it is between 5pm and 6am. If you want it to not occur after 10 pm change your time condition,
- condition: time
after: '17:00:00'
before: '22:00:00'