But where you are using it, in an output script, has the limitations on accuracy that I tried to explain above. The script is applied to net intervals, which grow larger as you zoom out in time. As implemented in the post that I just referenced, the algorithm is used on every sample taken, providing maximum accuracy and not subject to the zoom out problem. That is the solution alluded to in
Yea, that’s a quirk of the way the calculator works. The simple workaround is, instead of using the unary minus operator, just add the binary minus operator, as in:
0 - ( Mains min 0 )
It produces the same result.
Right, you need to integrate the 5 second samples rather than add them, which is what you get inherently with the way the IoTaWatt datalog works. Integration is a much more resource intensive activity. There are 518,400 five-second datalog entries in a month. Asking the ESP8266 to read and integrate those entries, while dedicating 66% of it’s CPU time to sample your current usage, would take a very long time. That’s why I say you can export the data to a database that has the resources to do that, or use the method above to effectively save running import and export totals.
The “donate” page is github. This is an open project. It has grown into a full time job just keeping the hardware going out the door. Money isn’t going to help, folks need to contribute solutions.