Home Assistant Every-5-Minutes Automation: Copyable Examples
To run a Home Assistant automation every five minutes, use a time_pattern trigger with minutes: "/5". The leading slash makes it an interval: it fires whenever the minute is divisible by five, at :00, :05, :10 and so on. Without the slash, minutes: 5 fires once an hour, at five past. Below are paste-ready automations, a condition, the run modes, and how a clock interval differs from a delay.
The short answer
time_pattern is a trigger, not a timer you start. Home Assistant compares the current clock to the value you supply and fires when they match. A leading slash turns that value into an interval, so minutes: "/5" fires every five minutes while minutes: 5 fires once an hour at five past. The wildcard behaves the same way: minutes: "*" matches every minute. Hours and seconds take the same syntax, so seconds: "/30" fires twice a minute.
The reference that documents this: Home Assistant automation trigger reference
Copyable YAML: an every-5-minutes trigger
Automation YAML goes to one of two destinations, and each one expects a different shape. The automation editor takes a single automation; automations.yaml is a list of automations. Both shapes appear below with their destination on the label. Nothing here needs a key, a token, or an account.
The automation editor: one automation, no leading dash
This is what the editor's YAML box expects. It is a complete automation written as a mapping that starts with alias: — no leading dash, because a dash would make it a list item and that editor is editing a single automation, not a list.
alias: Every 5 minutes example
description: Fires on the 5-minute clock interval.
triggers:
- trigger: time_pattern
minutes: "/5"
actions:
- action: persistent_notification.create
data:
title: Five-minute check
message: The every-5-minutes trigger fired.
mode: singleTo reach that editor: Settings → Automations & scenes, open the automation, then the three-dot menu in the upper-right corner and Edit in YAML. You do not have to supply an id in this shape — the editor generates one and keeps it with the automation. persistent_notification.create is a built-in Home Assistant action, used here because it changes nothing physical and needs no credentials. Swap the actions block for what the automation should actually do.
The official walkthrough of the editor and its Edit in YAML option: Home Assistant automation editor
This action's official field reference: Persistent notification: Create action
alias: Every 5 minutes with a condition
triggers:
- trigger: time_pattern
minutes: "/5"
conditions:
- condition: state
entity_id: input_boolean.example_automation_enabled
state: "on"
- condition: time
after: "07:00:00"
before: "22:30:00"
actions:
- action: persistent_notification.create
data:
title: Five-minute check
message: The trigger fired and both conditions were true.
mode: singleinput_boolean.example_automation_enabled is a placeholder. Create a Toggle helper with that ID, or substitute an entity you already have. The time condition is inclusive at after and exclusive at before, so this example stops at 22:29:59.
automations.yaml: a list, so each entry starts with a dash
The same automation in its list-file form. Here the leading dash is not decoration and not optional: it introduces a list entry, and the official reference states plainly that automations.yaml is always a list. Use this shape when you are working with the file itself, not when you are pasting into the automation editor. That reference also notes the file is managed by the UI and should not be edited manually; hand-written automations belong under a labeled automation: block in configuration.yaml.
- id: every_five_minutes_example
alias: Every 5 minutes example
description: Fires on the 5-minute clock interval.
triggers:
- trigger: time_pattern
minutes: "/5"
actions:
- action: persistent_notification.create
data:
title: Five-minute check
message: The every-5-minutes trigger fired.
mode: singleEverything after the dash is indented two spaces, because those keys belong to the list item rather than to the file. An id is what lets the editor track an entry and what makes traces available for it.
Where automations live, why the file is always a list, and the role of id: Home Assistant automation YAML reference
About the key names
The examples use plural triggers, conditions, and actions, with trigger: inside each list entry — the form the current official documentation uses. Older tutorials show the singular keys. Syntax and available options differ between Home Assistant versions, so if a key is rejected, compare your file against the official reference and against what your own version's YAML editor writes.
Trigger vs condition
A trigger starts the automation; a condition decides whether the actions are allowed to run. The order matters here: time_pattern fires every five minutes all day, and only then are conditions checked. The official reference states that the automation is executed if all conditions return true, and that if any condition returns false the automation will not start. In the second example, the conditions are what keep it quiet overnight. A condition gates the whole automation, not individual steps — a check for one step belongs in the action sequence.
The official condition reference: Home Assistant automation condition reference
Every 5 minutes vs a 5-minute delay
A time_pattern trigger and a delay action both involve time, and they are not interchangeable.
time_pattern is a clock check
It fires when the current minute matches and starts a new run each time. The interval is anchored to the wall clock, not to the last run, so an instance that comes up at 12:03 fires next at 12:05, not 12:08.
delay pauses a run already in progress
The script reference describes it as temporarily suspending your script and resuming it at a later moment. It accepts seconds, HH:MM, HH:MM:SS, or a duration mapping such as minutes: 5, and all forms accept templates. It schedules nothing by itself.
The difference shows up when you combine them. The run-modes reference gives this throttling pattern: keep mode: single so a new trigger cannot start while the last run is still going, silence the warning, and let the run outlast the interval.
alias: Every 5 minutes, no overlap
triggers:
- trigger: time_pattern
minutes: "/5"
actions:
- action: persistent_notification.create
data:
title: Slow task
message: This run holds the automation for five minutes.
- delay: 300
mode: single
max_exceeded: silentdelay: 300 is 300 seconds, or five minutes — the documented throttling shape. With mode: single, a trigger arriving during the delay is ignored and a warning is logged; max_exceeded: silent suppresses it. Use mode: restart instead to cut the old run short and start over. Queued and parallel do the opposite of throttling: a job longer than its interval queues or overlaps.
The official action syntax reference that documents delay: Home Assistant script syntax reference
Which mechanism to use
Find the row for what you want; the middle column is the setting.
| What you want | Use this | Why |
|---|---|---|
| A fixed five-minute clock interval, indefinitely | trigger: time_pattern with minutes: "/5" | The slash makes it an interval, so it matches minutes 0, 5, 10 and so on and starts a new run each time. |
| Five minutes past each hour | minutes: 5, no slash | Without the slash the value is a single minute. This is the most common misreading of the pattern. |
| Every minute | minutes: "*" | The wildcard matches any value for that unit. |
| A five-minute pause inside one run | delay: 300, or delay: with minutes: 5 | Delay suspends the running script; it pauses a run rather than scheduling one. |
| A slow job that must not overlap itself | time_pattern every five minutes, plus mode: single and max_exceeded: silent | The documented throttle: the overlapping trigger is dropped instead of stacking another run. |
| A fresh run even if the last one is still going | mode: restart | It stops the previous run, then starts a new one, and only restarts if the conditions are met. |
| A different interval | minutes: "/15", seconds: "/30", or hours: "/2" | Hours, minutes, and seconds all take the same slash and wildcard syntax. |
Reload, restart, and run modes
Saving an automation from the interface applies the change; a trigger edit is not a reason to restart Home Assistant. If you edit YAML by hand, run Check configuration under Settings → Tools → YAML first, so a syntax error is caught before it reaches a running instance. A restart is heavier than a reload and interrupts anything in progress, including a delay.
When a trigger arrives mid-run
mode decides what happens when the trigger fires while the previous run of the same automation is still active:
max defaults to 10 and caps how many runs may be executing or queued at once for queued and parallel. max_exceeded defaults to warning and sets the severity of the log message when that cap is hit; set it to silent to suppress it.
The official run-mode reference: Home Assistant automation run modes
How to test safely
Test in this order. None of these steps requires the automation to control a real device yet.
Leave the harmless action in place
Keep persistent_notification.create until the timing is confirmed. An automation that fires 288 times a day is a bad place to discover a mistake.
Watch Traces
When an automation runs, the steps are recorded and a trace is made. The last five traces are kept by default; raise that with the trace and stored_traces options.
Run the actions on demand
The three-dot menu offers Run actions, which runs the action sequence while skipping triggers and conditions. It proves the actions work, not the conditions, and any trigger ID you use is not active in this mode.
Test the conditions separately
Under Settings → Tools → Actions, run Automation: Trigger and choose whether to skip the conditions. That answers "will this run at 06:30?" without waiting for the clock.
Point it at real devices last
Swap in a physical action only after the notifications and conditions behave, at a time when the result will not surprise anyone in the house. For anything that unlocks a door, opens a garage, or changes heating, test the physical consequence deliberately and in person.
The official reference for Run actions, Traces, and configuration checks: Testing and troubleshooting automations
Limitations
- The check is "does the current minute match", so a minute that has already passed is not replayed. An interval missed while Home Assistant was restarting does not catch up.
- The pattern is anchored to the wall clock, not the last run: five-minute intervals are :00, :05, :10 and so on, not five minutes after whatever happened previously.
minutes: "/5"matches 288 times a day. Everything in the actions block inherits that frequency unless a condition stops it.- A
time_patterntrigger is the wrong tool for "five minutes after the door opens" — that five minutes is a delay inside the run the door trigger started. delaykeeps a run alive; it does not schedule one. A long delay can still be running when the next trigger arrives, and the run mode decides what happens then.- The examples use placeholder entity IDs. Key names and available options differ between Home Assistant versions; when a key is rejected, the official reference for your version is the source of truth, not this page.
Frequently asked questions
Does minutes: 5 run every five minutes?
No. Without the slash, 5 is a single minute value, so it fires once an hour at five past. Every five minutes is minutes: "/5". The same rule applies to hours and seconds, which is why seconds: 30 fires once a minute while seconds: "/30" fires twice a minute.
Why does my automation run once, or warn that it is already running?
That is mode: single, the default, refusing to start a run while the previous one is still active. It usually means the action sequence takes longer than five minutes — a long delay, a wait, or a slow device call. Shorten it, or choose restart to replace the running one or queued to run after it finishes. max_exceeded: silent suppresses the warning when the overlap is expected.
Do I need to restart Home Assistant after changing the trigger?
Not for an automation edited through the interface — saving applies it. If you edit YAML by hand, run Check configuration under Settings → Tools → YAML first. A restart is heavier than a trigger change needs and interrupts anything running, including a delay.
Where to go next
This page is the trigger reference. The setup guide covers the instance these automations run on, and the guide library holds the tested hardware write-ups.
Home Assistant Zigbee2MQTT setup
The start-to-finish setup sequence for the instance these automations run on.
Open the setup guide →ConnectedCasa guide library
The tested guides and project write-ups behind the rest of this site.
Browse the guide library →