Historic integrators

Hi All,

I have had my iotawatt in place for about 3 years now. And it was pumping everything into influx. However, that server died and i lost all my data, so i need to re-ingest it. Not a big deal.

However, i have (as of tonight) discovered integrators and outputs, and they solve a HUGE issue i had in relation to my battery system pos / neg and my main meter pos / neg and how they only showed the net position.

After reading through the documentation, I see that it does the last 24 hours of them, and i can see that on my status page, however is it possible to have it go back and calculate this for the entire database that is in the iotawatt? as this would be great.

If not, i assume i can create this into influx with a formula (im not sure what this would be though).

But, ideally if it can calculate the data for all my historical info, that would be best.

Can it do that?



There are several different concepts at play here, let me try to unpack it.

The uploaders only work on current log data, so you will only be able to upload a year’s worth of history. As an aside, that will take a long time. Best to not try to run any other uploaders except maybe PVoutput while that is uploading history.

Yes, an integrator will allow you to separate the charge and discharge flow to/from the batteries as long as it’s via an AC circuit.

The firmware is fixed to initialize an integrator to the prior 24 hour period. The firmware is capable of building an integration from any date within the scope of the current log, but there is no way to instruct it to do so. The reason is that integrators, like history uploads, really dim the lights and can take a long time as they work their way through potentially millions of current log entries. There are more than 500,000 entries per month. Once current, they are trivial to maintain, but they can take hours, days or even a week or more to process a lot of history. You wouldn’t want to have an uploader doing a long history upload at the same time. It would potentially cause the IoTaWatt to reboot frequently.

All that said, although I’ve never tried it, I believe there is a simple hack to get an integrator to go back to near the start of your current log.

Yes, you should be able to do that with influx. A continuous query would be the way to go I think.

I’m pretty busy right now, but I’ll post the details of the hack in a few days so you can try it out.

Im not to concerned with how long it takes to upload… its been over a year without influx at this stage… even if it takes weeks, im not fussed. as long as it gets there :slight_smile:

Yes i had this issue in the past where I was posting too much to influx, and it had a negative impact on the iotawatt.

If there is a way around the past 24 hour limitation, im happy with that. It can just sit there crunching away until its complete.

Yes, i have tried this in influx, and i can see that the query is there, but there are no extra metrics in the database. I admit, i dont know much about continuous queries, and have tried to work them out, but i just cant crack it.


To be clear, i want there to be NO down sampling, im just taking examples from the internet, and adapting them as needed. But with the above, i would expect there to be a new entry in the IotaWatt database, but alas there is not. I have the storage and the processing power for it, so would rather the infinite resolution :slight_smile:

Sir, that would be great. or, even some assistance with the continuous queries to achieve what i want, as most of it can be calculated if i just output the voltage and the amps from the iotawatt.

Im open to either tbh. I just want an easy way to have the metrics created in influx, and i can then create a new one of some sort if needed. Like if i add another PV system, i can just modify it so that it indexes the total power from all 3 combined into a single metric.



Hey there @overeasy just a friendly follow up to see if you had any suggestions for what I’m wanting to achieve?

Cheers mate.

I looked into hacking the integrator to create a historical integration. There are underlying problems. Long story short it crashes the unit.

Given that you need to upload the old data to influx anyway, I would recommend that you upload the negative values as:

import = Wh Main max 0

and the positive as:

export = Wh Main min 0 (or if you want it as a positive number Main min 0 abs)

You can then report sums and averages directly from influx. If you want to be able to see as power (Watts), then upload it as Watts and use the influx integral function when you want Wh. Or upload both Watts and Wh to avoid using integral.