Automation Device on x minutes off y minutes

I have hydroponics system that where I am growing some herbs. Systems has pump that pump that circulates water in system Pump is plugged in normal Hue smart plug. I have tried to make automation that runs pump between 8 am to 10 pm and pump runs for example 15 min on and 45 min off or 30 min on 45 min off. How do I do that with Automations. I have only figured out how to run pumpu 30 min on and 30 off but that way herbs get too much water.

Also is there way to make card on dashboard to easy way to change times when pump is running and not running?

Thanks for the answers!

Here’s a skeleton for a timer-based asymmetric cycle… you’ll need to decide if you want additional ways to manually initiate and terminate the cycle as well as any fail-safe control mechanisms.

alias: Asymmetric Timer Cycle
description: ""
trigger:
  - platform: event
    id: timer
    event_type: timer.finished
    event_data:
      entity_id: timer.pump
  - platform: time
    at:
      - "08:00:00"
      - "22:00:00"
condition: []
action:
  - variables:
      on_time: "00:15:00"
      off_time: "00:30:00"
      next_interval: "{{ iif( is_state('switch.pump', 'off'), on_time, off_time) }}"
  - choose:
      - conditions:
          - condition: trigger
            id: timer
        sequence:
          - service: switch.toggle
            target:
              entity_id: switch.pump
            data: {}
          - service: timer.start
            data:
              duration: "{{ next_interval }}"
            target:
              entity_id: timer.pump
      - conditions:
          - condition: time
            before: "08:01:00"
        sequence:
          - service: switch.turn_on
            target:
              entity_id: switch.pump
            data: {}
          - service: timer.start
            data:
              duration: "{{ on_time }}"
            target:
              entity_id: timer.pump
    default:
      - service: switch.turn_off
        target:
          entity_id: switch.pump
        data: {}
      - service: timer.cancel
        target:
          entity_id: timer.pump
mode: single
1 Like

Thank you. with little bit of testing it seems to work very well :grinning: