Repeating Timers

Hi, happy easter everyone.

I’d like to setup a repeating timer. Say to turn on a switch every hour for 15 minutes. I’ve read the time integration, but I’m not sure I understand how it works [actually a better way to say it is: I’m sure I don’t understand how it works!].

I’d like to set a timer that switches on, on the hour, stay on for 15 minutes and then switch off and repeat.

Can anyone suggest how this might be achieved? It’s probably pretty simple to do, but I’m just not getting it.

The simplest way is with two automations. One for on, one for off.

First automation (on):

trigger:
  platform: time_pattern
  hours: "/1" # on the hour
action:
  service: switch.turn_on
  entity_id: switch.your_switch_here

Second automation: (off):

trigger:
  platform: state
  entity_id: switch.your_switch_here
  to: "on"
  for: 
    minutes: 15
action:
  service: switch.turn_off
  entity_id: switch.your_switch_here

You can read more about the available triggers here:

Nine times out of ten when you think you need a timer it can be done simpler with a “for:” in an automation trigger.

4 Likes

Thanks Tom, that looks exactly what I am looking for. I shall give that a try. I was probably over complicating things. Thanks so much for your response. Cheers mate.

1 Like