Write two useful automations by hand (sunset lights and a "washing done" alert) and learn to debug them with traces.
Guide
You need: a running Home Assistant (any install type) with at least one light and, for the second automation, a smart plug that reports power. Replace the entity IDs below with yours from Settings → Devices & services → Entities.
Step 1 of 4
Step 2 of 4
On 15 minutes after sunset, off at 23:00. One automation, two triggers, and choose to decide which one fired:
| 1 | alias: Porch light at sunset |
| 2 | description: On 15 minutes after sunset, off at 23:00 |
| 3 | triggers: |
| 4 | - trigger: sun |
| 5 | event: sunset |
| 6 | offset: "00:15:00" |
| 7 | - trigger: time |
| 8 | at: "23:00:00" |
| 9 | id: night |
| 10 | actions: |
| 11 | - choose: |
| 12 | - conditions: |
| 13 | - condition: trigger |
| 14 | id: night |
| 15 | sequence: |
| 16 | - action: light.turn_off |
| 17 | target: |
| 18 | entity_id: light.porch |
Milestone
Sunset automation saved
Run it from the ⋮ menu: the porch light turns on.
Step 3 of 4
A washing machine draws power while running and almost none when finished. Wait until it has been below 5 W for three minutes, so a pause mid-cycle doesn't fool it:
| 1 | alias: Washing machine finished |
| 2 | triggers: |
| 3 | - trigger: numeric_state |
| 4 | entity_id: sensor.washer_plug_power |
| 5 | below: 5 |
| 6 | for: "00:03:00" |
| 7 | conditions: |
| 8 | - condition: state |
| 9 | entity_id: input_boolean.washer_running |
| 10 | state: "on" |
| 11 | actions: |
| 12 | - action: notify.mobile_app_your_phone |
| 13 | data: |
| 14 | title: Washing machine |
| 15 | message: Done. Time to hang it out. |
| 16 | - action: input_boolean.turn_off |
| 17 | target: |
| 18 | entity_id: input_boolean.washer_running |
| 19 | mode: single |
Create the helper input_boolean.washer_running (Settings → Devices & services → Helpers → Toggle) and a tiny second automation that turns it on when the power goes above 10 W. That stops the alert from firing every time the plug is idle.
Milestone
Washer alert works
Step 4 of 4
Every run is recorded. Open the automation and click Traces to see which trigger fired, whether each condition passed, and the result of every action. When an automation "does nothing", the trace tells you which condition stopped it.
Labs
All labs