Hello,
As a part of my on going project of building the ultimate HA&ESPhome Aquarium controller,I need to control a peristaltic pump controlling fertilizer dosing to the system.
the pump is connected to a relay,and has a constant flow rate of 0.5mL/Sec.
I want to be able to control the dosing amount with a slider/input box so i need to multiply the time/ml (for example, 5 ml is 10 sec for the relay to work). can I achieve this using only ESPhome? or do i have to include automatons in HA?
at any case, an example for a suitable code world be much appreciated(ESPhome+HA/ESPhome only)
my current ESPhome YAML(without any preparation for the “timed” element)
esphome:
name: aquarium
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "ssid"
password: "password"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Aquarium Fallback Hotspot"
password: "tJUf7l4kshn3"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
dallas:
pin: GPIO4
update_interval: 30s
# Individual sensors
sensor:
## Temp sensor
- platform: dallas
address: 0xED011452C0E8AA28
name: "Aquarium Water Temp"
- platform: dallas
address: 0xDD0000031EFB0428
name: "Aquarium Air Temp"
## pH Sensor
- platform: adc
pin: GPIO35
id: ph
name: "pH Level"
icon: "mdi:mdi-flask-outline"
update_interval: 1s
unit_of_measurement: pH
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 3
# Measured voltage -> Actual pH (buffer solution)
- calibrate_linear:
- 0.59 -> 7.0
- 0.71 -> 4.0
switch:
- platform: gpio
name: "Filter"
icon: "mdi:air-filter"
pin: GPIO15
- platform: gpio
name: "Heater"
icon: "mdi:coolant-temperature"
pin: GPIO2
- platform: gpio
name: "Air Pump"
icon: "mdi:air-purifier"
pin: GPIO0
- platform: gpio
name: "Back Light"
icon: "mdi:led-variant-on"
pin: GPIO5
- platform: gpio
name: "Main Light"
icon: "mdi:lightbulb"
pin: GPIO14
- platform: gpio
name: "Fertilizer Pump"
icon: "mdi:sprout"
pin: GPIO12
- platform: gpio
name: "CO2 Reactor"
icon: "mdi:periodic-table-co2"
pin: GPIO13
- platform: gpio
name: "Cooling Fans"
icon: "mdi:fan"
pin: GPIO13