Skip to content

Variable Speed Pumps

djtimca edited this page Jun 7, 2022 · 5 revisions

Variable Speed Pumps

Unfortunately Home Assistant doesn't have a "pump" entity with variable speed capabilities, so we have leveraged the "switch" entity for all pumps and added a custom service which will allow you to control your variable speed pumps.

Recommended Helper

The pump speed for variable pumps is exposed as a sensor which you can track. I prefer to also have a control to use for the pump as a slider in my UI, so I found it easier to create a helper for this purpose. Go to the Helpers section of the setup in Home Assistant and create a new helper with the following characteristics:

  • Name: Pool Pump Speed
  • Icon: mdi:gauge
  • Minimum Value: The lowest % setting allowed on your pump - in my case this was 35
  • Maximum Value: 100
  • Display Mode: Slider
  • Step Size: 1
  • Unit of Measurement: %
  • Entity ID: input_number.pool_pump_speed

You will then need two services to allow your helper to control the pump and to keep it synced with speed changes that happen outside of the slider:

Automation 1: Pool - Set Pump Speed

alias: Pool - Set Pump Speed
description: ''
trigger:
  - entity_id: input_number.pool_pump_speed
    platform: state
condition:
  - condition: state
    entity_id: switch.POOL_PUMP_ENTITY
    state: 'on'
action:
  - data_template:
      entity_id: switch.POOL_PUMP_ENTITY
      speed: '{{ states.input_number.pool_pump_speed.state | int }}'
    service: omnilogic.set_pump_speed
mode: single

Automation 2: Pool - Update Pump Speed Slider

alias: Pool - Update Pump Speed Slider
description: ''
trigger:
  - entity_id: sensor.POOL_PUMP_ENTITY
    platform: state
  - event: start
    platform: homeassistant
condition:
  - condition: state
    entity_id: switch.POOL_PUMP_ENTITY
    state: 'on'
action:
  - data_template:
      value: '{{ (states.sensor.POOL_PUMP_SPEED_ENTITY.state | float) }}'
    entity_id: input_number.pool_pump_speed
    service: input_number.set_value
mode: single
max: 20

Recommended Scripts - Speed Quick Sets for Buttons

To make it easy to set your pump speed without the slider, I have created three 'quick settings' for the pump speed that I expose through buttons on the UI. In my case I used 35%, 55%, and 85% as my 'low', 'medium', and 'high' settings, but you can use whatever works best for you and your pool. These are created as scripts that are identical other than the speed:

Script: Pool Pump - X%

Example for 35% script:

alias: Pool Pump - 35%
mode: single
sequence:
  - data:
      speed: 35
    entity_id: switch.POOL_PUMP_ENTITY
    service: omnilogic.set_pump_speed

The scripts can then be used easily as buttons on the UI, or in automations for scheduling pump speeds (for example set to 'low' from 7am-7pm, 'high' from 7pm-7am).

UI Block to Control a Variable Speed Pump

If you want a quick helper to set up a control block in your UI I use a combination of vertical and horizontal stacks with my helpers to produce the following block to control.

image

You can reproduce this using the following in your UI (note you will need to update entities and script names for your setup):

cards:
  - entities:
      - entity: switch.POOL_PUMP_ENTITY
        name: Power
    show_header_toggle: false
    title: Pool Pump
    type: entities
  - card:
      entities:
        - entity: input_number.pool_pump_speed
          name: Set Speed
      show_header_toggle: false
      type: entities
    conditions:
      - entity: switch.POOL_PUMP_ENTITY
        state: 'on'
    type: conditional
  - cards:
      - entity: script.pool_pump_35
        hold_action:
          action: more-info
        icon: mdi:speedometer-slow
        name: 35%
        show_icon: true
        show_name: true
        show_state: false
        tap_action:
          action: toggle
        type: button
      - entity: script.pool_pump_55
        hold_action:
          action: more-info
        icon: mdi:speedometer-medium
        name: 55%
        show_icon: true
        show_name: true
        show_state: false
        tap_action:
          action: toggle
        type: button
      - entity: script.pool_pump_85
        hold_action:
          action: more-info
        icon: mdi:speedometer
        name: 85%
        show_icon: true
        show_name: true
        show_state: false
        tap_action:
          action: toggle
        type: button
    type: horizontal-stack
type: vertical-stack