ThisCalculator

Everyday

Home Assistant Blueprints: Reuse Automations Without Copying YAML

Updated · Standard formula, shown below

Home Assistant Blueprints: Reuse Automations Without Copying YAML

Yes, Home Assistant blueprints let you reuse automations without copying YAML. You define an automation once as a blueprint, then create multiple instances of it by filling in a form, and each instance stores only its configuration options—not the full automation code.

What Blueprints Actually Do

A blueprint is a reusable automation template. Instead of pasting the same YAML into every automation, you write the logic once, mark certain values as inputs, and then instantiate it as many times as you want. Each instance behaves like a normal automation in Home Assistant: it appears in the Automations list, can be enabled or disabled, and runs independently. The blueprint itself is stored separately, so when you update the blueprint, you can choose to update all instances that use it.

Blueprints work for automations, scripts, and (since 2024) areas. The most common use is automations, but the same principle applies to all three.

How Blueprints Differ From Copy-Pasting YAML

When you copy YAML, you duplicate the entire code. If you later want to change the delay, the condition, or the action, you must edit every copy manually. With blueprints, you edit the blueprint once, and then each instance can be updated to the new version. This is the core advantage: centralised maintenance.

There are also practical differences in how you create them:

  • Creating: A blueprint is a YAML file placed in config/blueprints/automation/ (or subfolders). You can write it by hand, or import it via the UI from a URL or a paste.
  • Instantiating: You go to Settings → Automations & Scenes → Blueprints, find your blueprint, and click “Create Automationâ€�. A form appears with fields for each input you defined.
  • Storing: The instance is stored as a normal automation with a use_blueprint key that points to the blueprint and a input dictionary with your chosen values. The full YAML is not duplicated.

Anatomy of a Blueprint File

A blueprint YAML file has three main sections: blueprint, input, and the automation itself. The blueprint section contains metadata like name and description. The input section defines what the user can configure. The rest is a normal automation, but with !input placeholders where the user’s choices go.

For example, a simple motion light blueprint might look like this:

blueprint:
  name: Motion Light
  domain: automation
  input:
    motion_sensor:
      selector:
        entity:
          domain: binary_sensor
    light:
      selector:
        entity:
          domain: light
trigger:
  platform: state
  entity_id: !input motion_sensor
  to: "on"
action:
  - service: light.turn_on
    target:
      entity_id: !input light

When you create an instance, Home Assistant asks you to pick a motion sensor and a light. The resulting automation YAML is short and readable:

alias: Motion Light (Hallway)
use_blueprint:
  path: motion_light.yaml
  input:
    motion_sensor: binary_sensor.hallway_motion
    light: light.hallway

Choosing Between a Blueprint and a Regular Automation

Blueprints are not always the best choice. Use them when you have a pattern you repeat more than once, or when you want to share a template with others. Avoid them for one-off automations that you will never duplicate—the extra indirection is not worth it.

Consider these factors:

  • Repetition: If you have 5 lights that should behave identically, a blueprint saves time and effort.
  • Customisation: If each instance needs very different logic, a blueprint with many inputs becomes unwieldy. A regular automation may be clearer.
  • Sharing: Blueprints are the standard way to share automations with the community. You can import someone else’s blueprint without understanding the code.
  • Versioning: If you want to update all instances at once, blueprints are the way.

Common Problems and Misconceptions

One frequent misconception is that blueprints are “locked� and you cannot edit an instance. That is false—you can edit an instance’s inputs, and you can even convert it to a regular automation if you need to tweak the underlying YAML. However, once you convert, you lose the link to the blueprint.

Another issue is that blueprint inputs are not always obvious. If a blueprint requires a specific type of entity (e.g., a binary_sensor), the UI selector will filter choices, but you can still type any entity ID if you want. If you type an invalid one, the automation may fail at runtime.

A common error is forgetting to update instances after editing the blueprint. Home Assistant does not auto-update instances—you get a notification that an update is available, but you must click “Update� on each instance (or use the “Update all� button in the blueprint page). If you change the blueprint’s inputs, existing instances may break until you update them.

Blueprints vs. Scripts and Packages

Blueprints are often compared to scripts and packages, but they solve different problems. A script is a sequence of actions you can call from multiple automations—it avoids repeating actions, but not triggers or conditions. A package is a way to group related YAML files, but it does not provide a form-based UI for configuration.

Blueprints sit above both: they package the entire automation logic, including triggers and conditions, and expose a clean interface for the user. They are also the only one of the three that can be shared and imported via the UI without touching YAML files directly.

Costs and Maintenance

Blueprints themselves have no cost—they are part of Home Assistant’s core functionality. The “cost� is in maintenance. When you update a blueprint, you must test that all instances still work, especially if you change input names or add required inputs. If you remove an input that an instance uses, that instance will show an error until you fix it.

There is also a learning curve. Writing a good blueprint requires understanding YAML, selectors, and the automation engine. For beginners, importing a well-made blueprint from the community is easier than writing one from scratch.

Frequently Asked Questions

Can I edit an automation created from a blueprint?

Yes. You can edit the input values in the UI. If you need to change the underlying logic, you can either edit the blueprint (and update instances) or convert the automation to a regular one via the three-dot menu, which copies the full YAML into the automation so you can edit it freely.

How do I update all instances of a blueprint at once?

Go to Settings → Automations & Scenes → Blueprints, find your blueprint, and click the “Update� button. Home Assistant will show a list of affected automations. You can update them individually or use the “Update all� option if available. The exact wording may vary by version.

Can I share a blueprint with someone else?

Yes. You can export the blueprint YAML file and share it. The recipient can import it via Settings → Blueprints → Import Blueprint, either by pasting the YAML or providing a URL. They will then be able to create their own instances with their own entities.

What happens if I delete a blueprint that is in use?

Existing automations that use the blueprint will continue to work, but they will show a warning that the blueprint is missing. You will not be able to edit their inputs until you re-import the blueprint with the same path. The automations themselves are not deleted.

Can I use blueprints for scripts or areas?

Yes, since Home Assistant 2024.4, blueprints can be used for scripts and areas as well as automations. The process is the same, but the blueprint file must be placed in the corresponding folder (e.g., config/blueprints/script/) and the domain field must match.

Do blueprints work with the visual editor?

The blueprint editor is text-based, but when you create an instance, the form is visual. You cannot edit the blueprint’s YAML with the visual automation editor—you must edit the YAML file directly. However, you can use the visual editor to edit a converted automation.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.