It’s petrol, So you always have to be concerned about both contamination and fire danger. I wouldn’t put anything inside the tank or the tube. And I wouldn’t put anything battery operated too close to the tank or the tube either, unless it was specifically designed for that purpose.
One option that some commercial set ups use, although you have to be very careful about fire safety when you set it up, is to have a separate tiny tank near the base of the tube and put that on a pressure plate (With all the electronics and power supply off at a distance) and then report When the tiny tank gets too light. So the petrol flow is split, most to the main line, but some to the tiny tank, and then you can tell when the tiny tank is running low.
But again, you have to consider fire safety at every step of the way and it may not meet safety code to do this unless you buy a unit specifically designed for this purpose.
If you use a commercial service to refill the tank the first thing I would do is contact them and ask if they have any suggestions. These days many do have various kinds of alert systems they recommend.