Blueprint schema

The configuration schema of a blueprint consists of 2 parts:

  • The blueprint high-level metadata, like its name and a description and the input the blueprint needs from the user.
  • The schema of the thing the blueprint describes.

The first part is referred to as the blueprint schema and contains mainly the blueprint’s metadata. The second part depends on what the blueprint is for.

For example, in the case of creating a blueprint for an automation, the full schema for an automation applies.

This page is mainly set up to describe the configuration schema of the blueprint metadata. Try our blueprint tutorial in case you are interested in creating your first blueprint.

The blueprint schema

The only requirement for a blueprint is a name. In its most basic form, a blueprint would look like:

  name: Example blueprint
  domain: automation

And this is already a valid blueprint. But typically, one would need more. For example, user inputs or a description to describe the blueprint’s functionality.

This is the full blueprint schema:

Configuration Variables

name string Required

The name of the blueprint. Keep this short and descriptive.

description string (Optional)

The description of the blueprint. While optional, this field is highly recommended. For example, to describe what the blueprint does, or tell more about the options inputs of the blueprint provide. The description can include Markdown.

domain string Required

The domain name this blueprint provides a blueprint for. Currently, only automation and script are supported.

author string (Optional)

The name of the blueprint author.

homeassistant map (Optional)

Home Assistant requirements to be able to use the blueprint successfully.

min_version string (Optional)

Minimum required version of Home Assistant to use the blueprint (e.g. 2022.4.0. It is important to set this if the blueprint uses any features introduced in recent releases to head off issues.

input map (Optional)

A dictionary of defined user inputs. These are the input fields that the consumer of your blueprint can provide using YAML definition, or via a configuration form in the UI.

name string (Optional)

The name of the input field.

description string (Optional)

A short description of the input field. Keep this short and descriptive. The description can include Markdown.

selector selector (Optional)

The selector to use for this input. A selector defines how the input is displayed in the frontend UI.

default any (Optional)

The default value of this input, in case the input is not provided by the user of this blueprint.

Blueprint inputs

As written in the above schema, a blueprint can accept one (or multiple) inputs from the blueprint consumer.

These inputs can be of any type (string, boolean, list, dictionary), can have a default value and also provide a selector that ensures a matching input field in the user interface.

Each input field can be referred to, outside of the blueprint metadata, using the !input custom YAML tag.

The following example shows a minimal blueprint with a single input:

  name: Example blueprint
  description: Example showing an input
      name: Example input

In the above example, my_input is the identifier of the input, that can be referred to later on using the !input my_input custom tag.

In this example, no selector was provided. In this case, if this blueprint was used in the user interface, a text input field would be shown to the user.

A blueprint can have as many inputs as you like.

Blueprint inputs in templates

The inputs are available as custom YAML tags, but not as template variables. To use a blueprint input in a template, it first needs to be exposed as either a script level variable or in a variable script step.

  # Make input my_input available as a script level variable
  my_input: !input my_input

Example blueprints

The built-in blueprints are great examples to get a bit of a feeling of how blueprints work.

Here is the built-in motion light automation blueprint:

  name: Motion-activated Light
  description: Turn on a light when motion is detected.
  domain: automation
      name: Motion Sensor
          domain: binary_sensor
          device_class: motion
      name: Light
            domain: light
      name: Wait time
      description: Time to leave the light on after last motion is detected.
      default: 120
          min: 0
          max: 3600
          unit_of_measurement: seconds

# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent

  - platform: state
    entity_id: !input motion_entity
    from: "off"
    to: "on"

  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target

Additional examples, provided by the community, can be found on the community forum.