Closed tobekas closed 6 years ago
Hi, at present this is not possible, and the current behavior was decided exactly to avoid gaps on the history. Actually @NebzHB implemented the timer section, and honestly now I cannot remember all the details, let’s see what he thinks
Thé problem is for the lazy temperature sensors that might not send data for something like an hour because the temperature didn't change above the threshold value, those will have gaps in history... so the current behaviour is more like a conservative way of thinking...
Okay, I see your point.
Nevertheless, it would be a great benefit to have an optional parameter (similar to disableTimer
) for disabling the filling entries. So every Homebridge plugin could decide to use or not to use this functionally.
In my particular case, one of my sensor batteries was empty for ~3 days, sensor state was set to inactive, but the Eve history graph recorded a constant outdoor temperature of 7.2°C (every 10min for 3 days...). This is not what I expected for a temperature sensor.
It would be great if you could implement this (hopefully small) adaptation.
A big thank you for your great work so far!!
At this moment I don’t have much time to devote to this. I will tag it as a feature request. Stay tuned
Hello, could you please test the disableRepeatLastData branch ? (see readme for usage)
Hi NebzHB, thank you a lot for the implementation.
I tested your modification but had no success so far.
I added the new option as follows:
let logSvc = new FakeGatoHistoryService('room', this, {storage:'fs', disableRepeatLastData:true});
I stopped calling addData
after a while, but the last average was still added every next 10min.
I will debug this in the next few days. Maybe it could also be my fault. I'll let you know...
I think i found the bug:
You have to replace if(!this.disableRepeatLastData)
by if(!fakegato.disableRepeatLastData)
.
The keyword this
in the callback refers to the service bundle object (subscribedServices
within "fakegato-timer.js") and disableRepeatLastData
is not a property of this bundle object. Its a property of this.service
. :-)
Best regards
Or mine... I'll investigate too
Oh yeah indeed
fixed, could you try again ?
Yeah, great. Now it's working as expected. Thanks a lot! It looks like a clean solution.
Just published v0.5.3. Thanks
Hi, I really like your lib and the timer handling. In my setup, sensor data are received via MQTT every ~50-70 seconds. I call your
addEntry
function every time when new data are received, so that a new history entry is generated every 10min from the average. This is working perfectly. Now, if one sensor suddenly stops sending data (going offline, battery low, ...) and consequently no entry is added within the next 10min-intervall (noaddEntry
call), I don’t want to have this „previous average extra entry“ generated. If the sensor is really off, gaps in the Eve app are absolutely ok.Is it possible to use your timer for averaging values over the timer interval, but without adding extra entries if no data were added?