Voltage as inputs?

I have several smal project ideas that require inputs from dumb devices.

For example they deliver 220V mains voltage when on, or 12v DC and so on.

GPIOS will fry, so how do I read that input into HomeAssistant?

Example, I have a Heatpump that makes hotwater to heat my house.
I want a sensor that tells Home Asstant that it is ON and running because then the sirculation pumps must also run. (Today that is solved by running 24/7)
It pulls 5kW so a powerplug is not possible and it uses 3phase 230V IT and nothing is made for that (EU uses 400V TN).

So whenever it is ON, there is 230V the power outlet of the sirculation pump, that power is also there as frost protection to run the pump when it’s too cold so that the water does nor freeze. (That outlet is not used, no cables was pulled for it, and the pump is nowhere near the heatpump, so it was just installed and turnd on and runs 24/7.

Example, I have a Watermaker on my Boat.
It has 2 push buttons to control it. It runs on 12V.
Push ON/Off and it starts making freshwater and lights a blue ring around the pushbutton.
That blue ring gets 12v and with that signal I would know it’s running.

Push Flush and it starts the freshwater flush and runs for 2 mins. The blue ring on that pushbutton lights up as long as the flush is running.

Getting the pushbuttons to Home Assistant was as simple as using a ESP8266 Relay board and solder the pins to the pushbutton, so now I can push the buttons (A automation turns it off after a second so it works at a 1 second button press).

Now how to read the blue rings? How do I read it just like a pushbutton?

Those blue rings also blink for errors, and the pushbuttons have several modes according to how long you press. Oh, and it beeps…

You might google ‘esp32 energy measurement with current tap’, there are many projects in these areas. Some very DIY and some ‘off the shelf (at lease in a home assistant tinker sense :wink: )’. Here is a board that has six tap inputs. I have never measured DC current with a tap around the wire, however I believe it is possible. Most of these are designed for the software to extract voltage, current and power over time, however siimply looking for a change between near zero amps and a non-zero threshold should be easy either in the esp device or in Home Assistant. Be awaare of EMF pulses that can occur when you put the tap on. Good hunting!

Shelly have some useful product, if you don’t want to play with PCBs and opto’s.

I use Shelly EM to monitor AC currents. You might also find the Shelly i4, or i4 DC useful.

I also use Shelly EM plus CT clamp to let me know when a pressure operated water pump is triggered. The same Shelly can also controls a 16 Amp contactor. Works like a dream!