Neo coolcam wall plug- KWH price per month

good afternoon… I needed some help to create a sensor through my neo coolcam wall plug. Create a sensor where I would see the value in euros of the accumulated cost of the month.
throughout the end of the month, the value of euros is reset and starts again from the beginning

current_power_w: 596.48
current_energy_kwh: -214748.3648
Vera Device Id: 408

KWH value: €0,175

The reading value of khw has a problem. The neo coolcam wall plug sometimes registers negative values and my sensor would have to remove these values in order not to influence the accounts…

If anyone can help me I would appreciate it a lot

someone can help me?

Does the power sensor (Watt) also show the negative values?
If no, you could use a Riemann sum integral to get a clean kWh value:

and with that, you can use an utility meter (mounthly) to get you monthly costs

the value in watts does not appear in negative