I’m working on a esp32 based water level sensor. Measuring the water level works by pumping air down a tube and measuring the pressure. I want the measuring frequency to be higher when water is being drained and lower while it is refilling, this information is available through the status of a switch. My plan is to implement communication via MQTT
My question:
From my understanding the esp32 would decide when to measure and publish the result. How can I set an automation to change the measuring frequency?
the closest I found in the documentation is scan interval, but that only seems to be relevant for polling based devices