Home Assistant Automations - Best Practices (ON/OFF vs Conditions)


I recently re-organized my automations to reduce the overall amount and bind them stronger with scripts.

While there are benefits such activating the “Night Mode” Script - which switches off all lights, switches and heating - it also has a major downside of being triggered even when not in use.

Before, I switched automations off at night and left them off until sunset for example. Now, as I don’t use dedicated automations for each function, but instead use options and conditions, automations get triggered multiple times during the day just to be stopped by the condition.

Another example: before I had 3 automations for heating when someone left the house or it was night time. Now one automations checks the options and conditions and triggers the scripts accordingly.

What is a best practice in your opinion?

a) Multiple automations which are off when not in use and will be switched on by another automation
b) Automations which follow strict rules and get triggered multiple times a day just to stop at a condition
c) …

Really appreciate your input as I like the cleanliness of my new automations, but I’m not sure if it isn’t unnecessary workload for my Pi 4b.

Thank you :slight_smile:

1 Like

Option c) A mix of both, but mainly b).

I started out turning off automations when not needed. This seemed to be an unpopular choice. Most of the people I leaned from on this forum suggest using conditions instead. For the most part I have. I do still have a few that I turn off and on when needed.

Both have their drawbacks. Personally, I believe the way Automations are handled in HA still leaves lots of room for improvement.
I am constantly battling with the fact that simple things like And/Or variables still aren’t available.

Example: I have automated my Home Ventilation with CO2 Sensors. For turning up the ventilation setting I need an “Or” Trigger. This works fine. However, for turning the level back down I would need an “And” trigger. I can work around this by adding conditions, but I haven’t found any Setup that works reliably in every scenario.

Thanks for your input!

Guess I’ll make sure that the most likely condition the automation will be stopped with (say day and night and then device location, then guest mode for example) comes first.

@CommanderROR off topic, but isn’t that something that could be solved with templating? I’m still too unexperienced with it and rarely use it, but find more and more use-cases.

I’m firmly in the “use conditions” camp. I want to keep the ability to disable or enable automations available in case I need to debug or refactor the automations or fix/replace equipment.

“And” triggers are to be handled via templates. I have few case by myself with temperatures or humidity levels and it is pretty easy

1 Like

I guess then maybe Templates is the next thing I need to learn…:see_no_evil:
Though I have solved my current problems with the excessive use of redundant conditions…

1 Like