Time pattern

The Time pattern trigger is useful when you want an automation to run on a repeating schedule. Use it when a fixed time is not enough, like every 5 minutes, at the top of every hour, or every day at 15 minutes past the hour.

Using this trigger from the user interface

If you prefer building automations visually, Home Assistant walks you through this trigger step by step. You pick what to watch, tweak a few options, and save. No YAML knowledge required.

To use this trigger in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the When section, select Add trigger.
  4. Select the type of trigger to add.
  5. Select Time pattern.
  6. Enter values for Hours, Minutes, or Seconds.
  7. Select Save.

Options in the UI

Hours

Optional hour pattern.

Minutes

Optional minute pattern.

Seconds

Optional second pattern.

Using this trigger in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, use trigger: time_pattern. A basic example looks like this:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: time_pattern
minutes: "/5"

This runs every 5 minutes.

Options in YAML

trigger string Required

The trigger type. For this trigger, use time_pattern.

hours string

Optional hour pattern.

minutes string

Optional minute pattern.

seconds string

Optional second pattern.

Good to know

  • Use * to match any value.
  • Use /n to match values divisible by n, like /5 for every 5 minutes.
  • If you set hours without minutes, Home Assistant uses minute 0. If you set minutes without seconds, Home Assistant uses second 0.
  • Do not add leading zeroes to these values. For example, use 1, not 01.

Try it yourself

Ready to test this? Go to Settings > Automations & scenes, create a new automation, and add this trigger. Save the automation, then change the state of the targeted entity to watch the trigger fire on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more].

For this trigger, there is no target entity to change. To test it, set minutes: "/1" so the automation runs every minute.

More examples

Real scenarios where this trigger fires in automations and scripts. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: refresh an entity every 15 minutes

If you want a regular refresh, this automation updates an entity every 15 minutes.

  • Trigger: Time pattern
    • Minutes: /15
  • Action: Update entity
YAML example for a 15-minute entity refresh
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Refresh the weather entity every 15 minutes"
triggers:
  - trigger: time_pattern
    minutes: "/15"
actions:
  - action: homeassistant.update_entity
    target:
      entity_id: weather.home

Automation: send a reminder at 15 minutes past every hour

If you want a repeating reminder during the day, this automation sends a message at 15 minutes past every hour.

  • Trigger: Time pattern
    • Minutes: 15
  • Action: Send a notification message
    • Target: My Device (notify.my_device)
YAML example for an hourly reminder
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Send an hourly reminder at 15 minutes past"
triggers:
  - trigger: time_pattern
    minutes: 15
actions:
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      message: "This is your hourly reminder."

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the trigger you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain triggers or suggest the right one when you describe what you want in plain language.

Related triggers

These triggers work well alongside this one:

  • Time: Triggers at a specific time, or from a date/time helper or timestamp-style sensor.

  • Home Assistant: Triggers when Home Assistant starts up or shuts down.