Scripts
A script in Home Assistant is a sequence of actions you can start whenever you like: from a dashboard button, a voice command, or as an action in an automation. Unlike an automation, a script has no trigger of its own. Write the "movie night" steps once, and use them from everywhere.
That makes a broken script sneaky. It does nothing until somebody starts it, and only then you find out one of its steps points at something that is gone. Spook looks through your scripts ahead of time, and raises a repair when it finds something wrong. It also adds actions to start a script once, later, in a way that survives a restart of Home Assistant, and one to read how its last runs went.

Actions
Spook adds five actions for scripts: two to start one later, one to call that off, one to see what is coming, and one to read how the last runs went. You find them wherever you add an action, marked with a 👻.
A script with a delay in front already starts something later. Until Home Assistant restarts during the delay: then the run is gone, and nothing tells you. Spook writes every run down, so it survives the restart.
A script has one scheduled run at most. Scheduling it again replaces the run it has, so the "in 20 minutes" button pressed twice moves the reminder, it does not add a second one.
Spook starts the script with script.turn_on, the way you would, under the user who scheduled it. The trace and the logbook name that person, and the actions in the script get checked against their rights, the same as if they had started it themselves. Spook lets the run go once the script has started, not once it is done.
A run whose time passed while Home Assistant was not running starts once Home Assistant is back, after it has finished starting. Several start in the order of their times. Set Skip if missed to drop such a run instead; Spook then says so in the log, at the info level.
Who may schedule or cancel a run is the same as who may start the script with script.turn_on: Home Assistant does not check that per script, so anybody who may perform actions may start any script. Only the list is for administrators, because it shows every run in the house and who scheduled it.
A script that is renamed keeps its run. A script that is deleted loses it. One that is unavailable at its time, because it failed to set up or was taken out of your configuration, is not started: Spook names it in the log, and drops the run.
Templates in an automation are rendered first. Your automation or script renders every template in the data of an action before the action sees it, the variables included. So message: "It is {{ now().hour }} o'clock" is the hour at the moment you schedule the run, not the one at which the script starts. A script does not render its variables again, so raw tags do not help here either. Need something worked out when the script starts? Put the template in the script itself.
Run in
Starts a script once, after a while.
How to use it
- Open the automation or script that should do the scheduling, and select Add action.
- Search for run in, and select Script: Run in 👻.
- Under Targets, choose the script to start.
- Set Duration to how long from now, like
00:20:00for twenty minutes. - Optionally, fill in Variables for the script, like
message: The dryer is still full. - Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Script: Run in 👻 |
| Action name | script.run_in |
| Action targets | Yes, script entities |
| Action response | Optional, per script when it runs |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
duration | string | Yes | 00:20:00 |
variables | object | No | {"message": "The dryer is done"} |
skip_if_missed | boolean | No | false |
The response has an entry for every script it scheduled, with when it runs, in UTC: {"script.dryer_reminder": {"runs_at": "2026-12-03T20:15:00+00:00"}}. A script that is unavailable is passed over, the same way script.turn_on passes over it.
The variables have to be something Spook can write down: text, numbers, true and false, lists and mappings. A time is written down as text, and the script gets it as text, also before a restart. Anything else is refused, with an error that names the variable.
The dryer is done, and you are busy. A button on your dashboard reminds you again in twenty minutes. Press it again, and the reminder moves:
type: button
name: Remind me in 20 minutes
icon: mdi:tumble-dryer
tap_action:
action: perform-action
perform_action: script.run_in
target:
entity_id: script.dryer_reminder
data:
duration: "00:20:00"
variables:
message: The dryer is still full
With the script it starts:
dryer_reminder:
alias: Dryer reminder
fields:
message:
description: What to tell
sequence:
- action: notify.mobile_app_phone
data:
message: "{{ message }}"
Turn the heating down two hours after everybody left. When Home Assistant was down at that time, the run is skipped: by then somebody may well be home again.
action: script.run_in
target:
entity_id: script.heating_to_eco
data:
duration: "02:00:00"
skip_if_missed: true
Schedule it, and say when:
actions:
- action: script.run_in
target:
entity_id: script.dryer_reminder
data:
duration: "00:20:00"
response_variable: scheduled
- action: notify.mobile_app_phone
data:
message: >-
I will remind you at
{{ as_timestamp(scheduled['script.dryer_reminder'].runs_at) | timestamp_custom('%H:%M') }}
- One run per script. Scheduling a script that has a run replaces that run, with its time and its variables.
- A run missed while Home Assistant was down starts once it is back, which can be hours late. Set Skip if missed when late is worse than not at all.
- Templates in the variables are rendered when you schedule the run, not when the script starts.
- The run is started, not waited for. The action returns right away, and nothing waits for the script to finish.
- A script in
singlemode that is still running when its time comes does what it always does: it does not start a second time, and Home Assistant logs that it is already running. - A
durationof zero is refused. To start a script right away, usescript.turn_on.
Run at
Starts a script once, at a time.
The same as Run in, with the time given rather than a duration. A time without a time zone, like the one the date and time picker gives, is in the time zone of Home Assistant. A time that is not ahead of now is refused, rather than started right away: that is far more often yesterday's date in a template than a wish. To start a script now, use script.turn_on.
How to use it
- Open the automation or script that should do the scheduling, and select Add action.
- Search for run at, and select Script: Run at 👻.
- Under Targets, choose the script to start.
- Set At to when it should start.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Script: Run at 👻 |
| Action name | script.run_at |
| Action targets | Yes, script entities |
| Action response | Optional, per script when it runs |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
at | string | Yes | 2026-12-24 18:00:00 |
variables | object | No | {"message": "Dinner is ready"} |
skip_if_missed | boolean | No | false |
The response is the same as the one of Run in.
Start warming up the house at the time a date and time helper holds. Set the helper on your dashboard to a time ahead, and the run moves with it:
triggers:
- trigger: state
entity_id: input_datetime.warm_up_at
actions:
- action: script.run_at
target:
entity_id: script.warm_up_the_house
data:
at: "{{ states('input_datetime.warm_up_at') }}"
The helper needs both a date and a time. One with only a time gives 06:30:00, which is no moment. For one of those, at: "{{ today_at(states('input_datetime.warm_up_time')) }}" is today at that time.
A reminder for tomorrow morning at seven:
action: script.run_at
target:
entity_id: script.announce
data:
at: "{{ today_at('07:00') + timedelta(days=1) }}"
variables:
message: Put the bins out
- A time that is not ahead of now is refused. An automation that schedules from a helper set in the past stops there, with an error, and the run it scheduled before stays where it was.
- One run per script, and a run missed while Home Assistant was down starts once it is back, the same as for Run in.
- Templates in the variables are rendered when you schedule the run, not when the script starts.
- The run is started, not waited for.
Cancel scheduled run
Drops the run Run in or Run at scheduled for a script. A script without one is left alone, without an error. A script that is unavailable still has its run dropped.
How to use it
- Open the automation or script that should do the cancelling, and select Add action.
- Search for cancel scheduled run, and select Script: Cancel scheduled run 👻.
- Under Targets, choose the scripts whose run to drop.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Script: Cancel scheduled run 👻 |
| Action name | script.cancel_scheduled_run |
| Action targets | Yes, script entities |
| Action response | Optional, per script whether it had a run |
| Spook's influence | Newly added action |
| Tools | Try this action |
The response has an entry for every script it looked at, saying whether it had a run that is now dropped: {"script.heating_to_eco": {"cancelled": true}}.
Somebody came home, so the heating does not go down after all:
triggers:
- trigger: state
entity_id: person.anne
to: home
actions:
- action: script.cancel_scheduled_run
target:
entity_id: script.heating_to_eco
Every scheduled run, gone:
action: script.cancel_scheduled_run
target:
entity_id: all
- It drops a run that has not started yet. A script that is already running keeps running:
script.turn_offstops that one.
List scheduled runs
Lists every run Run in and Run at scheduled, the first one first: when it starts, the variables it hands the script, and the user who scheduled it.
How to use it
- Open the automation or script that needs the list, and select Add action.
- Search for list scheduled runs, and select Script: List scheduled runs 👻.
- Under Response variable, give the list a name, like
runs. The steps after this one can use it. - Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Script: List scheduled runs 👻 |
| Action name | script.list_scheduled_runs |
| Action targets | No |
| Action response | Always, every scheduled run |
| Spook's influence | Newly added action |
| Tools | Try this action |
The response holds every run under scheduled_runs, by script:
{
"scheduled_runs": {
"script.dryer_reminder": {
"runs_at": "2026-12-03T20:15:00+00:00",
"variables": { "message": "The dryer is still full" },
"user_id": "5a27b1a6c8cb4f0bbd6f6d02c4b6a3e1",
"skip_if_missed": false
}
}
}
user_id is null for a run an automation scheduled on its own. Run by hand, the action takes an administrator. Your automations can always run it. So can your scripts, unless a user who is not an administrator starts one.
Tell me what is coming:
actions:
- action: script.list_scheduled_runs
response_variable: runs
- action: notify.mobile_app_phone
data:
message: >-
{% for script, run in runs.scheduled_runs.items() %}
{{ state_attr(script, 'friendly_name') }} at
{{ as_timestamp(run.runs_at) | timestamp_custom('%H:%M') }}.
{% endfor %}
Get traces
Returns a summary of the last runs of a script: when it ran, how it ended, the error if there was one, and the last step it reached.
Home Assistant keeps a trace of the last runs of every script, five by default. The trace view shows them, but an automation or another script cannot read them. Get traces hands them over as a response, so you can act on them: a daily note of the scripts whose last run failed, or a check after a run you started yourself.
It is a summary, never the whole trace. A trace holds the variables of the run and the states it read, and secrets can be among them. Those stay out. What a trace says in words of its own, like an error or the reason of a stop, is cleaned of anything that looks like a secret first.
The runs come newest first. Only failed runs keeps the runs that ended in an error, a stop with error: true included. Limit cuts the list after that, so a limit of 1 with only failed runs is the last run that failed, however long ago.
Reading traces is for administrators, the same as the trace view of Home Assistant. Automations can always call it. A script started by a user who is not an administrator runs as that user, and is refused.
How to use it
- Open the script or automation that should read the runs, and select Add action.
- Search for traces, and select Script: Get traces 👻.
- Under Targets, choose the scripts.
- Under Response variable, give the response a name, like
traces. - Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.
| Action properties | |
|---|---|
| Action | Script: Get traces 👻 |
| Action name | script.get_traces |
| Action targets | Yes, script entities |
| Action response | Yes, per script a summary of its last runs |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
limit | integer | No | Every kept run |
only_failed | boolean | No | false |
The response has an entry for every script, like {"script.good_night": {"stored_traces": 5, "runs": [...]}}. stored_traces is how many runs the script keeps a trace of. Every run in runs has these keys, null when it does not apply:
| Key | What it holds |
|---|---|
run_id | The ID of the trace, the one the trace view knows it by. |
started | When the run started, in the time zone of your home. |
finished | When it ended. null while it is still running. |
seconds | How long it took. |
ended | How it ended: finished, stopped, error, aborted, cancelled, skipped_still_running, skipped_max_runs, skipped_recursion or still_running. |
failed | true when it ended in an error, a stop with error: true included. |
error | The error it ended with. |
error_step | The step that failed, like sequence/2. |
stop_reason | What a stop action said. |
last_step | The last step the run reached, like sequence/1. |
The last run of the good night script that failed:
action: script.get_traces
target:
entity_id: script.good_night
data:
only_failed: true
limit: 1
response_variable: traces
- It reads what Home Assistant keeps, and no further back: five runs per script by default. Set
stored_tracesundertrace:in the script to keep more. - A script that failed to set up, the ones Home Assistant shows as unavailable, is skipped by Home Assistant before Spook sees it.
last_stepis the step that started last, not always the last step of the script: in parallel branches, it can belong to a branch that finished before another.- A script of your own with the ID
get_traceskeeps its action, and Spook leaves this one out. Give that script another ID to get it: renaming it changes its name, not its ID.
Repairs
Spook looks through your scripts for things that can no longer work, and tells you in the repairs dashboard. Each repair names the script and what is wrong with it.
Fixing one always goes the same way: select the name of the script in the repair, change what the repair points at, and save. Spook looks again when you save, and takes the repair away by itself. New to this? Follow Fix your first repair.
An entity, device, area, floor or label that only disabled steps (enabled: false) name is left alone. A disabled step does nothing, and is usually parked on purpose. Anything a running step names as well is still reported.
Want Spook to leave one script alone? Keep it out on the Exclusions page of Spook's panel, or put the Excluded from Spook label on it. How that works.
Unknown referenced areas
A script targets an area that no longer exists, usually because the area was removed or merged into another. The step that uses it does nothing.
Unknown referenced areas
A script targets an area that no longer exists, usually because the area was removed or merged into another. The step that uses it does nothing.

How to fix it: Open the script from the repair, and in the step that uses the missing area, pick an area that exists. Or remove the step. The repair disappears by itself once it is fixed.
Spook looks at every area your scripts target in their actions. When that area does not exist, it raises a repair that names the script and the missing area.
As with automations, templates are read as well, for area_entities and area_devices: an area ID, or the name or an alias of an area, in any case. An entity or device ID is reported too, as these take nothing but an area; area_entities(area_id('light.kitchen')) gives what is in the area of that light. Only a value written out in the template is checked, and not a lookup called by a name the script gives a meaning of its own, as a variable or a field.
Unknown referenced attributes
A script waits for, or checks, an attribute its entity does not have, like brightness on a plain switch. An attribute is an extra detail an entity carries next to its state. A wait like that only ends on its timeout, and a check like that never passes. You get no error.
Unknown referenced attributes
A script waits for, or checks, an attribute its entity does not have, like brightness on a plain switch. An attribute is an extra detail an entity carries next to its state. A wait like that only ends on its timeout, and a check like that never passes. You get no error.
How to fix it: Open the script from the repair and use an attribute the entity has. When Spook is nearly certain what you meant, the repair says so. The repair disappears by itself once it is fixed.
Spook looks at the attributes your scripts use: the attribute of state and numeric state triggers and conditions, the attribute Spook's own state trigger follows, and attributes named in templates, like state_attr('light.kitchen', 'brightness'). When a script uses an attribute its entity does not have, Spook raises a repair. It names the script, the attribute and the entity, and what was most likely meant when Spook is near certain of it.
A trigger waiting on an attribute that never shows up loads fine and never fires. You get no error.
Many attributes only show up some of the time: a media player that is off drops most of its own, and integrations add their own that come and go. So an attribute is only reported when Spook cannot find it anywhere: not on the entity right now, not as something that kind of entity offers in Home Assistant, and not in anything the recorder remembers the entity having. An entity the recorder does not record is only checked for attributes that differ from a real one in upper and lower case alone, like Brightness. An attribute or entity that is only worked out while running, from a variable for example, is not checked. Neither is a template using states or state_attr when the script gives that name a meaning of its own, as a variable, a field or a response variable.
Spook does not look right after Home Assistant starts, when the recorder is busy, but ten minutes later. After that it looks again once a reload of scripts is done, when a script is added or removed, when the entity registry changes, when an integration loads or its configuration changes, and once a day. An attribute that newly shows up on an entity is picked up the next time it looks.
Unknown referenced states
A script waits for, or checks, a state its entity is never in, like On for a light that is on or off. A wait like that only ends on its timeout, and a check like that never passes. You get no error.
Unknown referenced states
A script waits for, or checks, a state its entity is never in, like On for a light that is on or off. A wait like that only ends on its timeout, and a check like that never passes. You get no error.
How to fix it: Open the script from the repair and use a state the entity can be in. Picking the state from the list in the editor, instead of typing it, avoids this. When Spook is nearly certain what you meant, the repair says so. The repair disappears by itself once it is fixed.
Spook looks at the states your scripts wait for and check: the to, from, not_to and not_from of state triggers, the state of state conditions, the same options of Spook's own state trigger, and in templates is_state('light.kitchen', 'on') and a state compared to text, like states('light.kitchen') == 'on', states.light.kitchen.state != 'off' or states('light.kitchen') in ['on', 'off']. When a script uses a state its entity is never in, like On for a light that is on or off, Spook raises a repair. It names the script, the state and the entity, and what was most likely meant when Spook is near certain of it.
A trigger waiting for a state that never comes loads fine and never fires. You get no error.
A state named as what the entity must not be is a guard, and a guard works whatever it names: not_to: unavailable, states('light.kitchen') != 'none' or states('light.kitchen') not in ['unavailable', 'unknown', 'none', '']. A state condition inside a not condition is a guard as well, and so is a comparison a not turns around from further out, like not (is_state('light.kitchen', 'on') and states('light.kitchen') == 'none'). A list works as long as one of its states can happen: to: ["on", home] still waits for on. So those are only reported for a state that differs from a real one in upper and lower case alone, like On. A list the state must be in is also reported when none of its states can ever happen.
Only entities whose states are a fixed set are checked: the ones Home Assistant itself lists for that kind of entity (like a light, a cover, a lock, an alarm panel or a media player), or the options the entity offers right now, like a select, a dropdown helper, or a sensor with a fixed list of values. A plain sensor, a number or a text can be anything, so those are not checked, and neither are persons and device trackers, whose states are zone names. Everything the entity was in counts as well: right now, and anything the recorder remembers. An entity whose state is set from outside of its integration, by a REST call or a Python script for example, is not checked either.
For some kinds of entity, Home Assistant itself makes sure the state is one of the set: lights, switches, binary sensors, covers, locks, valves, climate entities, and the like. There, a state that differs from a real one in upper and lower case alone, like On, is always reported, and anything else outside of the set when Spook has the whole history of the entity from the recorder. For the rest, the set is what is usual, not all that is possible: a media player made from a template can be in any state it likes, and a select, a dropdown helper or a sensor with a fixed list of values can get new options while running. Those only get a state reported that differs from a real one in case alone, and only when Spook has the whole history of the entity. The same goes for an entity that works out its state in a way of its own.
With an attribute, a state trigger or condition waits for a value of that attribute instead, and those are checked too, in the same issue: like Heating for the hvac_action of a thermostat, which is heating. Only attributes whose values are a fixed set: the ones Home Assistant itself lists for that kind of entity (the action of a thermostat or a humidifier, the device class of a sensor, the repeat mode of a media player, and the like), or whose values the entity offers in another attribute, like the fan modes, preset modes and swing modes of a thermostat, the effects of a light, or the sources of a media player. Home Assistant writes whatever the integration hands it for any of these, so only a value that differs from a real one in how it is written is reported, and only when Spook has the whole history of the entity. That is upper and lower case, or YAML reading what was meant as text as something else: an unquoted off is the boolean false, and 2 is a number, while the attribute holds the text "off" or "2". Such a value is shown the way YAML read it, with the text that was meant in quotes. Spook's own state trigger is checked the same way when it follows an attribute, with one difference: it makes text of whatever the attribute holds and compares that with the text of its to, from, not_to and not_from. So there, a value in another case is a slip, like Heating for heating, and so is a value YAML read as a boolean or a number whose text the attribute never holds: an unquoted off becomes the text False, which a preset mode off never is. A 2 becomes 2, the same text as a fan mode "2", so that one is fine. A 1.0 becomes 1.0, which is not reported against a "1": a number is never taken for a slip of another number. An attribute the entity never had is not looked at here: that is an unknown attribute, which the script gets an issue of its own for.
A state or entity that is only worked out while running, from a variable or a template for example, is not checked. In templates, only a comparison with nothing else taking part in it is read: once a filter like | lower, a ~ or anything like it is in between, what is compared is no longer the state itself. A template is not read for states, is_state or state_attr either when the script gives that name a meaning of its own, as a variable, a field or a response variable.
Spook looks at the same moments as for unknown attributes: ten minutes after Home Assistant starts, after that again once a reload of scripts is done, when a script is added or removed, when the entity registry changes, when an integration loads or its configuration changes, and once a day.
Unknown referenced devices
A script uses a device that no longer exists, usually because it was removed or replaced. Conditions, waits and actions that use it no longer work.
Unknown referenced devices
A script uses a device that no longer exists, usually because it was removed or replaced. Conditions, waits and actions that use it no longer work.

