Hi, I’d like to be able build a device using and ESP32-S3 using the ESPHome framework, integrated in homeassistant (for configuration, reporting, control) but fully autonomous for automations.
Basically, I need to control a pump and have automations that will run locally on the ESP32 that will:
- No matter what make sure that the pump runs a minimum x minutes a day, this needs to survice across reboots …
- No matter what, make sure that the pump never runs more than y minutes a day, based, say, on a current-sensor that I will have, that also needs to survive reboot and it would be very unlikely that the pump stays on while the reboot takes place (but maybe, stuck relay, pin, ), but I can get back the state when the boards reboot using the current sensor and approximate run time across reboot (or power off) if I have a last checked time and the time elapsed since.
- trigger an alarm on homeassistant (and maybe a local buzzer if need be) if I find out that I exceed these values
- turn off, make sure the pin stays turned off, if I exceed the maximum time.
All the configuration should be local to the esp32 but changeable on the homeassistant dashboard and i should be able to track runtime, status, turn on the pomp, turn it off, …
My probleme is mostly with automations, I think this can be done with Lambdas but I’m puzzled on where to start. (every day at (configurable times) run pump for (configuratble) minutes, (constantly check maximum and minimum thresholds and act accordingly (pin, alerts, …)
Can anybody give me some information on how to do that?
Thank you!