How to use Script Blueprints?

According to the Home Assistant documentation the blueprint domain can be either automation or script: Blueprint schema - Home Assistant (home-assistant.io). The Home Assistant blueprints folder has two subfolders: automation and script. The script folder contains a sample script blueprint.

However, Configuration > Blueprints only allows the creation of automations. How do we use script blueprints?

Although home-assistant/frontend#9504 (“Add blueprint scripts”) has been merged in release 2021.10.26.0, i still cannot don’t get a choice to use a blueprint when creating scripts with 2021.12.10 :frowning:

The script blueprint editor and the last requirements for script blueprints were added in 2021.12.0

I would also like to know if this was ever figured out

What are you trying to figure out?
What are you trying to do?

There’s a blueprint that works really well for my lights but now that we have voice capabilities I’d like to combine that into the same automation. so instead of having 2 separate automations for one room’s lights for example, I could combine it all into one automation and just call the blueprint as a script instead.

ok, sounds doable. What is the question?
If you are asking if there is a ui editor for blueprints, no there is not.
YAML edit only.

You can ui edit scripts and automations, and that is the first step to build a blueprint anyway, to get the HA logic working with sample data. After that you change a few things to include the !inputs and you have a blueprint.

Creating an automation blueprint - Home Assistant.

But I can’t just import a pre made blueprint as a script?

You can import a premade script blueprint and it will show in that folder in the HA config.
Script blueprints and automation blueprints are not the same.

I have both kinds in my library it you want to import some and see;
GitHub - SirGoodenough/HA_Blueprints: 🧯 My Collection of Automation and Script Blueprints for Home Assistant 🧯.

2 Likes

I have a question that may (not) be relevant, …
is it possiBle to build BPs in such a way so that when the user instantiates a single automation from that, the blueprint instantiates and depends on script BS(s) & helpers.
Does that make sense?

Blueprints are automations or scripts that can be called with variables. If you can do it with an automation or script, you can do it with a automation or script blueprint.

Automations can call scripts, scripts can trigger automations. Scripts can even be called with data fields.

So the best I can understand of your question, I think the answer is yes.

My Q was whether a single blueprint can bundle together an automation, a script and helper(s)?

yes

Some link to the docs?

There are docs for writing automations, scripts, and blueprints.
I gave you a link above for blueprints

already.
I don’t know what your exact subject is, but if you google

home assistant script whatever

and

home assistant automation whatever

you will save me from having to spend my time doing it for you.

I suggest you stick with the community messages and the official docs.

Stay away from the useless Reddit posts and old you tube stuff (more than a year old).

Do you need someone to read it for you as well?

You can also look thru my config and I do all that stuff in there.
GitHub - SirGoodenough/Home-Assistant-Config: My HA Configuration... This is what I run for production in my house..

Best is to just do it. This is mostly a yaml thing, not a ui editor thing BTW.

  1. Write an automation, UI is OK that does something.
  2. Take what you do there in the action statement and make it into a script (again, ui editor is ok here)
  3. Change the automation to instead of running the action, into calling the script ot turning the script on.
  4. Convert the automation into a automation blueprint calling the script
  5. Change the script into a script blueprint and call that version.
  6. Change the script to include fields and variables so that you can change stuff on the fly.

One step at a time, learn as you go.

Thank you for your time.
I have studied the docs for years and i know some of what you wrote (not the reddit/video’chronology suggestions though),
i’m a multilingual programmer and had already adapted a BP for myself.

It quite possible that you’re in such a hurry that you don’t spend the necessary time to understand my Q. It’s ok, you’re entitled to it, no need for the irony.

I was answering this question. It appears to be yours. If as you say you wrote that Blueprint You have knowledge of Home Assistant. So you know that combining separate automations is usually easy to do. Automations have triggers, scripts do not. So combining 2 automations and ending up with a script is really only possible of you combine the action statements of the automations and build a larger script.

(And remember when I say automation or script, there are blueprint versions of both as well and same rules apply.)

Rather than ask questions that are rhetorical, I suggest you just ask the question with the code you are working on.

I think my answer here answers it best…

I want a BP when applied it bundles an automation, helpers (such as numbers & text), and optionally scripts (to call them with service.script). Anc since you are much more experienced, i’m asking your opinion whether what i want makes sense and/or is doable.

What kind of blueprint? Automation or script?

I believe this is what is going on…
The XY problem is asking about your attempted solution rather than your actual problem.