Flow control on esphome, PID?

Hi all,

I have an configured and esphome with a flow sensor and a servo, this to control a flow in a pool system.
Manually I can read and change the servo to the correct flow speed. But I want to automate that.

The flow should be 0.95L/min and the servo setting goes from 0 to 100. At the moment manually at 48.

I think I need some sort of PID control to automate it, but the climate PID expects a temperature sensor…

Any idea’s on how to achieve it on the esp ?

A different PID plugin ported from Arduino? Or ?

Any help is appreciated, I am not a coder…

Can you not just calibrate the servo so that you know what percentage on the servo equates to 0.95L/s?

That would work, the only problem is the water coming in differs sometime in flow. Due to filter getting full or a speed change of the pump. So that why I am looking for some automatic… Now I manually change
the setting daily.

Well that is not automatic enough! I guess when flow is low, increase by 10%, if high decrease by 10%. Try that, it may do the trick.

The other way would be to try faking it, create a template sensor which takes the flow, and forces it to be a temperature. And similarly for the servo.

That is indeed an idea, change it to temperature. :slight_smile: Will try that, and see how that goes.

And for the other option, increase / decrease. How would you program that? In the esphome firmware ? Or with an automation in Home Assistant ?

On the esp with a bit of lambda code.

Hmmm, could I ask for an example? I think you have more experience with coding than I have now, more of an hardware guy…

Will start reading!

may I ask the model number of flow meter that you’re using?

I am using a Sea YF-S201 from Amazon.de

Flow Sensor