Skip to content

Home Assistant Automation Not Triggering

DodaTech Updated 2026-06-24 3 min read

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 automation logging: 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

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. 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

Why does an automation with multiple triggers not work?

Automation triggers are OR-based — any one can fire the automation. But each trigger must have all its conditions met. Check that each trigger type (time, state, sun) has correct values.

Can an automation be triggered but the action fails?

Yes — the action could fail if the target entity is unavailable, the service is misnamed, or a script inside the action has errors. Check the automation trace for action failures.

What does 'Mode: single' mean?

Single mode means the automation ignores new triggers while it is already running. If the porch light is already turning on and sunset triggers again, the second trigger is ignored. Use mode: restart or mode: queued for overlapping triggers.


DodaTech — automations that actually automate.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro