Flower watering
How can I ensure that the code (ESPHOME) continues to run even if no WIFI is available?
esphome:
name: hydrophonic
friendly_name: hydrophonic
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: VERBOSE
# Enable Home Assistant API
api:
encryption:
key: "5GgSOc0S41Xob6Ps3NbCCF9wi2m9eQW3gtLAGrYqBt4="
ota:
password: "ece47d972c7a16658b4be3675ac2b97c"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Testesp32 Fallback Hotspot"
password: "v8L2uBgNOlf2"
captive_portal:
binary_sensor:
- platform: gpio
pin: GPIO16 # GPIO-Pin des Wasserstandsschalters
name: "Water Sensor"
id: water_sensor
internal: false
filters:
- delayed_on: 10ms
device_class: moisture
- platform: gpio
pin: GPIO12 # GPIO-Pin des Relais
name: "Relay State"
id: relay_state
internal: true
device_class: power
switch:
- platform: gpio
name: "Relay"
pin: GPIO13 # GPIO-Pin des Relais
id: relay
interval:
- interval: 1min
then:
- if:
condition:
binary_sensor.is_on: water_sensor
then:
- switch.turn_on: relay
- delay: 1min
- switch.turn_off: relay