Hi there, so I have a number of automation blueprints that I’ve added into my home assistant instance. I would love to be able to use many of these in scripts instead of in automations.
I know that automation blueprints are located in “config/blueprints/automation/“ and script blueprints are located in “config/blueprints/script/“.
I googled this and also searched through this forum but could not find an answer to these questions, my apologies if my Google-fu wasn’t on point today, but:
Are automation blueprints and script blueprints interchangeable? Like, can I copy a file from the “blueprints/automation/“ folder straight to the “blueprints/script” folder and it’ll just work?
Assuming no to the above question, how hard is it or what does it take to convert an automation blueprint into a script blueprint?
Again my apologies if there are guides out there for this, I couldn’t find anything easily!
No. Automations have triggers and conditions. Scripts do not (though they do support in-line conditions).
Depends on the automation complexity and your skill level. If the automation has few conditions and does not rely on trigger variables it should be easy enough.
I appreciate the reply, but I believe you may have answered a different question than the one I was asking.
It seems like you answered the question “are automations and scripts interchangable”. I’m curious if automation BLUEPRINTS and script BLUEPRINTS are interchangable. The stuff that lives in “config/blueprints/automation/” and “config/blueprints/script/”.
Here is a similar question which was asked almost 2 years ago which hopefully helps to clarfiy what I’m trying to ask about: How to use Script Blueprints?
However, perhaps you were trying to tell me that the scripts aren’t interchangable because of the triggers inherent in an automation blueprint? In which case, perhaps the relevant code which triggers the automation blueprintcould be removed and then the blueprint could work as a script blueprint?
Automation blueprints are automations that call inputs.
Script blueprints are scripts that call inputs.
Tom did answer your question.
If you had spent the time looking at examples instead of sending loud in a reply, you would see this.
If you want to know how to use script blueprints, look in my library, I have a few you can choose from.
And yes script blueprints and calling scripts with data are very similar and work about the same way, but as you can see with some of my script blueprints, you can combine this and call the result both ways, if needed.
@Sir_Goodenough: I see you editing your response, but I spent more than 10 minutes looking at his response as well as the documentation and have spent a fair amount of time working on automations and scripts.
Perhaps Tom did answer my question and I need my hand held a bit more through understanding this, but my current confusion regarding his reply stems from the fact that he never once used the word “blueprint” in his response.
Hence why I said: “However, perhaps you were trying to tell me that the scripts aren’t interchangable because of the triggers inherent in an automation blueprint? In which case, perhaps the relevant code which triggers the automation blueprint could be removed and then the blueprintcould work as a script blueprint?”
Not sure where you think I got loud in my reply. The bolds? That was for emphasis only. I did try to be respfectful throughout my post. But that’s off topic. I’ll chalk up the possible misunderstanding to words on a screen not translating well to intention.
Edit: The link you sent does look like it could be helpful. If I look through the code you have for automation blueprints and script blueprints, I probably can figure out the differences and figure out how to convert automation blueprints into script blueprints. So thanks for the link.
In my examples some of my automation BP’s call some of the script BP’s.
IE the cube remote automaton BP can use the volume control script BP to change a media player volume plugged into the users function on the remote that they choose.
@Sir_Goodenough: I’ll definitely look through your links to see how different the code for each is.
(To give some background as to why I asked this question, the automation section in my HA instance is way way too cluttered. I want to move a lot of it into the scripts section. But many of the automations I use are built on the automation blueprints from Blueprints Exchange - hence me wondering about converting one blueprint type to the other.)
Obviously you have more experience than me in this, so in your expertise: is it relatively “easy” to strip out the parts of an Automation Blueprint to make it into a Script Blueprint? (Like trigger sections, etc.) (I’m working at the moment so can’t look through your GitHub repo in depth at the moment, but I’m sure your examples will help me understand this better when I can get to it - hopefully in a few hours).
Edit: Apologies, I think you answered my question about the ease of converting the blueprints in your edit to your first post, last sentence: “And yes script blueprints and calling scripts with data are very similar and work about the same way, but as you can see with some of my script blueprints, you can combine this and call the result both ways, if needed.” So it seems you find it overall fairly straightforward. Will look through your repo for examples later today~