Shelly plug: 15min on, 15min off, 15min on, off

I want to make a shelly plug start a scheme via a virtual button. After a push, the plug must be on for 15 minutes, then off for 15 minutes, on again for 15 minutes and then stop completely.

It must be easy, but don’t find a good way.

Create an automation like this:

alias: Fan timer
description: ""
trigger:
  - platform: state
    entity_id:
      - switch.fan
    to: "On"
condition: []
action:
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 172139ba26ce0cb65a85c1a39c33f667
    entity_id: switch.fan
    domain: switch
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - type: turn_on
    device_id: 172139ba26ce0cb65a85c1a39c33f667
    entity_id: switch.fan
    domain: switch
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 172139ba26ce0cb65a85c1a39c33f667
    entity_id: switch.fan
    domain: switch
mode: single

It can all be done with the UI if you’d prefer.

1 Like
alias: On-Off
description: "Shelly plug: 15min on, 15min off, 15min on, off"
trigger:
  - platform: state
    entity_id:
      - input_button.something
    to: "on"
action:
  - repeat:
      count: "3"
      sequence:
        - service: switch.toggle
          target:
            entity_id: switch.shelly
        - delay: "00:15:00"
  - service: switch.turn_off
    target:
      entity_id: switch.shelly
1 Like

Thanks, i’ll give it a try!

Thanks! I didn’t know you could do that.