I currently have my automations structured in a way where each automation has a specific trigger and a specific action. For example, I have one automation for the single down click on the bedroom switch and another automation for the double down click on a different switch, but both automations have the same action of turning off the bedroom lights. I am in the early phases of building my automations but I can already see how many different automations this will lead to. It seems silly to do it the way I have been, especially since the automations are varying by only a node id in the trigger, etc. I am considering condensing these multiple automations into a single automation based on the action with multiple triggers. Is there any good reason to continue the way I’ve been doing it or should I merge these like i’m thinking?
No one size fits all. You should write automations based on your own personal preferences. Some like to cram as much into as few automations as possible whereas others like the other extreme. Each way has its pluses and minuses.
In the simple example you mention where two automations have different triggers but the same action, it’s simple to put both triggers into one automation, since either trigger can trigger the automation. But would you ever want to disable one and not the other? Then maybe it’s better to keep them separate.
Like I said, no one size fits all.
Makes sense. Are there any benefits that you can think of to having them all in one, other than they are all grouped?
It can make them easier to manage, especially when you write more automations. But if you start trying to put too much into an automation that can make it more complex. E.g., you may need to use (more) conditions, templates, etc. It’s a trade-off like anything else. Do what feels right and fits your personal style.
I think the one recommendation I would make, overall, is to use Packages. That let’s you define entities together that logically go together, rather than having sensors over here, automations over there, and scripts someplace else.
Thanks for that suggestion, I’ll read up on packages and see what those are all about.
+1 on using Packages. I love them. I group things generally by function, so I have things like kitchen_light.yaml which contains: an input_number, multiple automations, multiple scripts, etc. When I want to change something related to that light, it’s all in the one file.