Pentair Pump Controller

I figured someone might find this useful so I am putting it here. I have a Pentair PID30 pump controller and wanted to get it into HA. I initially was just going to use it’s programmable IO to get some state info and maybe be able to remotely disable it. I saw it had what looked like an RS485 connection and ended up finding this:

I had a set of these on hand:

and threw together an interface and was able to successfully communicate with the controller! I don’t have all the control I want, but I have basically everything. (One of the big things I wanted was the ability to change the amperage limit, I was able to get it down to about 7 amps and still get up to pressure. This makes it easier to run on generator power as the pump does not load the generator up so badly)

Here is my Current ESPHome YAML:

esphome:
  name: pumpcontroller
  friendly_name: PumpController

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "Something"

ota:
  password: "Something"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Pumpcontroller Fallback Hotspot"
    password: "Something"

captive_portal:

web_server:
  port: 80
  auth:
    username: !secret esphome_web_username
    password: !secret esphome_web_password

uart:
  id: mod_bus
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 19200

modbus:
  flow_control_pin: GPIO4
  id: modbus1

modbus_controller:
  - id: pentair1
    address: 0x1
    modbus_id: modbus1
    update_interval: 5s
  - id: pentair2
    address: 0x2
    modbus_id: modbus1
    update_interval: 1s


select:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    name: "Set Pressure"
    icon: mdi:waves-arrow-up
    address: 218
    value_type: S_WORD
    optionsmap:
      "60": 414
      "65": 448
      "68": 469
      "70": 483
  
  - platform: modbus_controller
    modbus_controller_id: pentair1
    name: "Peak Current"
    icon: mdi:current-ac
    address: 5200
    value_type: S_WORD
    optionsmap:
      "10.1": 16673
      "9.1": 16657
      "8.1": 16641
      "7.1": 16611
      "6.1": 16579

sensor:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: int_set
    name: "Pressure Setpoint"
    address: 218
    unit_of_measurement: "PSI"
    icon: mdi:water
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.145038
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: pressure
    name: "Current Pressure"
    address: 221
    unit_of_measurement: "PSI"
    icon: mdi:water-circle
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.145038
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: ready
    name: "Ready"
    icon: mdi:water-check
    address: 33
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1

binary_sensor:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: sleeping
    name: "Sleeping"
    icon: mdi:sleep
    register_type: holding
    address: 216

Here is my Original ESPHome YAML I used:

esphome:
  name: watermonitor
  friendly_name: WaterMonitor

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Watermonitor Fallback Hotspot"
    password: ""

captive_portal:


web_server:
  port: 80
  auth:
    username: !secret esphome_web_username
    password: !secret esphome_web_password

uart:
  id: mod_bus
  tx_pin: 1
  rx_pin: 3
  baud_rate: 19200

modbus:
  flow_control_pin: 22
  id: modbus1

modbus_controller:
  - id: pentair1
    address: 0x1
    modbus_id: modbus1
    update_interval: 1s
  - id: pentair2
    address: 0x2
    modbus_id: modbus1
    update_interval: 1s


select:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    name: "Set Pressure"
    address: 218
    value_type: S_WORD
    optionsmap:
      "60": 414
      "65": 448
      "68": 469
      "70": 483
  
  - platform: modbus_controller
    modbus_controller_id: pentair1
    name: "Peak Current"
    address: 5200
    value_type: S_WORD
    optionsmap:
      "10.1": 16673
      "9.1": 16657
      "8.1": 16641
      "7.1": 16611
      "6.1": 16579

sensor:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: int_set
    name: "Pressure Setpoint"
    address: 218
    unit_of_measurement: "PSI"
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.145038
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: pressure
    name: "Current Pressure"
    address: 221
    unit_of_measurement: "PSI"
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.145038
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: ready
    name: "Ready"
    address: 33
    register_type: holding
    value_type: U_WORD
    accuracy_decimals: 1

binary_sensor:
  - platform: modbus_controller
    modbus_controller_id: pentair2
    id: sleeping
    name: "Sleeping"
    register_type: holding
    address: 216
    #bitmask: 0x80 #(bit 8)



1 Like

Thank you so much for this.

I have a PID020 and I’d like to be able to reset it from homeassistant when it gets into an error after a powerfailure. Despite the fact that I have a generator, it often ends up stopped with an overcurrent or voltage error and I have to manually clear the error. Were you able to find the modbus mapping that would do a reset action?

I have asked my dealer to see if the app even has that function and no answer so far.

Since the app use a modbus module connected to the same port, we should be able to do whatever the app is doing.

I have not yet, though I have been considering trying again. (Last few times the generator came on line the controller came up in an error state, but I did not have time to troubleshoot). I am hoping the app can do it, as that would be really cool. As an alternative you can try mapping one of the digital inputs to “Run Enabled” and see if that clears the fault:


The last alternative would to solder a wire to the clear / run buttons and use a small relay to “press” the buttons with the ESP. I already am stealing 5V from the control panel to run my ESP, so it would not be a lot more to grab those two buttons for me. I spent a couple hours trying to find a register to switch between run and stop, but ran out of time unfortunately.

I’ve been working on the same problem for my PID10, and just wanted to bring your attention to some of the progress I’ve made on the read-only side of things. I haven’t made any progress on issuing commands.

Esphome config
Crowdsourced docs repo

1 Like