Information from a pre programmed esp32

Hi!

Sorry i’m new in ESPhome, and sorry my poor english.

I build in the past a home water pupmp control with an ardunio board. The schematics is:

Well → Pump → 300l buffer tank → pump → house.

My well is a bit lazy. The water refill is slow. So i pump out the water to buffer, and the house get water from buffer. The ardunio measure the water in the well, and does not allow too low water level. If the water level reach the maximum, the well pump working until the allowed minimum level. In the buffer has a sensor. If the buffer reach the maximum level, prevent the well pump to start. It’s working. i tought, i’m migrate the ardunio’s program to ESP, and somehow i get information about the water levels, pump control from ESP to the HA. The program is working on an ESP32 (nodemcu v3) i wrote the program in Ardunio IDE.

Where can i find a path to solve this?
Has a mode to transfer a program from ardunio IDE to esphome and send to esp32?

What is the best method to got the information? A web server? MQTT?

Thanks the advices!

ABT

No you can’t transfer a program direct to esphome. You have to write it in yaml.

The best way to get info to and from the esp <–> ha is to use the esphome api.

Hi!

Thanks the suggestion, but how convert a working program to yaml?

The program is “easy”

If D1 HIGH && D2 HIGH && D5 LOW && D7 LOW pull D6 HIGH after 120 secs.

Watch the D1 == LOW && D2 == LOW && D7 == HIGH || D5 == HIGH with fast speed (if it is slow, the water go lower than non-return valve and the well is stop, the pump is fast) and pull D7 LOW.

So I can write this in yaml?

Thank You!

ABT

Have you read the esphome docs, including the example code?