How do you manage/organize your automations

I’m currently going through every automation to see what I can do better and wondered, how you guys handle your automations. I’ve started out with the GUI editor but moved to YAML files soon after because I like that more

  • How do you organize your automations/scripts? I’m do this per room if possible and have a folder other for all the miscellaneous stuff where I still try to group them (like a folder smartphone). The name (and entity ID) are prefixed by the “group” like
    • Office: Ambient Lighting (automation.office_ambient_lighting)
    • Smartphone: Shopping List (automation.smartphone_shopping_list)
    • System: Remote Connection (automation.system_remote_connection)
  • Do you use scripts? I’ve only recently started out this with for setting my smartphone’s ringer mode or volume level which I do in a few automations. It doesn’t save much in terms of lines but I the snippet is always identical and I’ll have it in one place with the script. You can also use fields to pass the desired values for the script to use which is neat
  • What do you use helpers for? I haven’t done much with these and was hoping for some ideas. I’m currently setting up a vacation mode where I’ll use a helper but other than turning switches to lights I haven’t done anything with them

Lot of text but you get the gist of it :slight_smile:

I use tags in the titles to group automations by function.

This is easy with automations. I also do it with scripts and helpers, which is a bit more fiddly because the entity_id is generated from the name, so you have to create the script/helper, then go back and add the tag to the name afterwards.

I use them a lot for snippets that are used in several automations. Also, an automation that consists mainly of a series of script service calls is much easier to read (as long as the scripts have meaningful names). You also need scripts for actions launched by Alexa, of course.

Schedule, threshold and time of day helpers save a lot of complicated triggering in automations (I particularly like the hysteresis in threshold helpers). They also allow multiple automations to use the same trigger. I have a lot of input_boolean flags which allow automations to interact with one another (I don’t see the point of cramming everything into one large automation - just makes life difficult).

On the subject of organising, my configuration.yaml is pretty much just a list of !includes.

1 Like

I organize them by: Room-Device(s)-Mode, for example:
Balcony-Floorlamp-Morning or Balcony-Lamps-on/off
This has suited me for years and I know where to find them and automations for a area is kept together. I also has an area for the Apartment if the automation is general and covers several areas.

Yes, I have several scripts. Sometimes the automations needs the same actions and it is practical to call the actions via script instead of duplicating them for each automation. And it’s easier to replace entities in one script instead of multiple automations.

Everything! I have so many helper to use as conditions or triggers in automations. When appliances are on, when different modes are on e.g. bedtime, warning from my car, guest mode, the days when my vacuum should clean whole apartment or partly, special holidays, warnings from my system, when to speak TTS or be silent, when thunder is nearby, vacation mode, christmas mode, halloween mode, and … , and …

3 Likes