EDIT: The only issue you may have is - in your Arduibno code, if the filter is at the low sensor, which would normally turn on the pump, this will be overridden by the tank being full. That’s because the order matters in the code you wrote. This is not how ESPhome works - all the triggers are asynchronous. So you need to put a condition on the low sensor:
In your Arduini code you are continually testing your sensors, waiting for some conditions. So eventually you will get to a point where the low level sensor is read as LOW but so is your tank sensor.
The pump will then start.
ESPHome doesn’t work that way, it’s not looping around looking at states. The triggers only work the once, so you pump will never turn on again.
ah there we go! working as i want now thank you. my dad was the goto guy for this kinda stuff, but he passed away a few years ago, soo ive been trying to learn all this now
they aren’t water proof and they can’t be covered so even if you have a gap between it and high water level, it will eventually fail. They are cheap so this probably won’t be an issue. Maybe use two if reading is critical.
they are a 5V device, ESP pins are 3.3V max. I believe a 1K resistor on the signal line will suffice, but if unsure use a level shifter. You will need to power it using VIN pin on the ESP, assuming you are powering via USB and not directly from 3.3V.
You have a switch named switch.water_pump from the gpio entity. This switch will be able to turn on/off the pump as long as the water level is between the two sensors.