Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet

Okay, understood. Can you provide a schematic of the wiring and connection arrangements? That will help diagnose the problem.

Long lines (I don't know how long your signal line is) can introduce capacitance effects and may be subject to external RF that can affect the signal. We may need to look at how to isolate that. I am using multiple signals into a weather station and these are up to 15 metres in length, but have no interference or irregular readings, so we can fix this. On long lines I tend to use strong pullup or pulldown resistors (4k7) rather than weak ones (10k, 100k). I also in some cases use a latch or buffer to stabilise and reconstruct the signal before delivering it to the microcontroller inputs. Happy to share all that design stuff, but let's isolate the problem you're having.

A schematic will help me understand.