Sum total and total_increasing energy from different sensors

Hi Everyone,

I hope this post is not a duplicate of some other but I was not able to find anything clearly related to my issue.

I have some devices that report to Home Assistant the power consumption:
Two of them natively report the consumption in kWh, the other two in kW and I have implemented the integral integration to transform it to kWh.
At the moment I can correctly see all of them as single devices in my Energy Dashboard.
The two devices that report the data in kWh have the state_class “total_increasing” while the two that uses the integral integration have the state_class “total”

My idea is to sum all of this sensors to have a total usage (of course not every device in my home have a sensor but it’s fine for now)

I know of the utility meter but I’m not really sure how it works and how to account for the difference of the state_class

Could someone please help me understand the difference and how to proceed?

Thanks a lot,
Gianluca