Comments (6)
Data aggregation stuff is locate here: https://github.com/ioBroker/ioBroker.history/blob/master/lib/aggregate.js#L65 and "post pocessing" in https://github.com/ioBroker/ioBroker.history/blob/master/lib/aggregate.js#L117
For this all logic should be done as post-processing I think
from iobroker.history.
Basic implementation maybe using https://www.npmjs.com/package/math-tools
from iobroker.history.
When integrating, that module seems to expect a function which has to be defined for all x-values (or time points) in the interval to integrate. We don't have that because we only have single data points. But we basically only need this simple formula:
// at the start of the interval:
integral = 0
// for each data point
integral += 0.5 * (current_value + prev_value) * (current_timestamp - prev_timestamp)
And the sum doesn't have to be recalculated each time if we somehow store the aggregated value. Then we only need to add the last part whenever a new data point arrives.
from iobroker.history.
What Time.base we should use? h or min r sec or ms ? :-) Data-Timestamps has ms, so it would result in "Wms" :-)
from iobroker.history.
What Time.base we should use? h or min r sec or ms ? :-) Data-Timestamps has ms, so it would result in "Wms" :-)
As dumb as that sounds for energy consumption, I would use ms to have maximum flexibility. Maybe we can add a scaling factor, which would be 1/3600000 to turn Wms into Wh. Or make the time base configurable?
from iobroker.history.
Please check out 2.0.0 https://forum.iobroker.net/topic/54197/test-adapter-history-2-0-0
from iobroker.history.
Related Issues (20)
- Update stable version in repo from 2.2.0 to 2.2.4
- History-Daten in SQL oder InfluxDB übernehmen Funktioniert nicht HOT 1
- Backupit Dateien wiederherstellen klappt nicht HOT 18
- Massive Prozessorbelastung durch History HOT 13
- Blockzeit wird ignoriert HOT 3
- Blockzeit wird ignoriert (Fortsetzung) HOT 1
- API liefert Rohdaten nicht HOT 9
- Werte werden nach Neustart des NAS (IoBroker) erneut gespeichert HOT 1
- history2db.js broken after js-controller update to 5.0.5
- Adapter flutet nach Update den Log mit Fehlern HOT 6
- Der Adapter möchte in node_modules ein Verzeichnis anlegen HOT 3
- Please fix issues reported by adapter checker
- Update stable version in repo from 2.2.6 to 3.0.0 HOT 1
- Datenübername von history nach influxdb funktioniert nicht HOT 3
- Null Values are written despite option says not to do so HOT 3
- Datenübername von history nach influxdb funktioniert nicht HOT 3
- Save as CSV in History Data only exports ~2000 entries HOT 1
- sendto(getHistory) not returning the oldest value HOT 2
- Javascript Options
- Please consider fixing issues detected by repository checker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iobroker.history.