Changed chlorine-pump to use the Ezo Orp module by AtlasScientific using I2C.

This module is by miles more accurate than any analog crap we could have come up with...

Not that the last idea was anything to scoff at I guess
This commit is contained in:
2024-05-25 20:01:05 +02:00
parent 4b7195a037
commit 1bd3b7eb90
5 changed files with 340 additions and 20 deletions

View File

@@ -21,7 +21,7 @@ external_components:
- source:
type: local
path: external_components/
components: [ chlorine_pump ]
components: [ chlorine_pump, ezo_orp_i2c]
globals:
- id: last_pump_state
@@ -58,7 +58,7 @@ binary_sensor:
- platform: gpio
id: pool_pump
pin:
number: D2
number: D5
inverted: true
mode:
input: true
@@ -67,6 +67,24 @@ binary_sensor:
- script.execute:
id: manage_power
switch_state: !lambda return id(power).state;
- platform: gpio
id: calibrater
pin:
number: GPIO0
inverted: true
on_press:
- sensor.ezo_orp_i2c.print_device_info:
id: chlorine_sensor
on_click:
min_length: 5s
max_length: 10s
then:
- sensor.ezo_orp_i2c.calibrate:
id: chlorine_sensor
calibrate_target: 475
- output.turn_on: wifi_status_led
- delay: 2s
- output.turn_off: wifi_status_led
- platform: template
id: pump_state
name: Pump State
@@ -138,27 +156,17 @@ text_sensor:
name: Cycle Info
id: cycle_text_info
i2c:
sensor:
- platform: adc
name: Chlorine
- platform: ezo_orp_i2c
id: chlorine_sensor
unit_of_measurement: "mV"
icon: "mdi:test-tube"
pin: A0
update_interval: 200ms
filters:
- multiply: 3.3
- offset: -1.5
- multiply: 1000.0
- median:
window_size: 25
send_every: 25
send_first_at: 25
- offset: 30.0
name: Chlorine
update_interval: 5s
- platform: hx711
name: "Chlorine Canister Levels"
dout_pin: D5
clk_pin: D1
dout_pin: D7
clk_pin: D8
gain: 128
update_interval: 20s
accuracy_decimals: 1
@@ -177,7 +185,7 @@ chlorine_pump:
pump: pump_switch
sensor: chlorine_sensor
id: chlorine_pump_component
target: 700
target: 600
disable_clock: false
proportional_band: 400
on_pump_value: