Skip to content

Spook reports a false positive “Unknown entities used” warning when using a Jinja template with startswith() to filter entities. #1090

@Csontikka

Description

@Csontikka

What version of Spook are you using?

v4.0.1

What version of Home Assistant are you using?

2025.9.4

The problem

Spook reports a false positive “Unknown entities used” warning when using a Jinja template with startswith() to filter entities.

The warning:

This automation references the following entities, which are unknown to Home Assistant:

binary_sensor.proxmox

Spook treats this as if I were referencing a concrete entity called binary_sensor.proxmox, but it’s only a string prefix, not a real entity.

alias: Proxmox - Host status monitoring
description: >-
  Checks the Proxmox host sensors every hour and sends a status message – only
  in debug mode if everything is fine.
triggers:
  - minutes: 0
    trigger: time_pattern
conditions: []
actions:
  - variables:
      debug_mode: "{{ is_state('input_boolean.telegram_debug_active', 'on') }}"
      error_sensors_list: >-
        {% set errors = namespace(list=[]) %} {% for entity in
        states.binary_sensor if
        entity.entity_id.startswith('binary_sensor.proxmox') %}
          {% if entity.state != 'on' %}
            {% set errors.list = errors.list + [entity.name ~ ' (' ~ entity.state ~ ')'] %}
          {% endif %}
        {% endfor %} {{ errors.list }}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ error_sensors_list | count > 0 }}"
        sequence:
          - data:
              message: >-
                ⚠️ Proxmox host alert: Number of inactive hosts: {{
                error_sensors_list | count }} {% for sensor in
                error_sensors_list %}
                  - {{ sensor.replace('_', ' ') }}
                {% endfor %}
            action: notify.telegram_proxmox
    default:
      - condition: template
        value_template: "{{ debug_mode }}"
      - data:
          message: ✅ [DEBUG] All Proxmox hosts are available.
        action: notify.telegram_proxmox
mode: single

Thanks a lot for developing Spook — it’s an incredibly useful tool!

Anything in the logs? Paste it here!


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions