Comments (7)
There is no loader and what you ask is not an included functionality. You may try using the “private” _addEntry function instead of the “public” addEntry, this would bypass timers and averages, but I cannot guarantee that it would work with no issue.
from fakegato-history.
Did you have a look at the persist files that fakagato-storage creates? I image it would be relatively easy to write a small programme that converts your log file to the proper json, so fakegato storage can simply load it on startup.
from fakegato-history.
from fakegato-history.
Just to let you know I've used the private _addEntry() method and it worked beautifully,
For reference, this.historicalmeasurements
is a 2D array formatted as such:
[
[timestamp]
[particular matter density]
[temperature]
[humidity]
[co2 in ppm]
[voc]
[all pollution as a %]
]
Each value at a particular position in the 2D array directly correlates to the other values at that same position, for example: this.historicalmeasurements[0][123]
and this.historicalmeasurements[3][123]
were measured at the same time. So when I iterate over the array passing the loop number, I know that all characteristics correlate:
//Load historicals from API into Elgato
for (var i = 0; i < this.historicalmeasurements[0].length; i++){
this.loggingService._addEntry({
time: this.historicalmeasurements[0][i],
temp: this.historicalmeasurements[2][i],
humidity: this.historicalmeasurements[3][i],
ppm: this.historicalmeasurements[4][i]
});
}
Just going to add some safety barriers around it so it only adds to the history once before I commit it to my plugin, current working version can be seen here: mylesagray/homebridge-blueair@811421e
https://dl.dropboxusercontent.com/s/kvge7vu3hsf40ss/Photo%2007-03-2018%2C%2000%2045%2003.png?dl=0
from fakegato-history.
Trying to refine this a bit, I have reverted to using the public addEntry()
method and just setting disableTimer:true
in the setup.
It downloads all values and pushes them in fine - but there seems to be a strange behaviour when it saves to the persistence file - like there are many, many processes all editing the same file at once.
Does the public (or even private) addEntry()
method not wait until the file has been successfully written to before returning?
It seems like what is happening upon the initial ingestion of data that the file is written fully, but then there are n
number of save processes queued, one for each addEntry
call and these all need to execute before it pushes the history to the Eve app?
This behaviour would probably also occur even if a few entries were pushed to addEntry
in quick succession.
from fakegato-history.
Are you pushing data with addEntry with a short delay? All the persistence stuff was designed assuming a rate of al least few seconds. I cannot exclude some glitch if the rate is much faster. However @NorthernMan54 is working on an event based persistence that I hope should fix all this race related issues.
from fakegato-history.
@simont77 No delay at all, just dumping the data in as fast as the loop executes. Event based persistence would be awesome, glad to hear there is something in the works for this, backfilling histories would be cool for a few plugins i'm using but at the moment I can't work around the problems without editing fakegato-history itself.
from fakegato-history.
Related Issues (20)
- Question about gaps in history HOT 7
- Eve Room 2 HOT 9
- PPM characteristic not shown in EVE app HOT 1
- LUX Support HOT 7
- Limit reporting to a single service HOT 2
- S2W1 / S2W2 HOT 1
- Light Effect Characteristic? HOT 1
- Eve Thermo (2020) Thread firmware new services/characteristics HOT 3
- Eve MotionBlinds <- Some initial work
- Eve Smoke - Anyone have one to help? HOT 3
- Can't see history graph or measurements on Eve app HOT 10
- AirQuality Data not showing up in Eve app
- Deprecation of Google Drive OAuth out-of-band authentication HOT 6
- Eve Lightstrip
- Eve Aqua
- Historical view of lightbulb accessory is working? HOT 2
- Feature Request: Eve Weather now support history for Light Level HOT 3
- On / Off Topic, even more Fake
- No more history data after crash HOT 3
- automatical deletion of persistence history file
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 fakegato-history.