Pool Pump Scheduler

This blueprint aims to simplify scheduling a simple pool setup with a pump (filter). You set the pool size (volume) and the pump’s flow rate and the automation takes care of controlling the pump for the optimal circulation turnovers. You can limit the hours of day the pump should work as well.
All you need is your pool setup specs and a switch to control the pump.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled. Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Pool Pump Scheduler
  description: Schedules pool pump based on its capacity and pool size. Just set your pools ize (volume), your pump flow rate and desired time limit the pump can rum daily. The automation will calculate the turnover rate and swithes on and off the pump as required.
  domain: automation
  input:
    pool_pump:
      name: Pool Pump
      description: A switch that controls the pool pump
      selector:
        entity:
          domain: switch

    pool_volume:
      name: Pool Volume
      description: The capacity of the pool. This will be used to calculate the turnover rate of your pool. Use the same bas unit for Pool Volume and Pump Flow Rate!
      selector:
        number:
          min: 1
          max: 300
          unit_of_measurement: "gal/m3/l"
          mode: box
    
    pump_flow_rate:
      name: Pump Flow Rate
      description: The flow rat eof your pool pump. This will be used to calculate the turnover rate fo your pool. Use the same bas unit for Pool Volume and Pump Flow Rate!
      selector:
        number:
          min: .5
          max: 300
          unit_of_measurement: "gph/m3ph/lph"
          step: .5
          mode: box

    maximum_run_time:
      name: Maximum Pump Run Time Per Day
      description: The deisred pump run time per day.
      selector:
        number:
          min: 0
          max: 24
          mode: slider
          unit_of_measurement: hours
      default: 8

    season_toggle:
      name: Pool Season toggle
      description: Adds ability to completely turn on-off the automation using a switch or boolean helper
      selector:
        entity:
          domain: 
            - input_boolean
            - switch
  

variables:
  var_pool_pump: !input pool_pump
  var_pool_volume: !input pool_volume
  var_pump_flow_rate: !input pump_flow_rate
  var_maximum_run_time: !input maximum_run_time
  var_turnover_rate: '{{ (var_pool_volume | float(1)) / (var_pump_flow_rate | float(1)) }}'
  var_turnover_per_day: '{{ 24 / var_turnover_rate }}'
  var_runs_per_day: '{{ ((var_maximum_run_time | int(1)) / var_turnover_rate) | round(0) }}'
  var_pump_state_changed_sice: '{{ (now().timestamp() - as_timestamp(states[var_pool_pump].last_changed)) / 3600 }}'
  var_max_off_time: '{{ (24 - var_maximum_run_time | int) / var_runs_per_day }}'

trigger:
  - platform: time_pattern
    minutes: /1
  # proper trigger after variables in trigger will be supported
  # - platform: template
  #   id: on_trigger
  #   value_template: >-
  #     {% if is_state(var_pool_pump, 'on') and (var_pump_state_changed_sice > var_turnover_rate) %}true{% endif %}
  # - platform: template
  #   id: off_trigger
  #   value_template: >-
  #     {% if is_state(var_pool_pump, 'off') and (var_pump_state_changed_sice > var_max_off_time) %}true{% endif %}
condition: []

action:
- choose:
  - conditions:
    - condition: state
      entity_id: !input pool_pump
      state: 'off'
    - condition: state
      entity_id: !input season_toggle
      state: 'on'
    - condition: template
      value_template: >-
        {{ var_pump_state_changed_sice > var_max_off_time }}
    # - condition: trigger
    #   id: on_pattern
    sequence:
    - service: switch.turn_on
      target:
        entity_id: !input pool_pump
  - conditions:
    # - condition: trigger
    #   id: off_pattern
    - condition: state
      entity_id: !input season_toggle
      state: 'off'
    - condition: state
      entity_id: !input pool_pump
      state: 'on'
    - condition: template
      value_template: >-
        {{ var_pump_state_changed_sice > var_turnover_rate }}
    sequence:
    - service: switch.turn_off
      target:
        entity_id: !input pool_pump
  - conditions:
    - condition: state
      entity_id: !input season_toggle
      state: 'off'
    sequence:
    - service: switch.turn_off
      target:
        entity_id: !input pool_pump
  default: []
mode: single
8 Likes

Hey man, I love this, saved me a ton of time. One question, request:

Some form of input_boolean blocker. I live in New England, so 9/12 months, pool is covered, I have a boolean for “Pool Season” that changes my lovelace for summer, I would like to also have this automation only run if “Pool Season” is “on”

3 Likes

@swingerman so I’ve imported this blueprint and selected my pool pump switch and entered in the additional details. I’m not quite clear on how this works. I currently have my pump switch turned on, which was on before I imported the blueprint, so will this blueprint turn my pump off and on under some schedule? One aspect that I want to have taken into consideration is when the electricity rates are high, so that I run the pump at off-peak times.

2 Likes

Hey @timnolte . It should turn on-off based on the volume of your pool and the flow rate of your pomp. I will try to add season on-off boolean

Updated the blueprint with season toggle support

1 Like

@swingerman what is the trigger for it to turn on? Does this just turn on the pump when you first enable the automation and then just run for however many hours to cycle your pool based on volume and then turn off for however much time remaining based on a 24 hour timeframe?

Hi, it’s a great job, but I’ll give you several ideas:

Covered or uncovered pool checkbox (times are shorter in the covered pools)

More switch controls, for example chlorine, pH pump… in my case chlorine is enough with 3 hours but I need 5 hours to filter the pool. If I leave it for 5 hours, the chlorine rises too much.

hello very good blueprint thank you

is it possible to add support for the temperature of the water in the filtration time?

1 Like

Could you please elaborate on what we should do with that data?

thank you!

would be nice to limit it to hours, so it could either be used in a cheaper tariff or if you have solar panels during the day…

3 Likes