Home Assistant Automation Not Triggering
In this tutorial, you'll learn about Home Assistant Automation Not Triggering. We cover key concepts, practical examples, and best practices.
Hook
You create a perfect automation — when the sun sets, turn on the porch light. You wait for sunset. Nothing happens. You check the automation, re-save it, wait for the next sunset. Still nothing. Home Assistant's automations seem to ignore your triggers.
The Wrong Way
Creating a new automation from scratch every time the old one fails increases the risk of introducing new bugs without fixing the underlying issue.
# BAD: Duplicating the automation
- id: 'sunset_light_v3'
alias: Sunset Light v3
trigger:
- platform: sun
event: sunset
action:
- service: light.turn_on
target:
entity_id: light.porch
Automation created: sunset_light_v3
Sunset passed — still no light
Each new version is the same automation; the trigger or action has a hidden issue.
The Right Way
Troubleshoot each component of the automation independently.
# 1. Test the entity directly
curl -X POST -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"entity_id": "light.porch"}' \
http://hass.local:8123/api/services/light/turn_on
{"message": "Service called successfully"}
If the service call works, the entity is fine. Check the trigger:
# 2. Test the trigger condition
# In Developer Tools → Template, run:
echo "{{ states('sensor.sun_next_setting') }}"
2026-06-24T18:30:00+00:00
# 3. Check if the automation is enabled
curl -s -H "Authorization: Bearer <token>" \
http://hass.local:8123/api/config/entity_registry/automation.sunset_light | jq .disabled_by
null # Not disabled
# 4. Check the automation trace
# Web UI → Developer Tools → Automations → Select → Trace
Look for "Triggered at" — if it never shows, the trigger did not fire. Set the trigger time to 1 minute in the future for testing:
trigger:
- platform: time_pattern
minutes: "/1" # Trigger every minute for testing
If the automation fires every minute, the original trigger (sun or other) is the issue.
Prevention
- Test automations with a short time-based trigger during development.
- Use the Automation Trace UI to see exactly when and why an automation does not fire.
- Enable
automationlogging:logger: default: info, homeassistant.components.automation: debug. - Check entity states before assuming they work.
- Keep automations simple — chain multiple simple automations instead of one complex one.
Common Mistakes with assistant automation
- Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
- Using
returnto exit a function early instead of wrapping a pure value in the monad - Mixing let bindings with <- bindings in do notation, producing type errors
These mistakes appear frequently in real-world HOME code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
DodaTech — automations that actually automate.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro