I have a waterwell that can hold 2750 ltr of rainwater and I want to meassure how much water is in there. The best solution is to use a pressure sensor with a tube to the bottom. However, water tends to dissolve in air so over time the watercolumn will slowly rise and impact the readings. I used a fishtank airpump to pump air down the tube to blow out any water and to keep the water clear. Bacteria love oxygen! During readings the pump switches off because of the pressure giving fals readings.
Basically there’s a loop: STOP pump>short wait>take reading> short wait> START pump> long wait and all over again. This was all done with an Arduino.
Now I want to switch to ESPHome and I’m stuck on how to write this loop. I’m looking for a condition I may or may not need. It’s not clear to me how to make a continues loop in ESPHome