Multi Flow buckets + ESP32 + Node Red
Posted: Fri Jun 25, 2021 2:05 am
PARTS LIST
Multi Flow buckets
https://www.hydroponics.net/
4-Channel 5v Solid State Relay Module
https://www.amazon.com/WINGONEER-level- ... p_d_rp_2_t
ESP32-DevKitC core Board ESP32
https://www.amazon.com/gp/product/B08KT ... UTF8&psc=1
PROJECT BOX
https://www.amazon.com/QILIPSU-150x150x ... _d_rp_1_t
FLOAT SWITCHES = 5 PER MASTER BUCKET
https://www.amazon.com/Anndason-Pieces- ... NrPXRydWU=
#==============================================
ESP32 code for ESPHome
#==============================================
Multi Flow buckets
https://www.hydroponics.net/
4-Channel 5v Solid State Relay Module
https://www.amazon.com/WINGONEER-level- ... p_d_rp_2_t
ESP32-DevKitC core Board ESP32
https://www.amazon.com/gp/product/B08KT ... UTF8&psc=1
PROJECT BOX
https://www.amazon.com/QILIPSU-150x150x ... _d_rp_1_t
FLOAT SWITCHES = 5 PER MASTER BUCKET
https://www.amazon.com/Anndason-Pieces- ... NrPXRydWU=
#==============================================
ESP32 code for ESPHome
#==============================================
Code: Select all
esphome:
name: garden-bucket-controller
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "what ever"
password: "what ever"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "what ever"
password: "what ever"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "what ever"
ota:
password: "what ever"
#==============================================
web_server:
port: 80
#==============================================
switch:
- platform: restart
name: "garden-bucket-controller Restart"
#==============================================
# 4 cahannel relay board (ch 1) GPIO16 #
#==============================================
- platform: gpio
pin: GPIO16 #D7
name: "relay ch 1"
id: G_B_C_relay_ch_1
inverted: true
#==============================================
# 4 cahannel relay board (ch 2) GPIO17 #
#==============================================
- platform: gpio
pin: GPIO17
name: "relay ch 2"
id: G_B_C_relay_ch_2
inverted: true
#==============================================
# 4 cahannel relay board (ch 3) GPIO18 #
#==============================================
- platform: gpio
pin: GPIO18
name: "relay ch 3"
id: G_B_C_relay_ch_3
inverted: true
#==============================================
# 4 cahannel relay board (ch 4) GPIO19 #
#==============================================
- platform: gpio
pin: GPIO19
name: "relay ch 4"
id: G_B_C_relay_ch_4
inverted: true
#==============================================
text_sensor:
- platform: template
name: Uptime Human Readable
id: uptime_human
icon: mdi:clock-start
sensor:
- platform: uptime
name: Uptime Sensor
id: uptime_sensor
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? String(days) + "d " : "") +
(hours ? String(hours) + "h " : "") +
(minutes ? String(minutes) + "m " : "") +
(String(seconds) + "s")
).c_str();
#==============================================
#sensor:
- platform: wifi_signal
name: "garden-bucket-controller_wifi_signal"
update_interval: 60s
# - platform: uptime
# name: "garden-bucket-controller_wifi_uptime"
# update_interval: 60s
#==============================================
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
name: top_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
# - invert:
#==============================================
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
name: Mid_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
# - invert:
#==============================================
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
name: Bottom_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
- invert:
#==============================================
- platform: gpio
pin:
number: GPIO23
mode: INPUT_PULLUP
name: Very_Bottom_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
- invert:
#==============================================
- platform: gpio
pin:
number: GPIO25
mode: INPUT_PULLUP
name: Over_Flow_Float
device_class: moisture
filters:
- delayed_on: 0ms
- delayed_off: 0ms
- invert:
#==============================================
# 1 line_2_top_float GPIO2
#==============================================
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
name: line_2_top_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
- invert:
#==============================================
# 2 line_2_Mid_float GPIO3
#==============================================
- platform: gpio
pin:
number: GPIO2
mode: INPUT_PULLUP
name: line_2_Mid_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
- invert:
#==============================================
# 3 line_2_Bottom_float GPIO5
#==============================================
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
name: line_2_Bottom_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
- invert:
#==============================================
# 4 line_2_Very_Bottom_float GPIO27
#==============================================
- platform: gpio
pin:
number: GPIO27
mode: INPUT_PULLUP
name: line_2_Very_Bottom_float
device_class: moisture
filters:
- delayed_on: 1ms
- delayed_off: 1ms
# - invert:
#==============================================
# 5 line_2_Over_Flow_Float GPIO26
#==============================================
- platform: gpio
pin:
number: GPIO26
mode: INPUT_PULLUP
name: line_2_Over_Flow_Float
device_class: moisture
filters:
- delayed_on: 0ms
- delayed_off: 0ms
- invert:
#==============================================