spook icon indicating copy to clipboard operation
spook copied to clipboard

Unknown entities used in automation

Open bastoonch opened this issue 2 months ago • 7 comments

What version of Spook are you using?

4.0.1

What version of Home Assistant are you using?

2025.9.4

The problem

I have an Unknown entities used in one of my automation reported while this variable exists. I used to have it in the past, because the variable is created after the startup of HASS, but it use to disappear after few minutes as I believe Spook was refreshed. Now the notification stays for ever :

Image Image

Anything in the logs? Paste it here!


bastoonch avatar Sep 26 '25 08:09 bastoonch

Can you please share the YAML sources, so I have something to try to reproduce.

../Frenck

frenck avatar Sep 26 '25 11:09 frenck

You know what...I feel so ashamed... I rebooted my server and since, I don't have the message anymore.

bastoonch avatar Sep 26 '25 11:09 bastoonch

Hi @frenck

I just recently upgraded to 4.0.1 and I also started seeing this warning but only for timer.finished across 4 different automations that I have been using for a while.

The warning refers to timer.finished as a missing entity.

  • trigger: event event_type: timer.finished event_data: entity_id: timer.bathroom_fan
  • trigger: event event_type: timer.cancel event_data: entity_id: timer.bathroom_fan

I am not getting a warning for the timer.cancel trigger though.

davecpearce avatar Sep 26 '25 11:09 davecpearce

I have the same issue, however for me it is related to a template file. The error:

Image

The code from the automation:

alias: trash
description: ""
triggers:
  - trigger: time
    at: "19:00:00"
    id: time_static
  - trigger: sun
    event: sunset
    offset: "-1:00:00"
    id: time_before_sunset
  - trigger: sun
    event: sunset
    id: time_sunset
  - trigger: sun
    event: sunset
    offset: "1:00:00"
    id: time_after_sunset
  - trigger: state
    entity_id:
      - input_boolean.trash_take_out
    from: "off"
    to: "on"
    id: trash_take_out_on
  - trigger: state
    entity_id:
      - input_boolean.trash_take_out
    from: "on"
    to: "off"
    id: trash_take_out_off
  - trigger: state
    entity_id:
      - binary_sensor.0_ft_door_contact
    from: "off"
    to: "on"
    id: door_opened
  - trigger: state
    entity_id:
      - sun.sun
    from: below_horizon
    to: above_horizon
    id: sun_above_horizon
conditions:
  - condition: state
    entity_id: input_boolean.manual_override_enabled
    state: "off"
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ now().weekday() == 0 }}"
            alias: is monday
        sequence:
          - choose:
              - conditions:
                  - condition: trigger
                    id:
                      - time_static
                      - time_before_sunset
                      - time_sunset
                      - time_after_sunset
                sequence:
                  - if:
                      - alias: door was not opened
                        condition: template
                        value_template: "{{ was_door_opened==\"off\" }}"
                      - condition: state
                        entity_id: input_boolean.trash_take_out
                        state: "off"
                      - condition: template
                        value_template: "{{ trash_take_out_changed==\"off\" }}"
                        alias: flag for taking out the trash did not changed?
                    then:
                      - action: input_boolean.turn_on
                        metadata: {}
                        data: {}
                        target:
                          entity_id: input_boolean.trash_take_out
                      - data:
                          title: trash
                          message: take out
                        action: script.notification
                      - action: script.todo_actions
                        metadata: {}
                        data:
                          action: needs_action
                          item: "{{ todo_item_trash_take_out }}"
                          list: todo.home_actions
                          debug: false
                    else:
                      - if: []
                        then:
                          - action: input_boolean.turn_on
                            metadata: {}
                            data: {}
                            target:
                              entity_id: input_boolean.trash_take_out
              - conditions:
                  - condition: trigger
                    id:
                      - door_opened
                sequence:
                  - action: input_boolean.turn_on
                    metadata: {}
                    data: {}
                    target:
                      entity_id: input_boolean.trash_take_out
                  - action: script.todo_actions
                    metadata: {}
                    data:
                      action: completed
                      item: "{{ todo_item_trash_take_out }}"
                      list: todo.home_actions
                      debug: false
              - conditions:
                  - condition: trigger
                    id:
                      - sun_above_horizon
                sequence:
                  - action: input_boolean.turn_off
                    metadata: {}
                    data: {}
                    target:
                      entity_id: input_boolean.trash_prepare_recicled
      - conditions:
          - alias: is tuesday
            condition: template
            value_template: "{{ now().weekday() == 1 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: trigger
                    id:
                      - sun_above_horizon
                sequence:
                  - action: input_boolean.turn_off
                    metadata: {}
                    data: {}
                    target:
                      entity_id: input_boolean.trash_take_out
      - conditions:
          - alias: is sunday
            condition: template
            value_template: "{{ now().weekday() == 6 }}"
          - condition: template
            value_template: "{{ should_prepare_recicled==\"on\" }}"
            alias: should prepare recycled
        sequence:
          - choose:
              - conditions:
                  - condition: trigger
                    id:
                      - sun_above_horizon
                sequence:
                  - action: input_boolean.turn_on
                    metadata: {}
                    data: {}
                    target:
                      entity_id: input_boolean.trash_prepare_recicled
                  - action: script.todo_actions
                    metadata: {}
                    data:
                      action: needs_action
                      item: "{{ todo_item_trash_prepare_recicled }}"
                      list: todo.home_actions
                      debug: false
                  - data:
                      title: trash
                      message: prepare the recicled
                    action: script.notification
variables:
  was_door_opened: >-
    {%- from "time.jinja" import was_changed -%} {%- set result =
    was_changed("binary_sensor.0_ft_door_contact", 420) -%}{{ result }}
  trash_take_out_changed: >-
    {%- from "time.jinja" import was_changed -%} {%- set result =
    was_changed("input_boolean.trash_take_out", 480) -%}{{ result }}
  trash_prepare_recicled_changed: >-
    {%- from "time.jinja" import was_changed -%} {%- set result =
    was_changed("input_boolean.trash_prepare_recicled", 480) -%}{{ result }}
  should_prepare_recicled: >-
    {%- set recicleTs = states('input_datetime.trash_recicle_day')|as_timestamp
    -%} {%- set today = now().strftime('%Y-%m-%d')|as_timestamp -%} {%- set days
    = ((today+(60*60*24*2)-recicleTs)/(60*60*24))|round -%}{{ iif(days%14==0,
    "on", "off") }}
  todo_item_trash_take_out: "trash: take out"
  todo_item_trash_prepare_recicled: "trash: prepare the recicled"
mode: single

and I have the "time.jinja" file, the automation was perfect and if I try the code in developer tools it returns what I expect.

By the way this is something new with v4.0.1 (in 4.0.0 no issue)

pauldcomanici avatar Sep 26 '25 13:09 pauldcomanici

I have a similar issue, but it's related to an entity in a template that's commented out.

Repair notification: Image

Automation editor: Image

YAML section from the automation:

data:
  media_player_entity_id: media_player.living_room_speaker
  message: >-
    {#{ state_translated('sensor.toothbrush_change_head') | string }} indicates
    time to change, toothbrush head #}

    {{ trigger.to_state.attributes.friendly_name | string }} indicates time to
    change, toothbrush head
  cache: false
target:
  entity_id: tts.google_en_com
action: tts.speak

brettmiller avatar Sep 27 '25 03:09 brettmiller

You know what...I feel so ashamed... I rebooted my server and since, I don't have the message anymore.

After my nightly restart of HASS the message is back

`alias: Jellyfin - Shutdown server if no activity description: "" triggers:

  • minutes: /10 trigger: time_pattern conditions:
  • condition: and conditions:
    • condition: state entity_id: binary_sensor.jellyfin state: "on" for: hours: 0 minutes: 10 seconds: 1
    • condition: state entity_id: variable.jellyplayingitems attribute: TotalNumberOfPlayingItems state: "0" for: hours: 0 minutes: 14 seconds: 0
    • condition: template value_template: |- {% if states("media_player.family_room") == "playing" -%} {% if not 'x-file-cifs' in state_attr("media_player.family_room", "media_content_id") -%} True {%- else %} False {%- endif %} {%- else %} True {%- endif %} alias: Test if Sonos is playing media from Jellyfin
    • condition: not conditions:
      • condition: or conditions:
        • condition: state entity_id: sensor.qbittorrent_status state: downloading
        • condition: state entity_id: sensor.qbittorrent_status state: up_down alias: Test if downloading on Qbittorent
    • condition: state entity_id: input_boolean.varshutdownjelly state: "on" actions:
  • if:
    • condition: and conditions:
      • condition: numeric_state entity_id: input_number.shutdown_jelly above: 0 then:
    • data: {} action: shell_command.shutdown_jelly
    • action: input_number.set_value metadata: {} data: value: 0 target: entity_id: input_number.shutdown_jelly
    • metadata: {} data: message: Shutting down jellyfin action: notify.notify else:
    • action: input_number.set_value metadata: {} data: value: 1 target: entity_id: input_number.shutdown_jelly
    • metadata: {} data: message: Jellyfin will be shutdown in 10 min as there is no activity. action: notify.notify mode: single `

bastoonch avatar Sep 27 '25 04:09 bastoonch

Closed by mistake

bastoonch avatar Sep 27 '25 05:09 bastoonch