Howdy folks,
I have a case where I want to use a single blueprint to create multiple automations. It doesn’t seem like this is possible, is it?
I can merge them into a single automation, however, it’s very messy compared to just creating four automations based on the inputs.
Is there a clean way to do this?
Thank you,
You create a blueprint which contains all the code and logic you want to do. You can then make as many automations (or if it a script blueprint, scripts) from it as you like.
Single blueprint, multiple automations - #52 by Sir_Goodenough.
Yes, I am aware of being able to use a single blueprint multiple times.
In my case, I want a single blueprint to run four different trigger, condition, and action sections.
Basically I have motion sensors and lights. I want to do the following in a blueprint
- When motion is detected, re/start a timer and pause it.
- When motion is cleared, resume the timer
- When the timer starts, turn on the lights
- When the time expires, turn off the lights
This works great as four separate automations. It allows me to have the lights on for as long as the motion is happening as well as 5 minutes after they clear. And if I turn off the lights while they’re on, they stay off, regardless of how many times motion is detected until the timer expires.
Yes, I can do this as one really large and nasty automation, but it’s really difficult to reason about, hence why if a blueprint could have the four sections defined in one, it would be relatively reasonable to read and understand.
If you read the link in my other post, it won’t be any smaller. Automation blueprint is just an automation that stores variables. You would need all the same logic and choose statements as the 4 automations or as the 4 automations pulled into one (which is not multiple automations, it then becomes one automation) EXCEPT you have to then figure out the !inputs and selectors and all that stuff, so it would be bigger. If you are only doing it once and don’t like the complexity of combining them, combining them into a single blueprint is worse.
Don’t think of a blueprint as something you invent in your head. It is an automation’s framework that is called by an automation with variables you can set. (or script)
Perhaps you want to do a feature request for a different construct that combines automations for you or something, but is never what an blueprint was for and the roadmap has never mentioned such a thing.
Cool, my question was if what I was asking for was possible or not. It wasn’t claiming that it was. I did search the forums and it’s been unclear if it’s possible or not.
You answered my question that it’s not possible. Thank you for that.
Yes, I have a dozen automations of these four workflows in place, so I’ll be switching them over to a blueprint, as I’m tired of managing 48 individual automations.
The massive obnoxious single blueprint is better than the 48 individual ones, but it’s a nightmare to understand and change. It really truly is. Regardless, I’ll be moving in that direction.
1 Like