Hello I am using esphome to detect the water level in my automatic plant watering system. I’ve also setup an automation to send me a message whenever the tank is empty.
- alias: Plant water tank empty
initial_state: on
trigger:
platform: state
entity_id: binary_sensor.plant_tank
to: "off"
for:
seconds: 200
action:
- service: notify.mobile_app_xxxx
data:
title: "Attention"
message: "{{ states(\"sensor.date_time\") }} Water tank empty!!"
So when the tank is empy the binary_sensor goes to off and after 200 seconds a message is sent. The problem is whenever the esphome device has a severed connection and becomes unavaliable, the state of the binary_sensor goes to “unavaliable” too. So when it comes back online. The automation is triggered after 200 seconds and sends another message.
Is there a way to fix this?
Just connect the gpio pin to a relay which in turns controls a AC pump. For water level monitoring I am using something like this:
If you are only interested in the water level sensor this will not be relevant but for any one interested a digital relay is much more robust for the problem.
I do a similar thing but for the water level in my pool. However, in that particular case, I am using a Fibaro ZWave Smart Implant instead of an ESP-based device. I don’t only get a warning but the automation actually adds water to the pool automatically.