Depending on the device brand and type and the Homey App you use (or not). I think for Shelly this ([APP] Shelly - Smart solutions for every home and office) is the starting point to first get the device correct.
After that you have to remove the incorrect historucal data in Energy.