Hi, I’m learning automations. This is a first one for me. The moisture sensor is esp8266 that goes in to sleep every 120 sec for 30min.
The goal is to detect that moisture level is above 0.5V ( which translates in to about 50%), turn on watering relay and turn it off after 60 seconds.
I can not figure out why I’m getting this error. Also looks to me that the automation may will run just ones upon HA restart.
Thank You.
The error: Stopped because only a single execution is allowed at April 9, 2025 at 8:45:57 PM (runtime: 0.00 seconds)
Here the actual YAML.
Hi, Tom,
Still have an issue: the automation will start if sensor would go from above 50 to below 50 while board is wake.
But automation never starts when sensor is below 50 when board wakes up.
I made some changes to increase resolution scale from .4V to .7V
Now sensor reports from 0 to 100 %
P.S. The " superfluous trigger" was there to indicate the sensor status change. Removed now per your advice.
I did copy-paste yaml from this post to the Automation yaml, Unfortunately it did not work. I suspect logic is waiting for the trigger to change to start the automation. As the description says: When garden-moisture2 Soil Moisture changes to any state for 5 seconds I do not want to stop this testing. But may be as a short term solution change GPIO2 depending on moisture level in the Moisture sensor configuration and monitor the GPIO status as trigger?
Sensor config. I’ll grab logs from sensor to see how if data lost because of the noise. On the subject of the sensor The LED that is connected to GPIO2 is ON. But HA Dashboard show it is OFF. I’m new to HA and suspect it is because it is defined as a “switch”?
No it is because of how you have wired it. 3.3V or 5V to LED. LED to GPIO. The LED will only be on when the GPIO is low (off). You can invert the logic in the pin definition or rewire The LED. GND to LED, LED to GPIO, with a current limiting resistor of course.
Your sensor updates every 10 seconds. So it should trigger fine. When the device wakes up and seconds the first value it will be the same value for 10 seconds. So the 5 second hold time in your trigger does nothing. It will always hold the same value for 10 seconds minimum.
The LED is between GPIO2 and GND with limiting R. So GPIO2 is HI which I expect will show the LED ON on the dashboard. In this case Garden moisture3 sensor is always ON, physical LED is ON but the Dashboard show associated LED OFF. I’m confused.
The hold time in the automation was changed to 30 seconds, thought I was not expecting the actual moisture to change even in an hour. Still looks like the automation would trigger only after HA full reload.
Well, in my case it will trigger just ones after HA restart. Reading on forums look like some users dealing with situations when a sensor status reported in ESPHome Builder is not the same as reported on Dashboard. I’m experience similar: 3 identical sensors, same config yaml, but one would never reported unavailable in Dashboard but checking ESPHome it is reported offline for extended period of time. Just FYI, my work around was to configure a GPIO High on_boot and trigger automation on it. At the end of the automation GPIO set Low. To clear it status in HA before sensor go in to sleep.
Hi, Tom, I’m still dealing with inconstant behavior of the Entities. I’m turning my GPIO high on_boot and it may stay this way in HA even when sensor is in sleep. I can not find in documentation that describes how to switch the GPIO Low after let’s say 120sec. Hope the correct status will be reported by HA before sensor go in sleep for the next boot.
Hope to make this work before I’m away and figure out inconsistencies with Dashboard when return back from travel.
Thank you
Meanwhile I created Ping sensors for some moisture sensors. And for example,Ping sensor 3 status is disconnected but dashboard show Moisture sensor3 available. I’ll try to trigger the automation on these Ping sensors.
just an update, for community benefit, using independent sensor to trigger automation works well. In my case Ping sensor. Other issues still present, my HA has latest updates.