How can I build an (automatic) Mindstorms charging-station?
As a software engineer, you would probably be more at home in NXC, a C-like language compatible with the standard firmware. You can then use BatteryLevel().

If you want to use the standard programming environment, use this custom block.