If you only need the current battery percent and perhaps the state of ACLine you can use dzHW.library or the systemstate library.
If you additionally need voltage, current power consumption etc. there is no (currently released
) library which expands this info.
Some time ago I have written such a library for playing around with. It only works on the device (with Dummy for desktop). If you really need the info I can release this library but currently I have no time to write a help file but usage is really simple.