Float or water sensor for Rain Barrel

I would like to monitor the water level of my rain barrel. What I would like to do is set a schedule to run a pump that I have, but ONLY if there is water in the barrel obviously. So when the water level gets to a low level the pump turns off. I was thinking of a water sensor that is on a wire, and then when the sensor reads DRY, I will make a rule that will stop the pump?

has anyone tried this, or is there some kind of Z-Wave/Zigbee float level sensor?

TIA

You might be better off getting a regular float sensor and then wiring it into a contact sensor that has dry contacts.

I think the general recommendation has been https://www.amazon.com/Z-Wave-Magnets-Window-Sensor-DWZWAVE2-5-ECO/dp/B01N5HB4U5/ref=mp_s_a_1_5?dchild=1&keywords=zigbee+contact+sensor&qid=1591926383&sprefix=zigbee+contact&sr=8-5

I agree with @Hasty1. I have a HomeSeer water detector with a remote "wire". If this was used directly and was under water a high percentage of the time I would be worried about false "water present" indications due to water and possibly growth on the sensor end.

I guess you could make your own wire ends.

Look up Neptune Systems Apex. Use a break out box, EB4 outlet to control the pump and a high and low float switch that you can mount in a barrel with a magnet mount or modify something for the barrel. Then add the Apex driver in the forum to bring it into Hubitat to get reporting. Keep the rules for turning the outlet for the pump on and off based on the position of the pump in the apex itself.