Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.
A Halloween effect that retriggers on every step is just a strobe. This blueprint waits for motion or a door contact, remembers the lights, runs a short flicker, plays one sound at a set volume, holds the last color, then puts the lights and the player volume back. A timer blocks another run until the cooldown ends. An optional window (pack default the evening of October 31) keeps it from running in July.
The lights have to accept an RGB color. A dimmer that only does brightness will ignore the palette and still be included in the snapshot, which is a bad surprise. Pick color bulbs.
Entity ids and the sound path are blueprint inputs. Do not publish which door or which speaker you used.
What problem it solves
You want one pass of a spooky light and a sound when someone enters a zone, then the room back the way it was, without it firing again immediately.
How it works
Any selected binary sensor turning on can start the automation. The cooldown timer must be idle. If the date window is enabled, now() has to sit inside the start and end. A window whose end is earlier than its start is treated as overnight.
- Cooldown first — the timer starts (pack default 45 seconds) before the flicker, so a second trigger during the scene is dropped. The automation is
mode: single. - Snapshot —
scene.createstores the selected lights under the scene id (pack defaultspooky_lights_snapshot). - Sound — the current
volume_levelis saved. The player is set to the blueprint volume (0–100, pack default 40) andmedia_player.play_mediaruns the content id (pack defaultmedia-source://media_source/local/scare.mp3, typemusic). A player that rejects the file does not stop the lights. Those two actions continue on error. - Flicker — eight steps, about 180 ms apart, alternating purple
[90, 0, 130]at brightness 200 and a dim green-black[0, 24, 0]at brightness 12. The last step holds purple at brightness 140 for the hold time (pack default 12 seconds). - Restore —
scene.turn_onputs the lights back. The player is stopped, and the saved volume is written back. Both of those continue on error so a speaker that is already idle still lets the lights restore. - Window — pack default on, from
2026-10-3117:00 through 22:00. Turn the boolean off to run any day. Dates areYYYY-MM-DD. Times areHH:MM:SS.
The timer helper in the pack is timer.spooky_cooldown with restore on, so a restart does not immediately arm another scare.
Snippet
The timer is the only helper. The palette and the sound id are in the blueprint.
timer:
spooky_cooldown:
name: Spooky cooldown
duration: "00:00:45"
restore: true
Setup outline
- Copy
helpers/spooky_cooldown.yamlintoconfig/packages/and include that folder from the existinghomeassistant:block. Restart, and confirmtimer.spooky_cooldown. - Put a short audio file where the media player can play it. The default path expects a file named
scare.mp3in Home Assistant’s local media folder. Change the content id if yours lives somewhere else. - Import the blueprint. Pick the motion or contact sensors (
onmeans “someone is here” or “the door just opened”), the RGB lights, and the media player. - Leave the window on if you only want the evening of October 31. For a test today, turn Only inside a date window off, run it once, then turn it back on.
- Trip the sensor. The lights should flicker and return, and the volume should return. Trip it again immediately. The second pass should do nothing until the timer is idle.
- Turn the window back on and set the dates you actually want before you leave it armed.
Troubleshooting
- Nothing happens. The timer is still running, the window excludes today, or the sensor never went
offthenon. A contact that staysonwill not retrigger. The trace shows which condition failed. - Lights never change color. Those entities do not support
rgb_color. The snapshot still captured them. Remove them from the input. - The sound never plays. The content id is wrong for that player, or the file is not in the media folder. The lights still run. Play the same id from Developer tools > Actions to see the player’s error.
- Volume stays loud. The player had no
volume_levelattribute, so the saved value fell back to 0.3, orvolume_setis not supported. Check the trace for the last volume action. - It fires all evening. Cooldown is shorter than the time someone stands in the zone, and the sensor keeps toggling. Lengthen the cooldown. This pack does not add a second “only once per night” latch.
- Two zones share one timer. They share
timer.spooky_cooldown. Duplicate the helper and point the second automation at the new timer, and use a second snapshot id. - A restart mid-scare left the lights purple. Restore is not written down except as the scene. Turn the scene on by hand (
scene.spooky_lights_snapshot) or set the lights yourself. The timer’s remaining time does survive a restart.
Credits
Based on home-assistant-haunted-house. That project is a package of Halloween scenes, several sounds, and motion triggers. This pack is one automation: one palette, one sound, a snapshot, a flicker, a hold, a cooldown, and a date window. It does not ship their sound files or their blueprint.