I’ve noticed that those self-flushing public toilets always seem to have a small red plastic window near the valve. I assume this is an infra-red motion sensor. But I wonder where the power comes for this and for the actuator that initiates the flush when you move away. My guess is that there is a small battery involved but I wouldn’t expect a small battery to last very long. If this did use a battery I would expect to see a small door that would probably require a key to open but I don’t recall seeing one. I can’t image that you’d need to dismantle the whole valve assembly to replace a battery. I suppose it might be possible to run a wire to supply electricity for this through the water line but the installation could be very difficult.
Is there a Doper out there who actually works with these things that could answer my question?