Xperia SP looks like it's charging, but it doesn't charge
I had a similar problem a few years ago with my old HTC EVO 3D which was also running cyanogenmod at this time. I tried flashing different roms and kernels but the problem was persistent. Because my battery was empty as yours is at the moment, I charged it by cutting a USB Cable and applying "+" and "-" to the battery directly. It looked really bad to be honest but it worked and I was able to go back to stock. But that didn't help. The point is - I could make sure that the battery is not defective because I was able to charge it. In the end the problem was the usb port of my phone which had to be replaced. It worked but to make sure my phone does not turn into a torch I also replaced the battery. 

What you describe could be the usb charging port - there might be a faulty contact which prevents the battery from charging but this is just guessing. Bottomline: Try to charge your phone by a usb cable (please be very careful while doing this) or visit a service center.