Home Assistant Guide

Simple tutorials for powerful automations

Debugging Automation Failures in Home Assistant

Automations are one of the most powerful features in Home Assistant, letting you make your smart home respond automatically to triggers like time, sensors, or device states. But what if your automation isn't working the way you expect? This guide will walk you through the most common reasons automations fail and show you step-by-step how to diagnose and fix them - even if you're a complete beginner.

1. Is Your Automation Actually Triggering?

  • Check the Automation's History: Go to Settings > Automations & Scenes > Automations, find your automation, and look at the "Last Triggered" time. If it says "Never" or hasn't triggered recently, the trigger may not be firing.
  • Test Your Trigger: Temporarily change the trigger to something simple (like a button press or a specific time) to see if the automation runs. This helps confirm if the problem is with the trigger or elsewhere.
  • See Trigger Feedback Instantly: If your automation is triggered while you're viewing it in the visual editor, you'll see a green "Triggered" message pop up at the bottom of the screen. This is a quick way to know if the trigger is working as expected.
  • Check Entity States: If your automation triggers on something like "when the sun sets" or "when a sensor detects motion," go to Developer Tools > States and check the current value/state of the relevant entity. Make sure it matches the trigger condition exactly.

2. Are Your Conditions Blocking the Automation?

  • Review Conditions Carefully: Even if the trigger fires, conditions can prevent the actions from running. Double-check any "condition" blocks for typos, incorrect entity IDs, or logic that never becomes true.
  • Test Conditions Directly: In the automation visual editor, click the three dots () and choose Test. Home Assistant will run your conditions as they're currently set and display whether they pass ("Condition Passes") or fail ("Condition did not pass"). This helps you confirm if your conditions are correct before you rely on them.
  • Test Without Conditions: Temporarily remove or disable all conditions. If the automation starts working, you've found the issue - then add the conditions back one by one to identify the culprit.

3. Are the Actions Executing as Expected?

  • Check the Trace: Home Assistant records a "trace" every time an automation runs. Click on your automation in the UI and select "Trace" to see exactly which steps ran and which ones failed (marked in red).
  • Look for Errors: Sometimes, actions fail because a device is offline or an entity is missing. The trace will usually show an error message - fix any problems it reports (such as correcting a misspelled entity ID).
  • Test Actions Manually: Try running the actions directly using the Developer Tools > Services page to make sure they work as expected.

4. Common Mistakes to Watch Out For

  • Wrong Entity IDs: Entity IDs are case-sensitive and must match exactly (e.g., light.kitchen not light.Kitchen).
  • Typos and YAML Issues: YAML can be picky about indentation and spelling. If you're unsure or get a cryptic error, try your code in the YAML Helper Tool on this site - it highlights common pitfalls and even suggests fixes in user-friendly language.
  • Template Problems: If your automation uses templates (for example, in conditions or actions), test them using the Template Tool here. It can help you spot mistakes and gives clearer suggestions than the standard error messages.
  • Automation Turned Off: Check if your automation is actually enabled! In the Automations list, look for the "toggle" switch beside your automation's name.
  • Restart Required: Some changes require you to reload automations or restart Home Assistant. Use Developer Tools > Reload Automations after making changes.

5. Using the Logbook & Logs for Deeper Troubleshooting

  • Logbook: Go to Settings > Logbook to see a timeline of recent events - this can help you see if your trigger condition ever actually happened.
  • System Logs: Under Settings > System > Logs, look for error messages related to your automation or devices. Errors here can sometimes explain failures not obvious in the UI.

6. Still Stuck? Ask the Community!

  • Home Assistant Forum: The official forums are full of friendly users happy to help with troubleshooting.
  • Share Details: When asking for help, include your full automation YAML, a description of what you want it to do, and what's going wrong. The more details, the better!

Don't be discouraged if your first automation doesn't work - debugging is part of the learning process. With these tips, you'll be able to fix most common issues and make your smart home reliably respond just the way you want!