Skip to content
Snippets Groups Projects
Commit 4fc3b150 authored by Jan Grewe's avatar Jan Grewe
Browse files

add dosing pump control for pH+/-

parent 4ec8e1f4
Branches
No related tags found
No related merge requests found
Pipeline #964 passed
......@@ -4,7 +4,7 @@ stages:
- deploy
image:
name: esphome/esphome:2023.9.3
name: esphome/esphome:2023.10.6
entrypoint: [""]
validate_configs:
......
......@@ -27,3 +27,4 @@ packages:
ec: !include packages/ec.yaml
ph: !include packages/ph.yaml
sts35: !include packages/sts35.yaml
pca9685: !include packages/pca9685.yaml
globals:
- id: pump1_ml_sec
type: float
initial_value: !secret pump1_ml_sec
- id: pump1_dose_ml
type: int
initial_value: !secret pump1_dose_ml
- id: pump2_ml_sec
type: float
initial_value: !secret pump2_ml_sec
- id: pump2_dose_ml
type: int
initial_value: !secret pump2_dose_ml
pca9685:
- id: pca9685_dosing
frequency: 100Hz
output:
- platform: pca9685
id: output_ph_down
pca9685_id: pca9685_dosing
channel: 8
- platform: pca9685
id: output_ph_up
pca9685_id: pca9685_dosing
channel: 7
switch:
- platform: output
output: output_ph_down
id: ph_down
name: "pH Down"
on_turn_on:
- then:
- logger.log:
level: INFO
tag: "dosing"
format: "Dosing %d ml of 'pH Down' (%.1f seconds @ %.2f ml/s)"
args: [ 'id(pump1_dose_ml)', 'id(pump1_dose_ml) / id(pump1_ml_sec)', 'id(pump1_ml_sec)' ]
- delay: !lambda return id(pump1_dose_ml) / id(pump1_ml_sec) * 1000;
- switch.turn_off: ph_down
on_turn_off:
- then:
- logger.log: "Stopped dosing 'pH Down'"
- platform: output
output: output_ph_up
id: ph_up
name: "pH Up"
on_turn_on:
- then:
- logger.log:
level: INFO
tag: "dosing"
format: "Dosing %d ml of 'pH Up' (%.1f seconds @ %.2f ml/s)"
args: [ 'id(pump2_dose_ml)', 'id(pump2_dose_ml) / id(pump2_ml_sec)', 'id(pump2_ml_sec)' ]
- delay: !lambda return id(pump2_dose_ml) / id(pump2_ml_sec) * 1000;
- switch.turn_off: ph_up
on_turn_off:
- then:
- logger.log: "Stopped dosing 'pH Up'"
......@@ -4,3 +4,7 @@ ota_password: ""
api_password: ""
domain: "local"
timezone: "Europe/Berlin"
pump1_ml_sec: "2.15" # millilitre per second
pump1_dose_ml: "10" # millilitre per dose
pump2_ml_sec: "2.15" # millilitre per second
pump2_dose_ml: "10" # millilitre per dose
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment