spook icon indicating copy to clipboard operation
spook copied to clipboard

Spook doesn't consider custom macros

Open esand opened this issue 3 months ago • 1 comments

What version of Spook are you using?

4.0.1

What version of Home Assistant are you using?

2025.9.4

The problem

Spook identifies custom macros I have defined in a jinja file that's in my custom_templates folder as an unknown entity and reports an error in automations that imports the file. It suggests deleting the automation to fix the issue (there is no actual issue).

Unknown entities used in: Lights - Halloween Warning · Reported by Spook Spook has found a ghost in your automations 👻

While floating around, Spook crossed path with the following automation:

Lights - Halloween (automation.lights_halloween)

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

date.jinja To fix this error, edit the automation and remove the use of these non-existing entities.

The macro file is called date.jinja and used in the automation like this:

{% from 'date.jinja' import how_about_now %}
{{ how_about_now(states('sensor.holiday_halloween'), 30) | bool }}

The macros/file was not reported as an error in previous versions and everything was fine. The new 4.x series introduced this report, and although I can ignore it, I have 18+ automations using this macro and I have to ignore each one (uncertain if I have to do this every restart too), plus accidentally "repairing" the issue would erase one of my automations that I absolutely do not want to lose.

Anything in the logs? Paste it here!


esand avatar Sep 26 '25 00:09 esand

I have a sneaking suspicion that all the recent reports of unknown items showing up as issues are related. In the case of my particular instance, I am wondering if it's the fact that the date.jinja filename is inside single quotes that Spook is assuming it should be an entity reference (which are usually quoted in scripts).

esand avatar Sep 26 '25 13:09 esand