home-assistant/core · error · InvalidBlueprint

Invalid blueprint: Missing input definition for {', '.join(m

Error message

Invalid blueprint: Missing input definition for {', '.join(missing)}

What it means

Raised during Blueprint.__init__ when the blueprint body references an !input tag that has no corresponding definition under the 'input:' section (missing = referenced tags minus declared inputs). The message lists every undefined input name.

Source

Thrown at homeassistant/components/blueprint/models.py:83

        # In future, we will treat this as "incorrect" and allow to recover from this
        data_domain = data[CONF_BLUEPRINT][CONF_DOMAIN]
        if expected_domain is not None and data_domain != expected_domain:
            raise InvalidBlueprint(
                expected_domain,
                path or self.name,
                data,
                (
                    f"Found incorrect blueprint type {data_domain}, expected"
                    f" {expected_domain}"
                ),
            )

        self.domain = data_domain

        missing = yaml_util.extract_inputs(data) - set(self.inputs)

        if missing:
            raise InvalidBlueprint(
                data_domain,
                path or self.name,
                data,
                f"Missing input definition for {', '.join(missing)}",
            )

    @property
    def name(self) -> str:
        """Return blueprint name."""
        return self.data[CONF_BLUEPRINT][CONF_NAME]  # type: ignore[no-any-return]

    @property
    def inputs(self) -> dict[str, Any]:
        """Return flattened blueprint inputs."""
        inputs = {}
        for key, value in self.data[CONF_BLUEPRINT][CONF_INPUT].items():
            if value and CONF_INPUT in value:
                inputs.update(dict(value[CONF_INPUT]))

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Add each listed input under the blueprint's input: section, e.g. 'door_sensor:' plus optionally 'name:'/'selector:' metadata
  2. Or remove the stray !input references from the body if the input is no longer wanted
  3. Re-run the blueprint via Developer Tools > YAML > reload automations to confirm the error is gone

Example fix

# before
blueprint:
  name: Motion light
  domain: automation
  input:
    light:
triggers:
  - trigger: state
    entity_id: !input motion_sensor

# after
blueprint:
  name: Motion light
  domain: automation
  input:
    light:
    motion_sensor:
Defensive patterns

Strategy: validation

Validate before calling

from homeassistant.components.blueprint import yaml_util

def inputs_declared(data: dict) -> bool:
    referenced = yaml_util.extract_inputs(data)
    declared = set(data.get("blueprint", {}).get("input", {}))
    return referenced <= declared

Try / catch

from homeassistant.components.blueprint.errors import InvalidBlueprint
try:
    Blueprint(data, expected_domain=domain, schema=schema)
except InvalidBlueprint as err:
    if "Missing input definition" in str(err):
        # add the listed inputs under blueprint.input

Prevention

When it happens

Trigger: Blueprint YAML that uses !input door_sensor inside trigger/condition/action but omits door_sensor from the blueprint.input mapping; any load path that constructs Blueprint (startup scan, import from URL, direct use_blueprint reference).

Common situations: Author adds a new !input to the body and forgets to declare it; copy-pasting a block from another blueprint that uses inputs the target does not define; deleting an input definition but leaving a reference in the body.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/80ee9f3228187915. Report an issue: GitHub.