Mossop / glowmarkt-rs

A crate for accessing the Glowmarkt API
MIT License
2 stars 1 forks source link

Integrate carbonintensity-api to compute carbon emissions #6

Open jnioche opened 10 months ago

jnioche commented 10 months ago

I have released an initial version of the carbonintensity-api, a better version is coming soon.

@Mossop how do you think it should be done?

First get all the measurements and if the device is an electricity meter, send the measurements to a new function in the carbonintensity api which would

  1. retrieve the carbon intensity values for the period
  2. compute the emissions
  3. return (timestamp, emissions)

Alternatively, from your main.rs, you could retrieve the carbon intensities for the period and compute the emissions yourself.

Mossop commented 10 months ago

I guess my first question is, should it be integrated at all or should the carbon intensity CLI be something stand-alone? As you've seen there are other tools specific to the energy provider, it probably wouldn't make sense to integrate with all of them. On the other hand if your tool say were to output influx compatible data then influxDB can be used to combine it with the energy data that another tool is providing to give the relevant emissions.

jnioche commented 10 months ago

On the other hand if your tool say were to output influx compatible data then influxDB can be used to combine it with the energy data that another tool is providing to give the relevant emissions. do you mean that the computation of the emissions could be done by InfluxDB given two separate sources: the amount of energy used for a period on the one hand and the carbon intensity on the other?