My question is can I use this TYPE of component to achieve that?
Depending on the range, you might, or might not, be able to.
and what is the simple idea for writing its code?
Use the RadioHead library. It does all the work.
I wrote a code to
There is a lot of that code that is commented out. Delete commented out code before posting, unless it is the commented out code that you have questions about.
I'm not sure if it has to do with the values in between.
You can't write code until you know what you want the code to do. It seems to me that you'd want to start the pump when the level dropped to 25% (that is when percentage <= 25) and stop the pump when the level got to 95% (that is when percentage >= 95). When percentage is between 25 and 95, there is nothing to do. Just enjoy the sound of the pump running (or the look of the pretty light that pretends to be the pump).