Max power measurement over a long period

I’m going to be adding another circuit to my home breaker box for an EV charger. I think I may not be able to do this with the normal NEC calc, but they have a method using existing loads (220.87).

  • I need maximum demand over a 1 year period. By the time I get around to doing this I’ll have a years worth of data.
  • the highest average kW reached and maintained for a 15 minute interval over a 30 day period.
    How can I extract this? It looks like using the graph interface would be cumbersome since the data sample period is greater than 15 min when the sample range is stretched out. It could be done this way, but would take a lot of mouse clicks.
    Can it be done with the Query API? Should I limit the size of the query? If so what is a reasonable number of data items, or time period?

I would setup Influxdb and export your data there. Once there, you can do complex queries that should get you the data you seek.

My normal daily peak is about 45A, and over the last 6 months it was about 69A. Those are generally for only 2-3min, since both pumps have to be running at the same time. The 6 month query takes 30-40s of compute time on an i7 (mobile running at 2GHz or so). Getting 6 months of stored data from IotaWatt to influxdb takes several days.

Use the latest InfluxDB (1.8 version, not 2.0) and latest Grafana (to allow using Flux query language).

This is one of those one-off things that is easier to just grunt through. Turns out it’s pretty easy.

You need to look at the 15 minute averages over 30 days. That’s 4 x 24 x 30 data points = 2,880. You can use query to extract that in about 8 seconds. You can just type this url into your browser:


It will prompt to open or save, I saved it, opened it with a spreadsheet and entered a max() function for the average Watts column:


So my maximum Watts over a 15 minute period for the last 30 days was 9,700. Sorting descending I get the top ten:

You will need to be on release 02_05_12 to be able to set a high enough output line limit.p


Can a query interfere with iotawatt’s normal operations?

Yes, it does not sample while doing a query, so keep it short. 8 seconds Is not a problem.

I understand this query gives you the quarterly average power (W), but how can I get the quarterly total consumption (Wh)?

Did anyone already requested this new feature in Graph+: “Please add ‘15min’ as standard group selection on Graph+, just above ‘Hourly’”. In Europe all smart meter calculations are based on quarterly consumption (total Wh in 15min) & peak power (average W in 15min) values, so this would be a very needed/wanted feature! Thanks in advance!

I found a workaround by running the query to generate average quarterly power and in the downloaded xls calculating an extra column by dividing this value by 4, this gives the consumed or produced energy in kWh per quarter, but it would be nice to have it as an export feature nevertheless!


Time, total_power
2021-09-21T00:00:00, 131.01
2021-09-21T00:15:00, 92.63
2021-09-21T00:30:00, 92.16
2021-09-21T00:45:00, 105.69
2021-09-21T01:00:00, 88.33
2021-09-21T01:15:00, 119.21
2021-09-21T01:30:00, 168.01
2021-09-21T01:45:00, 120.54
2021-09-21T02:00:00, 107.85
2021-09-21T02:15:00, 113.67
2021-09-21T02:30:00, 120.38
2021-09-21T02:45:00, 93.6
2021-09-21T03:00:00, 106.15
2021-09-21T03:15:00, 98.22
2021-09-21T03:30:00, 82.52
2021-09-21T03:45:00, 127.63
2021-09-21T04:00:00, 115.52
2021-09-21T04:15:00, 81.92
2021-09-21T04:30:00, 106.48
2021-09-21T04:45:00, 85.35
2021-09-21T05:00:00, 108.08
2021-09-21T05:15:00, 126.77
2021-09-21T05:30:00, 89.15

1 Like

What does the d2 mean? Is there somewhere a description of the syntax possibilities/parameters for this ‘query’ feature?

Why do you add ‘all’? Doesn’t it conflict the group=15m?

That’s a typo, should only be the group=15

1 Like