{"record":{"id":"80ee9f3228187915","repo":"home-assistant/core","slug":"invalid-blueprint-missing-input-definition-for","errorCode":null,"errorMessage":"Invalid blueprint: Missing input definition for {', '.join(missing)}","messagePattern":"Invalid blueprint: Missing input definition for (.+?)","errorType":"exception","errorClass":"InvalidBlueprint","httpStatus":null,"severity":"error","filePath":"homeassistant/components/blueprint/models.py","lineNumber":83,"sourceCode":"        # In future, we will treat this as \"incorrect\" and allow to recover from this\n        data_domain = data[CONF_BLUEPRINT][CONF_DOMAIN]\n        if expected_domain is not None and data_domain != expected_domain:\n            raise InvalidBlueprint(\n                expected_domain,\n                path or self.name,\n                data,\n                (\n                    f\"Found incorrect blueprint type {data_domain}, expected\"\n                    f\" {expected_domain}\"\n                ),\n            )\n\n        self.domain = data_domain\n\n        missing = yaml_util.extract_inputs(data) - set(self.inputs)\n\n        if missing:\n            raise InvalidBlueprint(\n                data_domain,\n                path or self.name,\n                data,\n                f\"Missing input definition for {', '.join(missing)}\",\n            )\n\n    @property\n    def name(self) -> str:\n        \"\"\"Return blueprint name.\"\"\"\n        return self.data[CONF_BLUEPRINT][CONF_NAME]  # type: ignore[no-any-return]\n\n    @property\n    def inputs(self) -> dict[str, Any]:\n        \"\"\"Return flattened blueprint inputs.\"\"\"\n        inputs = {}\n        for key, value in self.data[CONF_BLUEPRINT][CONF_INPUT].items():\n            if value and CONF_INPUT in value:\n                inputs.update(dict(value[CONF_INPUT]))","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/blueprint/models.py#L65-L101","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Add each listed input under the blueprint's input: section, e.g. 'door_sensor:' plus optionally 'name:'/'selector:' metadata","Or remove the stray !input references from the body if the input is no longer wanted","Re-run the blueprint via Developer Tools > YAML > reload automations to confirm the error is gone"],"exampleFix":"# before\nblueprint:\n  name: Motion light\n  domain: automation\n  input:\n    light:\ntriggers:\n  - trigger: state\n    entity_id: !input motion_sensor\n\n# after\nblueprint:\n  name: Motion light\n  domain: automation\n  input:\n    light:\n    motion_sensor:","handlingStrategy":"validation","validationCode":"from homeassistant.components.blueprint import yaml_util\n\ndef inputs_declared(data: dict) -> bool:\n    referenced = yaml_util.extract_inputs(data)\n    declared = set(data.get(\"blueprint\", {}).get(\"input\", {}))\n    return referenced <= declared","typeGuard":null,"tryCatchPattern":"from homeassistant.components.blueprint.errors import InvalidBlueprint\ntry:\n    Blueprint(data, expected_domain=domain, schema=schema)\nexcept InvalidBlueprint as err:\n    if \"Missing input definition\" in str(err):\n        # add the listed inputs under blueprint.input","preventionTips":["After editing a blueprint body, grep for '!input' names and cross-check the input: block","Use an editor snippet/template that scaffolds both body reference and input definition together"],"tags":["blueprint","inputs","yaml","validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}