Repeatable building blocks in automations / nesting / scalability

Hi everyone,

Fairly new to HA so please bare with me.

My question is how to make automations more scalable with templates, groups, nesting, building blocks etc. (Although I still can’t find a way to create something useful that I can call from the “+building blocks” button in automations…?)

I’ve been building automations that detect if a front door sensor has been left open for 5 minutes, where it then send notifications to mobile phones via the companion app as well as notifications to Google Nest speakers and other similar things.

I’ve taken the same automation, duplicated it and repeated it for a 10 minute duration, 15 minute duration etc. Exactly the same other than a slightly different message and of course the duration on the trigger.

I’ve also repeated it all again (all three) with a condition added if the sensor detects a low temperature, where it does the same actions but on the notifications it changes the message slightly to say it’s letting in cold air etc.

And finally, I duplicated all 6 of those but targeted the back door sensor for the trigger and naturally changed the text to say “back door”.

So that’s 12 automation, all very, very similar.

My question is about ease of administration… Is there not an easier way to build and maintain these? For example, one of our kids replaces their phone… As far as I know I’ll have to go into all TWELVE manually and update the entity for the phone notification so it’s the new phone.
Likewise when I created them… Is there no better way than making one, then duplicating it and changing the relevant bits.

Is there a way to create some sort of group of actions like the phone notifications for the family that has the entity, action title etc all populated and I can just tweak it?

How can I scale this stuff out?

Thanks - Steve

Notifier Groups:

Scripts:

Passing Variables to Scripts

Templating:

Templating Service Calls

1 Like

No. You give the new phone the same entity_id as the old one had and all the automations carry on working without modification.

1 Like