When should you use it?
- Built-in fixtures are too harsh
- You want a bedtime light routine
- You run Home Assistant
Not for: Rentals where rewiring is not allowed; Homes where others need bright light late
What do you need, and what do you get?
You need
- Home Assistant access
- List of light entities
- Preferred bedtime
You get
- Automation that intercepts the harsh lights
- Nightly red-light scene
How does it work, step by step?
- List your lightsExport entity names and which support color.
- Describe the ruleTell the AI which fixtures to suppress and what to turn on instead.
- Review the YAMLRead the generated automation before saving it.
- Add the night sceneAt your chosen time, switch everything off and turn color lights red.
- Keep an overrideAdd a way to get full light quickly for emergencies or cleaning.
The prompt
Our own prompt, inspired by Pieter Levels (@levelsio) and written to work in Custom agent and Claude. Values in lime are placeholders.
Fill in the blanks (optional; the copied prompt uses your values)
Here are my Home Assistant light entities: {entities}. Color capable: {color_entities}. Write automations that: 1) whenever {harsh_lights} turn on, immediately turn them off and turn on {soft_lights} instead; 2) at {bedtime}, turn all lights off, then set color-capable lights to dim red. Add an override switch called {override_name} that disables both. Show the YAML and explain each part before I apply it.
Inspired by Pieter Levels (@levelsio): Today I hacked my Home Assistant with AI to nuke the bright white LED spots that came with my house when I bought it. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Suppressing a light everywhere can leave a room dark when someone needs it.
- Wall switch signals differ by brand; test each one.
Our take
Pieter Levels had AI rework his Home Assistant rules: whenever the glaring white ceiling spots that came with his home get switched on, they are cut at once and softer indirect strips light up instead, plus a red night mode at bedtime. This is a nice example of describing intent rather than writing configuration. Say what should happen whenever a certain light is asked to come on, and let the AI work out the automation. Export your entity names and note which lights support color, then describe the rule and read the generated YAML before saving it. Suppressing a fixture everywhere can leave a room dark when someone needs it, so add a quick override for full light in emergencies or while cleaning. Wall switch signals differ by brand, so test each one. Check that others in the home are happy with the bedtime routine. Rentals may limit what you can change.
Where the time goes back: A fiddly evening of writing automations becomes a short request and a review.
FAQ
Why red at night?
Can the AI edit Home Assistant directly?
Source and credit
Inspired by Pieter Levels (@levelsio). We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Today I hacked my Home Assistant with AI to nuke the bright white LED spots that came with my house when I bought it
- Creator
- Pieter Levels (@levelsio)
- Published on
- X
- Original date
- Apr 22, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Custom agent
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.