innoTUgrid / backend

backend services for a microgrid data API
0 stars 0 forks source link

Total CO2 Emissions inconsistent values #66

Closed Tobiasloch closed 6 months ago

Tobiasloch commented 6 months ago

when calling http://localhost:3000/v1/kpi/scope_two_emissions/?from=1970-01-01T00:00:00.000Z&to=2024-12-31T23:59:59.999Z&interval=1year&source=IPCC and http://localhost:3000/v1/kpi/scope_one_emissions/?from=1970-01-01T00:00:00.000Z&to=2024-12-31T23:59:59.999Z&interval=1year&source=IPCC and then summing up all the emissions for 2020 we get a value of 3.624.021 kg. While when calling http://localhost:3000/v1/kpi/total_co2_emissions/?from=2019-12-31T23:00:00.000Z&to=2020-12-31T22:59:59.999Z&interval=1month we get a value of 2.515.949,11 kg. Both values should be equal or have only a small error.

OleFass commented 6 months ago

The issue has been hotfixed by capping the timestamp distance that is used to calculate kWh from kw to 0.25. The reason for the behaviour is that there is a gap of 3 month in the data.