How to fix it: Open the script from the repair, and in the step that uses the missing device, pick the device that replaced it. Or remove the step. The repair disappears by itself once it is fixed.
Spook looks at every device your scripts use. When that device does not exist, it raises a repair that names the script and the missing device.
As with automations, only values shaped like a device ID are considered: thirty-two hexadecimal characters, which is what Home Assistant hands out. An integration taking a device_id that means its own hardware, such as RFLink's protocol address, is left alone.
Split devices
A script uses a device that Home Assistant split, by the ID the device had before. It still works today, but stops working in Home Assistant 2027.8.
Split devices
A script uses a device that Home Assistant split, by the ID the device had before. It still works today, but stops working in Home Assistant 2027.8.
Home Assistant 2026.8 split every device that belonged to more than one integration into one device per integration, each with an ID of its own. The old ID is no device anymore. For now, Home Assistant passes it on to the devices that replaced it: an action targeting the old ID reaches their entities, and device conditions and actions keep working. Home Assistant 2027.8 stops doing that, and from then on, what uses an old ID does nothing.
How to fix it: Open the script from the repair, and pick the device again where the old one is used. The editor offers the device that replaced it. The repair names those devices too. The repair disappears by itself once nothing in the script uses an old ID anymore.
Spook looks at every device your scripts use, the same way it does for unknown referenced devices. When Home Assistant says a device was split from one of those IDs, Spook raises a repair that names the script, the old ID and the devices it was split into.
An event trigger a wait_for_trigger waits for is left out, and Spook does not report it in a script. On an old ID, it already waits for an event that never comes: integrations fire their events with the ID of the new device. Its event data is YAML, without a device picker, so replace the old device_id in the event_data with the ID of the device that sends the event yourself.
Unknown referenced integration entries
An action in a script points at an integration entry that no longer exists: one setup of an integration, like your Hue bridge. This usually happens after you removed an integration and added it again: it looks the same, but the action still points at the old one, and fails when it runs.
Unknown referenced integration entries
An action in a script points at an integration entry that no longer exists: one setup of an integration, like your Hue bridge. This usually happens after you removed an integration and added it again: it looks the same, but the action still points at the old one, and fails when it runs.
How to fix it: Open the script from the repair, and pick the integration entry again in the actions it names. The repair disappears by itself once it is fixed.
Spook looks at the integration entries your scripts hand their actions. Plenty of integrations have actions that ask which of their integration entries to use, like Nord Pool's prices or Mealie's recipes. When a script hands one an integration entry that does not exist, Spook raises a repair. The same goes for an integration entry of another integration than the action asks for, which happens when a step is copied from an action of another integration. The repair names the script and the integration entries that go nowhere.
Home Assistant only refuses these when the step runs, so a script that runs once in a while fails exactly then. This usually happens after an integration was removed and added again: that gives it a new integration entry, with a new ID, and every action still holds the old one.
Spook only looks at the fields an action itself says take an integration entry, never at a field because of its name. Only actions that are there right now say what they take, so the actions of an integration that is not loaded are not checked. An integration entry that exists but is not loaded right now, because it is disabled or failed to set up, is not reported either: that is the state of the integration, not a mistake in the script. An integration entry worked out while running, from a template or a variable, is not checked, and neither is a disabled step.
Unknown referenced entities
A script uses an entity that no longer exists, usually because it was renamed, replaced or removed. The step that uses it does nothing.
Unknown referenced entities
A script uses an entity that no longer exists, usually because it was renamed, replaced or removed. The step that uses it does nothing.
How to fix it: Open the script from the repair, and in the step that uses the missing entity, pick the right one. Or remove the step. The guide Fix your first repair walks you through this one for an automation, and a script goes the same way. The repair disappears by itself once it is fixed.
Spook looks at every entity your scripts use. When an entity ID does not exist, it raises a repair that names the script and the missing entity ID.
That includes the entities a trigger or condition compares against without calling them entity_id: a numeric state threshold like above: input_number.limit, and a state condition whose state is an input helper, like state: input_select.mode, which compares with that helper's state. Home Assistant only reads it as a helper when it is written in lower case, and only on a state condition: a state trigger's to is always a state.
An entity spelled out after states, like states.light.kitchen.state, is not checked when that states is not Home Assistant's: when a template defines its own with a macro or {% set %}, or the script gives the name a meaning of its own, as a variable, a field or a response variable. Used as a filter, like 'light.kitchen' | states, it still is Home Assistant's, and still checked. An entity ID in quotes is checked wherever it is, whatever it is handed to.
The target of an action can name an entity by its entity registry ID, the 32 characters Home Assistant gives every entity in its registry, in place of its entity ID. Home Assistant only looks that ID up when the step runs, so the script loads fine and the step fails every time it runs. Spook checks it there, and when the entity was deleted, the repair says which entity it was.
Unknown referenced actions
A script uses an action that does not exist, usually because the integration that provided it was removed. The step fails when it runs.
Unknown referenced actions
A script uses an action that does not exist, usually because the integration that provided it was removed. The step fails when it runs.
How to fix it: Open the script from the repair and replace or remove the step. Or bring back the integration the action came from. The repair disappears by itself once it is fixed.
Spook looks at every action your scripts use. When that action does not exist, it raises a repair that names the script and the missing action.
Actions of an integration you disabled are not reported: switched off on purpose is not gone. Once you enable the integration again, they are checked as usual. Actions of an integration Home Assistant keeps retrying to set up are left out too: it is installed, and its actions come back once it loads. The outage itself shows on the failed integrations card. Once Home Assistant gives up on it with an error, its actions are reported as usual.
Unknown icons
A script has an icon, or hands one out, that Home Assistant does not have, usually because of a typo or a renamed icon. Whatever gets it shows an empty spot where the icon should be.
Unknown icons
A script has an icon, or hands one out, that Home Assistant does not have, usually because of a typo or a renamed icon. Whatever gets it shows an empty spot where the icon should be.
How to fix it: Open the script from the repair and pick an icon that exists. When Spook is nearly certain what you meant, the repair says so. The repair disappears by itself once it is fixed.
Spook looks at the icon of each script, and at the icons its actions hand out. Only actions that say they take an icon are looked at, like group.set, and the actions of Spook that create areas, labels or helpers. An mdi: icon that is not in the Material Design Icons that come with Home Assistant is drawn as an empty spot, without an error. Spook raises a repair naming the script and the icons, and suggests the icon you most likely meant when it is nearly certain.
This usually happens with a typo, an icon that was renamed or removed, or one picked from the Material Design Icons website that is newer than the version Home Assistant comes with.
- Spook checks
mdi:icons and its own icons underspook:. It checksmy:against the SVG files in yourspook/iconsfolder. Without that folder, Spook skipsmy:. The olderhass:prefix, and icons from sets you added, like those from the Marketplace, are left alone. - An icon that is a template is not checked. What it ends up as cannot be known without running it.
- Actions that are turned off are not checked: they never run.
- The list of icons is read from the frontend Home Assistant has installed. A frontend run from a development build is not taken into account, and a frontend without that list means nothing is checked.
Unknown referenced floors
A script targets a floor that no longer exists. The step that uses it does nothing.
Unknown referenced floors
A script targets a floor that no longer exists. The step that uses it does nothing.
How to fix it: Open the script from the repair, and in the step that uses the missing floor, pick a floor that exists. Or remove the step. The repair disappears by itself once it is fixed.
Spook looks at every floor your scripts target in their actions. When that floor does not exist, it raises a repair that names the script and the missing floor.
As with automations, templates are read as well, for floor_areas and floor_entities: a floor ID, or the name or an alias of a floor, in any case. Home Assistant tries the value as an area first: the name or an alias of an area on a floor is taken as a floor ID, and finds nothing. So with an area called Attic on a floor, floor_areas('Attic') finds nothing, even when there is a floor called Attic, and Spook reports it. Use the ID of the floor instead, like floor_areas('attic').
Unknown referenced labels
A script targets a label that no longer exists. The step that uses it does nothing.
Unknown referenced labels
A script targets a label that no longer exists. The step that uses it does nothing.
How to fix it: Open the script from the repair, and in the step that uses the missing label, pick a label that exists. Or remove the step. The repair disappears by itself once it is fixed.
Spook looks at every label your scripts target. When that label does not exist, it raises a repair that names the script and the missing label.
As with automations, templates are read as well, for label_areas, label_devices and label_entities: a label ID, or the name of a label, in any case.
Unknown referenced conditions
A script uses a condition that no integration provides anymore, usually because that integration was removed. The whole script stops working. Home Assistant tells you the script is broken; Spook tells you which condition did it.
Unknown referenced conditions
A script uses a condition that no integration provides anymore, usually because that integration was removed. The whole script stops working. Home Assistant tells you the script is broken; Spook tells you which condition did it.
How to fix it: Open the script from the repair and remove the condition. Or bring back the integration it came from. The repair disappears by itself once it is fixed.
Spook looks at the conditions your scripts use. Conditions are provided by integrations, so a condition that no installed integration can provide cannot be evaluated. A script like that fails validation and becomes unavailable. That is why Spook looks at unavailable scripts too: they are the broken ones.
Home Assistant does notice, but it raises a generic issue about the script. Spook names the exact conditions, so you know what to fix.
This usually means the integration that provided the condition was removed.
Unknown referenced triggers
A script waits for a trigger that no integration provides anymore, usually because that integration was removed. A script has no triggers of its own, so this is about a Wait for a trigger step. The whole script stops working. Home Assistant tells you the script is broken; Spook tells you which trigger did it.
Unknown referenced triggers
A script waits for a trigger that no integration provides anymore, usually because that integration was removed. A script has no triggers of its own, so this is about a Wait for a trigger step. The whole script stops working. Home Assistant tells you the script is broken; Spook tells you which trigger did it.
How to fix it: Open the script from the repair and remove the trigger from the wait, or the whole wait. Or bring back the integration it came from. The repair disappears by itself once it is fixed.
Spook looks at the trigger configurations your scripts contain, such as the ones a wait_for_trigger step waits on. When no installed integration can provide a trigger a script waits on, the whole script goes down with it: it fails validation and becomes unavailable.
Home Assistant raises a generic issue about the script without saying which trigger caused it. Spook names the trigger.
Templates that can never pass
A script has a template that, the way it is written, can never be true. A template is a small piece of code between {{ }} that works out a value. Its condition always fails, or its wait only ends on a timeout. You get no error.
Templates that can never pass
A script has a template that, the way it is written, can never be true. A template is a small piece of code between {{ }} that works out a value. Its condition always fails, or its wait only ends on a timeout. You get no error.
How to fix it: Open the script from the repair and correct the template. The usual causes: quotes around the template, missing {{ }}, something pasted around it, or a template that gives on where true is needed, and a template in the to, from or state of a state trigger or condition, which Home Assistant never renders. The repair disappears by itself once it is fixed.
Spook looks in your scripts for templates that, because of how they are written, can never render what Home Assistant needs for them to pass: the value_template of template conditions, shorthand template conditions (condition: "{{ ... }}"), wait_template, and template triggers in a wait_for_trigger. Anywhere in the sequence: in an if, a choose, the while or until of a repeat, a condition step, nested in and, or or not. When one can never pass, Spook raises a repair that names the script and the templates that can never pass.
A template condition passes only when it renders true (any case). A wait_template is checked like a condition first. After that it ends when its template renders again into something that reads as true, like on, yes or 1. One without any Jinja, or made of fixed text alone, is never rendered again, so only true ends it. A template trigger fires when its template goes from something that does not read as true to something that does, so one that only ever renders on or yes never fires.
The shapes this catches are the same as for automations: quotes around the template in a >- block, no {{ }} at all, YAML pasted into the template field, a YAML # comment inside the Jinja, a condition that can only render on, off or another fixed text, and a template in the to, from, not_to or not_from of a state trigger in a wait_for_trigger or the state of a state condition, which Home Assistant compares as text and never renders. The automation section explains each, and what is left alone.
Such a condition loads fine and never passes, and a wait for a template that never matches only ends on its timeout. A templated not_to or not_from is the other way around: it leaves nothing out, so any change ends the wait. You get no error. Only the text of the template is read. Anything that depends on a state, a variable or the moment it runs is never judged. A script that failed to load is left alone: Home Assistant reports that one itself. Spook looks again whenever scripts are reloaded, which saving one in the editor does.
Unknown template functions
A script has a template that calls a function Home Assistant does not have, like state('light.hall') where states was meant. A template is a small piece of code between {{ }} that works out a value. Every time the script gets to it, the template stops with an error, and so does the step it is in.
Unknown template functions
A script has a template that calls a function Home Assistant does not have, like state('light.hall') where states was meant. A template is a small piece of code between {{ }} that works out a value. Every time the script gets to it, the template stops with an error, and so does the step it is in.
How to fix it: Open the script from the repair and use a function Home Assistant has. Or install the integration that adds the function again. The repair disappears by itself once it is fixed.
Spook reads every template of your scripts that Home Assistant renders, in its steps. It looks for a call of a plain name, like state(...) or float_or(...), and asks the running Home Assistant whether its templates have that function. That includes the functions other integrations or custom integrations add. When one does not, Spook raises a repair that names the script and the functions it cannot find.
Jinja stops on such a call every time it gets there, also with a default after it: the call fails before the default gets a look. Usually it is a typo, a function from another template language, or one from an integration that is no longer installed.
Some things are not reported on purpose:
- A name the template gives a value itself: a
set, amacro, a loop, animport(also fromcustom_templates), or a call block. - A name the script may give its templates, like its
variables, aresponse_variable, thefieldsof a script, or what Home Assistant hands every run, likethis,repeat,waitandcontext. - A call the template guards by asking first, like
foo is defined,foo is callableorfoo | default(...). - A method, like
value.split(), a filter, and a test. - Templates Home Assistant renders in a limited environment: the
enabledof a trigger in await_for_triggeror of a condition that is not a step of its own, and the trigger fields listed under functions limited templates cannot use, where Spook reports what those may not use. A trigger'svalue_template,variablesandforare rendered in full and read like the rest, as is a templatedenabledof a step since Home Assistant 2026.11. The other fields of a trigger are not read. - A disabled step, and a script that failed to load. Home Assistant reports one that failed to load itself.
A script on a blueprint is checked with its inputs filled in, the way Home Assistant runs it. Spook looks again whenever scripts are reloaded, which saving one in the editor does, and whenever an integration is loaded, as it may add a function.
Functions limited templates cannot use
A script has a template that Home Assistant renders in its limited environment, and that uses something that environment does not allow, like states('input_select.mode'), now() or | expand. In there, everything that looks up your home is turned off, and using it fails every time. What fails depends on where the template is:
Functions limited templates cannot use
A script has a template that Home Assistant renders in its limited environment, and that uses something that environment does not allow, like states('input_select.mode'), now() or | expand. In there, everything that looks up your home is turned off, and using it fails every time. What fails depends on where the template is:
- In a templated
enabledof a condition, like in anif, achooseor arepeat, the step it is in fails every time it gets there. - In the
event_type,event_dataorcontextof an event trigger, theatof a time trigger, thetopicof an MQTT trigger, or a templatedenabledof a trigger, all in await_for_trigger: that trigger is not set up. When none of them is, the wait ends right away.
How to fix it: Open the script from the repair. For the enabled of a condition, put a template condition next to it instead. For a trigger of a wait_for_trigger, work the value out in a variables step before it: its variables are handed on. The repair disappears by itself once it is fixed.
Spook reads every template of your scripts that Home Assistant renders in its limited environment: the ones listed above. It looks for a call, a filter or a test the limited environment does not allow, and asks the running Home Assistant which those are: Home Assistant puts a stand-in in their place that fails with Use of '...' is not supported in limited templates. A name refused as a function counts only where it is called, one refused as a filter only after a |, and one refused as a test only after is. A filter or test map, select, reject, selectattr or rejectattr runs counts too, where what it hands back is gone through right there: by a filter like | list, | first or | join, by a for loop, or by in. So does reading a stand-in two steps deep, like states.sensor.temperature.state: the stand-in is a plain function, the first step gives nothing, and reading from that nothing fails. When it finds one, Spook raises a repair that names the script and lists each one, like states(), | expand, is is_state or states.sensor.temperature.
Some things are not reported on purpose:
- Reading a stand-in one step deep without calling it, like
states.sensor. That gives nothing, and fails nothing. - A name the template gives a value itself, or one the script may give its templates, like its
variables, aresponse_variableor itsfields. - A call the template guards by asking first, like
foo is defined. - What
map('states')and the like hand back, when it is not gone through right there, likesetto a name and gone through later. - A part of a template that never runs: a branch that is never taken, a macro nobody calls, and the text of a
rawblock. - A templated
enabledof a step, a condition step among them: Home Assistant renders that one with the run, in full. - A disabled step, and a script that failed to load. Home Assistant reports one that failed to load itself.
A script on a blueprint is checked with its inputs filled in, the way Home Assistant runs it. Spook looks again whenever scripts are reloaded, which saving one in the editor does.
States used as numbers
A script has a template that uses the state of an entity as a number, like states('sensor.temperature') > 20. A state is always text, even when it looks like a number, and text cannot be compared with a number or worked out with one. Every time the script gets to it, the template stops with an error, and so does the step it is in.
States used as numbers
A script has a template that uses the state of an entity as a number, like states('sensor.temperature') > 20. A state is always text, even when it looks like a number, and text cannot be compared with a number or worked out with one. Every time the script gets to it, the template stops with an error, and so does the step it is in.
How to fix it: Open the script from the repair and turn the state into a number first, with a default for when it is not one, like unknown: states('sensor.temperature') | float(0) > 20. Use | int(0) for whole numbers. The repair disappears by itself once it is fixed.
Spook reads every template of your scripts that Home Assistant renders, in its steps. It looks for a state, as it is, right next to a number written out, with <, <=, >, >=, +, -, /, // or **. The state as states('sensor.temperature'), 'sensor.temperature' | states, states.sensor.temperature.state or states['sensor.temperature'].state. When it finds one, Spook raises a repair that names the script and lists each one.
Python refuses text on one side of these and a number on the other, every time, whatever the state is. Also when the entity does not exist: states(...) then gives unknown, which is text too, and .state gives nothing at all, which fails just the same.
Some things are not reported on purpose:
- Anything between the state and the number, like
| float,float(...),| default(...)or(... or 0). That may make it a number, so Spook leaves it alone. - A state kept in a variable first, or worked out by a macro, and a number in a variable.
*and%. Text times a whole number repeats the text, and%fills the text in, so neither fails every time.==and!=never fail: text is never equal to a number, so==is always false and!=always true. Spook reports those as states compared with numbers.- A template where
statesis a name the script or the template gives a value, like a variable, a field, aresponse_variableor aset. - A part of a template that never runs: a branch that is never taken, a macro nobody calls, and the text of a
rawblock. - Templates Home Assistant renders in a limited environment, which has no
states: theenabledof a trigger in await_for_triggeror of a condition that is not a step of its own, and the trigger fields listed under functions limited templates cannot use. A trigger'svalue_template,variablesandforare rendered in full and read like the rest, as is a templatedenabledof a step since Home Assistant 2026.11. The other fields of a trigger are not read. - A disabled step, and a script that failed to load. Home Assistant reports one that failed to load itself.
A script on a blueprint is checked with its inputs filled in, the way Home Assistant runs it. Spook looks again whenever scripts are reloaded, which saving one in the editor does.
States compared with numbers
A script has a template that compares the state of an entity with a number, or with true or false, like states('sensor.people_home') == 2 or is_state('switch.kitchen', true). A state is always text, even when it looks like a number, so it is never equal to a number, nor to true or false. The check is always false, or always true with != or not in, whatever the state is. Nothing fails and nothing tells you: the step it is in just never does what it reads like.
States compared with numbers
A script has a template that compares the state of an entity with a number, or with true or false, like states('sensor.people_home') == 2 or is_state('switch.kitchen', true). A state is always text, even when it looks like a number, so it is never equal to a number, nor to true or false. The check is always false, or always true with != or not in, whatever the state is. Nothing fails and nothing tells you: the step it is in just never does what it reads like.
How to fix it: Open the script from the repair and compare with text, like states('sensor.people_home') == '2' or is_state('switch.kitchen', 'on'). Or turn the state into a number first: states('sensor.people_home') | int(0) == 2. The repair disappears by itself once it is fixed.
Spook reads every template of your scripts that Home Assistant renders, in its steps. It looks for a state, as it is, right next to a number, true or false written out, with == or !=, or the tests that do the same, like is eq. Or in front of in or not in a list that holds only numbers and true or false. The state as states('sensor.temperature'), 'sensor.temperature' | states, states.sensor.temperature.state or states['sensor.temperature'].state. It also looks for is_state handed a number, true, false or a list of only those, as a function and as a test: is_state('sensor.temperature', 20) and 'sensor.temperature' is is_state(20). When it finds one, Spook raises a repair that names the script and lists each one.
That is the same every time, whatever the state is. Also when the entity does not exist: states(...) then gives unknown, which is text too. is_state holds the state with == itself, and only looks in a list: handed a tuple, like (1, 2), it is never true either.
Some things are not reported on purpose:
- Anything between the state and the value, like
| int,float(...)or| default(...). That may make it a number, so Spook leaves it alone. - A state kept in a variable first, or worked out by a macro, and a value in a variable.
- A list with anything else in it, like
['on', 1]: the state may well be the text in it. <,>and the like with a number. Those fail every time instead, and Spook reports them as states used as numbers.- A template where
statesoris_stateis a name the script or the template gives a value, like a variable, a field, aresponse_variableor aset. - A part of a template that never runs: a branch that is never taken, a macro nobody calls, and the text of a
rawblock. - Templates Home Assistant renders in a limited environment, which has no
statesand nois_state: theenabledof a trigger in await_for_triggeror of a condition that is not a step of its own, and the trigger fields listed under functions limited templates cannot use. A trigger'svalue_template,variablesandforare rendered in full and read like the rest, as is a templatedenabledof a step since Home Assistant 2026.11. The other fields of a trigger are not read. - A disabled step, and a script that failed to load. Home Assistant reports one that failed to load itself.
A script on a blueprint is checked with its inputs filled in, the way Home Assistant runs it. Spook looks again whenever scripts are reloaded, which saving one in the editor does.
Wrong kind of entity
A script hands an action an entity of another kind, like input_number.set_value on a number entity. An action like that only acts on entities of its own kind. Handed anything else, it does nothing at all. Home Assistant only logs that the entity is "missing or not currently available", and the script carries on as if it worked.
Wrong kind of entity
A script hands an action an entity of another kind, like input_number.set_value on a number entity. An action like that only acts on entities of its own kind. Handed anything else, it does nothing at all. Home Assistant only logs that the entity is "missing or not currently available", and the script carries on as if it worked.
- action: input_number.set_value
target:
entity_id: number.thermostat_offset
data:
value: 2
How to fix it: Open the script from the repair and use the action of the entity's own kind. Or hand the action the entity it was meant for. The repair disappears by itself once it is fixed.
- action: number.set_value
target:
entity_id: number.thermostat_offset
data:
value: 2
Spook asks Home Assistant which actions only act on their own kind of entity. Those are the actions that say so themselves, like light.turn_on, select.select_option or input_button.press. When a script hands one of those an entity of another kind, Spook raises a repair. It names the script, the entity, and the action it was handed to.
Only entity IDs written out are checked: in the target, as entity_id on the step, or as entity_id in its data. Whether the entity exists does not matter, it is of the wrong kind either way. An entity that does not exist gets a repair of its own too.
Some things are not checked on purpose:
- Areas, devices, floors and labels. Home Assistant picks the entities of the right kind from those itself.
- An old-style group, like
group.kitchen. Home Assistant hands the action the entities in it. - Actions that say nothing about the kind, like
homeassistant.turn_on. And actions of an integration that work on the entities of another, like a Hue action that takes scenes. - An entity worked out while running, from a template or a variable, and
allornone. - A disabled step, and a script that failed to load.
A script on a blueprint is checked with its inputs filled in, the way Home Assistant runs it. Spook looks again whenever scripts are reloaded, which saving one in the editor does, and when an integration loads or its actions come and go.
Removed users
A script only does something for a certain user, and that user was removed. A check for them never passes again.
Removed users
A script only does something for a certain user, and that user was removed. A check for them never passes again.
How to fix it: Open the script from the repair and use a user that exists. Or remove the check. The repair disappears by itself once it is fixed.
Spook looks at the users your scripts name by their ID, the same way automations are: in templates, the ID of a user compared to text, like context.user_id == '…' for the user who started the script, or state_attr('person.frenck', 'user_id') == '…', and the user_id an event trigger in a wait_for_trigger waits for in its context. When a script names a user that no longer exists, Spook raises a repair that names the script and the user IDs it cannot find.
Home Assistant gives every user a random ID and never hands the same one out twice, so an ID no user has belongs to a user that was removed. A template comparing with that ID never matches, and Home Assistant does not tell you.
What is not checked is the same as for automations. A script that gives context a meaning of its own, as a variable or a field, is not read either.
Missing something here?
An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.



