Quantcast
Viewing all articles
Browse latest Browse all 199

InfluxDB - energy [kWh] calculation from power [W]

Hi All,

Noob at this end, at least feel like.

Background issue is - have accurate energy consumption graphs.
Source data comes from Tasmota, via MQTT, Telegraph, InfluxDB and visualized with Grafana.

Tasmota reports following data (on top of others, though energy related):

  • Today - in Wh, consumed today so far,
  • Yesterday - in Wh, total yesterday (last value of today, reset at midnight),
  • Power - in W, power consumption at the time,
  • Period - Wh consumed since last measurement.

The first two are simple - just simple values, can be graphed, etc.
The Period one, when accumulated over the day, should result in total Wh consumed over the day.

Seems easy, so far.

Tasmota, is set up to report:

  • on every power consumption change bigger than 5W
  • 5 minutes

InfluxDB therefore has multiple values, not necessarily at the same time, i.e. at the top of an hour and every 5 or ten minutes.
Using “Group by” and having interval set i.e. to 10 mins, should give us roughly around accurate “measurements” at the time/close to.

Big question is - how to have calculate accurate Wh consumption so far and over the day out of “Power” - is it possible at all? Maybe Tasmota needs to be changed to report only every 5 minutes? Feeling is that it should be possible to workaround the fact that Tasmota reports at various moments and normalize to interval values.

The value produced should be relatively close to Today/Yesterday values for given days.

Same and even more important is that summing all Period values, doesn’t give us on the graph what pops up as Today or then is recorded as yesterday value.

Question is how? I’ve spent number of hours on this and started to run in circles now, feeling like around the target which did hide in front of me.

Thanks in advance!

10 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 199

Trending Articles