Automation blueprint

Also known as: Home Assistant blueprint

On this page 7

An automation blueprint is a reusable automation template in Home Assistant that defines the triggers, conditions and actions of a routine once and exposes only the variable parts, such as which motion sensor or which lamp to use, as configurable inputs. In home automation, a blueprint separates the logic of a rule from the devices it controls, so one tested design can power many independent automations across a smart home.

The term is also used as Home Assistant blueprint, because the platform introduced the concept in release 2020.12 and remains its main reference implementation. Other hubs offer similar ideas under different names, but the blueprint model, with its YAML file, typed inputs and shareable URL, is the form most practitioners mean when they use the word.

How an automation blueprint is structured

An automation blueprint is a single YAML file with two parts: a blueprint: metadata block and the automation body. The metadata names the blueprint, describes it, declares domain: automation and lists every input with its selector. The body is an ordinary automation in which each variable value is replaced by an `!input` tag that points to one declared input.

When a user creates an automation from the blueprint, the editor shows a generated form instead of the raw logic. The resulting automation stores only a use_blueprint: reference with the file path and the chosen input values. Home Assistant merges the template and the values at load time, which means the automation itself contains no copy of the logic.

The table below lists the main elements of a blueprint file and what each one controls.

ElementPurposeTypical content
Metadata blockIdentifies the blueprintName, description, domain, author
Input definitionsDeclares configurable valuesName, description, selector, default
SelectorsShape the form field and validationEntity, device, area, number, time
`!input` tagsInsert user values into the logicTrigger entity, delay, target lights
Source URLAllows re-import of updatesLink to the published file
Minimum versionBlocks use on older releasesA Home Assistant version string
Main elements of an automation blueprint file

Inputs and selectors in a blueprint

Selectors define what a user may enter for each input, and they are the main tool for making a blueprint safe to share. An entity selector can be limited to a domain and a device class, for example only binary sensors of class motion, which prevents a user from choosing a door lock where a motion sensor is expected. Strict selectors reduce configuration errors far more effectively than long descriptions.

The following table compares the selectors that appear most often in published blueprints.

SelectorValue it returnsTypical use
EntityOne or more entity IDsChoosing a sensor or switch
TargetEntities, devices or areasLights to switch in a room
DeviceA device IDRemote or button event triggers
NumberA value within a rangeDelay in seconds or brightness
TimeA clock timeStart of a quiet period
BooleanTrue or falseOptional feature switch
Common selector types and their use

Inputs can carry default values, which make a blueprint usable with minimal setup, and recent releases allow collapsible input sections that group advanced options. A frequent design limit is that !input values are not available in every place as template variables; authors expose them through a variables: block when templates need them.

A blueprint is a pattern for creating automations, not an automation in its own right, and this distinction separates it from neighboring concepts in home automation. An automation rule runs on its own, a scene stores device states, and a routine in consumer ecosystems is usually a fixed sequence built in an app.

The table below places the automation blueprint next to these related concepts.

ConceptWhat it storesReusable across devicesRuns by itself
Automation blueprintLogic with input placeholdersYes, by designNo
Automation ruleLogic with fixed devicesNo, must be copiedYes
Smart home sceneTarget states of devicesNoOnly when activated
Script blueprintAction sequence with inputsYesOnly when called
RoutineApp-defined sequenceRarelyYes
Automation blueprint and neighboring concepts

Home Assistant also supports script blueprints and template blueprints, which apply the same input mechanism to scripts and template entities. The core idea stays identical: write the logic once, configure it many times.

Importing, updating and maintaining blueprints

Blueprints are usually imported from a URL, such as a community forum post or a code repository, through the import dialog in the automation settings. Home Assistant stores the file under the blueprints folder in the configuration directory, and the stored source URL allows a later re-import that replaces the file with the newest version.

Because every derived automation references the same file, one change to the blueprint updates all automations after a reload. This is the main maintenance benefit and also the main risk: a faulty edit or an incompatible upstream update can break every dependent automation at once.

The decision table below summarizes how practitioners usually handle blueprint maintenance.

SituationRecommended choiceReason
Logic used in many roomsCreate or use a blueprintOne fix applies everywhere
One unique automationWrite a normal automationA template adds no value
Upstream update availableReview changes before re-importNew inputs may be required
Need to change one instance onlyTake control of that automationDetaches it from the template
Shared with other usersSet strict selectors and defaultsPrevents invalid configurations
Blueprint maintenance decisions

Limitations and common mistakes

Blueprints trade flexibility for consistency. Every instance shares the same trigger and action structure, so a user cannot add one extra condition to a single instance without editing the blueprint or detaching the automation from it.

  • Importing untrusted blueprints without reading the YAML, which may call services the user did not expect.
  • Editing a shared blueprint in place for one room, which silently changes all other rooms.
  • Loose selectors that accept any entity and produce errors only at run time.
  • Ignoring the automation mode, so overlapping triggers restart or drop runs unexpectedly.
  • Re-importing over local edits, which overwrites custom changes without a merge.

In simple terms

An automation blueprint is like a fill-in-the-blanks form for a smart home rule. Someone writes the rule once. For example: when motion is seen, turn on a light, then turn it off later. The blueprint leaves blanks for the sensor, the light and the waiting time.

You fill in the blanks for each room. The hallway gets its sensor and lamp. The bathroom gets different ones. Each filled form becomes its own automation, but all of them follow the same tested logic. If the original rule is improved, every room gets the improvement.

A practical example

A family in a two-story house runs Home Assistant with eleven motion sensors and smart bulbs in most rooms. At first, the owner writes a separate motion-lighting automation for each room, and small differences creep in: some rooms ignore daylight, others never switch off when a door is left open.

The owner replaces them with one motion-light blueprint that has inputs for the motion sensor, the target lights, an illuminance sensor with a threshold of 40 lux, a no-motion delay with a default of 120 seconds and an optional night brightness. Creating each room automation now takes about a minute, and the strict selectors stop anyone from picking the wrong device type.

Months later, the owner adds a check that skips the lights during a movie scene. One edit to the blueprint updates all eleven rooms after a reload, and the household gets consistent lighting behavior without touching each automation separately.