What can I do with ESPHome?

That’s not what I was referring to. I was asking about the ‘pressure sensor’ you said you wanted to control the pump with. (which you have since confirmed is a pressure sensor, not a pressure switch. I just wanted to check before giving further advice)

You don’t need to create your own component for this, simply connect the pressure sensor to an analog input on your ESP and use the inbuilt automations in ESPhome to control an output which you would wire to a relay controlling the pump.

It is a sensor, not a switch.
The sensor handles between 0-15 kg/cm2 , which gives 0,5 V to 4,5 V output.
I’m a new to EspHome…, I will read that.
Maybe I fix something between the sensor and the Esp (wemos mini pro) that adjusts the voltage so it vorks from allmost 0V up to 3.3V.

Any advise to point me out in the right direction is appreciated! :handshake:

You don’t need another device in between, only a resistor divider, then connect the center point of the resistor divider to the analog input of your ESP

Maybe, or a zener just to protect the esp. I have test circuit that I used together with an ATMega128 controlling some hydraulic proportional valves many years ago, it worked like a charm.
The sensor should be linear, and if get just under 3.3V at 10kg/cm2, a zener diode may be good enough. I will try this weekend to plum up a test circuit, with a valve and a manometer. If wife and daughter will allow me that is…