Brain dump for DeviceKit-power:
DeviceKit-power is a little service that takes data from the kernel, and processes it so that it's easy to consume. Known consumers are gnome-power-manager and the XFCE battery widget.
DeviceKit-power gets all the data from the kernel over the dbus service DeviceKit.
You should get changed events from "devkit --monitor" when you do things like remove or insert the AC adaptor. Similarly, DeviceKit-power should emit signals when this happens.
This can be observed doing "devkit-power --monitor".
If you don't get changed signals in DeviceKit or DeviceKit-power then it's probably a kernel bug. This is known for some Sony laptops, and needs to be fixed in the kernel.
You should check you get the changed signals, and that the output of "devkit-power -d" changes to the correct values. The status of the battery typically goes from charging->unknown->discharging as the embedded controller takes a while to settle down and give valid readings.
Using gnome-power-statistics you can obserbe the values in more detail. Make sure the percentages are all 0..100 and the value look sensible (for instance, Voltage is 0..20V, not 340034V). If this is the case please open a bug and dump the output of /sys/class/power_supply/*/*. If the values in /sys are wrong, then it's not a DeviceKit-power bug, it's a kernel bug or hardware fault.
For the wakeups, ensure "devkit-power --wakeups" produces userspace and kernel wakeups, and that these are sensible. The first time you run this command, you'll probably get no data, but just try again in a few seconds, and you should have some values. We don't poll by default all the time, as this itself would use power.
For the tools, try and crash the devkit-power tool. Give it invalid input, and see how it copes. Try also crashing the daemon using d-feet to execute methods, or using dbus-send on the command line. If it crashes it's an important bug, so be sure to file it in bugzilla.
If you need to run the daemon in verbose mode, do (as root):
killall devkit-power-daemon /usr/libexec/devkit-power-daemon --verbose
and then you can open another terminal and start to see the daemon output.