Handling safety switch - must execute on Esp board

I use espHome for a pool pressure, temp, and pump control with HA today and it works beautifully and was super easy to setup.

I’m now working on an irrigation setup where i have to control 2 pumps - one to fill the tank from a stream and one to water the plants. I have 2 level sensors (reed switches) for the bottom and top limits of the tank. If I hit the bottom limit the irrigation pump MUST shut off. If I hit the top limit the stream pump MUST shut off.

For timing of the 2 pumps no problem using ESPhome. But I don’t want to rely on my wifi network and HA to read the switches to shut off the pumps. How do I configure the 2 switches so they shut off the pumps using local esp execution? In other words if my HA server blows up I still need the logic to work…

Thanks! I was digging into the GitHub code and searching for “esphome architecture” to understand what’s happening. If anyone has pointers to an explanation of what runs where and how esphome works that would be appreciated.

But for now this simply solves my problem…

One thing to remember, if you want a device to continue doing it’s job if WiFi goes away, is to set reboot_timeout: 0s, in the WiFi settings.

This prevents reboots when it can’t connect.

I have a couple of projects that perform complex tasks standalone and only use HA for remote monitoring.