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)