home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.89k stars 30.96k forks source link

Blueprint for template sensor - not reloaded #130987

Open ildar170975 opened 3 days ago

ildar170975 commented 3 days ago

The problem

Consider this blueprint:

blueprint:
  name: test sensor
  domain: template
  input:
    input_ENTITY:

trigger:
  - platform: state
    entity_id: !input input_ENTITY

conditions:
  - condition: template
    value_template: true

sensor:
  state: >-
    {{ trigger.to_state.state }}

Note that it has conditions instead of condition. Define a sensor:

template:
  - name: testing_blueprint
    use_blueprint:
      path: test_sensor.yaml
      input:
        input_ENTITY: sun.sun

Reload template integration: image

Note an error in Log:

2024-11-19 21:55:02.293 ERROR (MainThread) [homeassistant.config] Invalid config for 'template' at conf/test/template_sensors/test_historical.yaml, line 66: 'conditions' is an invalid option for 'template', check: conditions

Go back to the blueprint, edit to condition. Reload template integration. One more same error is added to Log.

Only after HA reboot the template sensor is created.

Seems that reloading templates does not reload a blueprint.

What version of Home Assistant Core has the issue?

2024.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

template

Link to integration documentation on our website

https://www.home-assistant.io/integrations/template

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 days ago

Hey there @phracturedblue, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `template` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign template` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation template source (message by IssueLinks)

diplix commented 3 days ago

i can confrm, that (template) blueprints don’t reload after the initial loading of the blueprint. workaround is to rename the blueprint (and reference name).