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
70.99k stars 29.64k forks source link

Using invalid !input in blueprint does not raise any warning, just ignores blueprint #90145

Open Zocker1999NET opened 1 year ago

Zocker1999NET commented 1 year ago

The problem

When using !input with a non-existent input for setting a variable in a blueprint (see example in YAML below), Home-Assistant does outright just skip reading the file any further without issuing any warnings.

I even tried to set the log level from WARNING to INFO where no log appeared either.

This makes

Steps to reproduce:

  1. Check your available blueprints (in my case, for automation)
  2. Add the example blueprint from below (with the error)
  3. Re-check the list of blueprints, it should still be missing (no explicit reload required as blueprints are (at least tried to) reloaded on every file change, step 5 confirms this)
  4. Comment out the error line
  5. Re-check the list of blueprints, now the blueprint appears

What version of Home Assistant Core has the issue?

2023.3.5

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

Blueprints

Link to integration documentation on our website

https://www.home-assistant.io/docs/blueprint/

Diagnostics information

No response

Example YAML snippet

# this is the original where I discovered this issue

blueprint:
  name: Home Assistant update notification
  description: Send a notification when theres an update availiable for Home Assistant
  domain: automation
  input:
    current_tracker:
      name: Current Version sensor
      description: The sensor which tracks the current available version
      selector:
        entity:
          integration: version
          domain: sensor
    update_tracker:
      name: Update sensor
      description: The sensor which tracks the newest available version
      selector:
        entity:
          integration: version
          domain: sensor
    notification_title:
      name: Notification title (Optional)
      description: "Text to use as title. May use variables current_version and newest_version."
      default: "Version {{ newest_version }} of Home-Assistant was released"
    notification_message:
      name: Notification message (Optional)
      description: "Text to use as message. May use variables current_version and newest_version."
      default: "You currently run version {{ current_version }}. You may find the release notes here."
    notify_device:
      name: Device to notify
      description: Device needs to run the official Home Assistant app to receive notifications
      selector:
        device:
          integration: mobile_app
    is_ios:
      name: Is it an iOS device?
      description: Toggle if your selected device runs iOS, default is true
      selector:
        boolean:
      default: true

variables:
  current_tracker: !input current_tracker
  update_tracker: !input update_tracker
  current_version: "{{ states[current_tracker].state }}"
  newest_version: "{{ states[update_tracker].state }}"
  release_notes: "https://www.home-assistant.io/blog/categories/release-notes/"
  is_ios: !input is_ios
  notify_device: !input notify_device
# the next line causes the issue, commenting out lets Home-Assistant use the blueprint flawless
  include_release_notes: !input include_release_notes
  notification_title: !input notification_title
  notification_message: !input notification_message

trigger:
  - platform: template
    value_template: "{{ current_version != newest_version }}"
    for:
      minutes: 1

action:
  - device_id: !input notify_device
    domain: mobile_app
    type: notify
    title: "{{ notification_title }}"
    message: "{{ notification_message }}"
    data: >
      {% if include_release_notes %}
        {% set android_data = { "clickAction": "%s" } | format(release_notes) %}
        {% set ios_data = { "url": "%s" } | format(release_notes) %}
        {{ ios_data if is_ios else android_data }}
      {% endif %}

Anything in the logs that might be useful for us?

That's the issue, these are missing

Additional information

No response

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

elupus commented 5 months ago

Just ran into this myself. It's silently just ignored.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

elupus commented 1 month ago

Still valid i think