werthdavid / homebridge-weather

OpenWeatherMap Plugin for Homebridge
MIT License
104 stars 7 forks source link

Enhancement: Add history to weather sensors #13

Closed honkmaster closed 6 years ago

honkmaster commented 6 years ago

Using fakegato-history, you can simply add a history functionality to your sensors. The history, then will be available in the Elgato Eve App. I first seen this feature in homebridge-dht, and really like it.

See: https://github.com/simont77/fakegato-history

werthdavid commented 6 years ago

I can try to include it but won't be able to test it

honkmaster commented 6 years ago

Would be really appreciated. I will test it surely, additionally I'm looking into node.JS myself. Next time I will submit a PR :).... Greetings.

werthdavid commented 6 years ago

Can you try it with the latest version (1.6.0) and let me know if it works?

honkmaster commented 6 years ago

It does not seem to work. I used:

"pollingInterval": "1",
"enableHistory": true

Maybe there is an error in line 186. I don't know if temperature: temperature is valid, as the sample uses temp:, see:

this.loggingService.addEntry({time: moment().unix(), temp:this.temperature, pressure:this.airPressure, humidity:this.humidity});

Maybe you can compare with homebridge-dht: https://github.com/NorthernMan54/homebridge-dht/blob/master/index.js. This is working in Eve.

werthdavid commented 6 years ago

Good point... maybe now?

honkmaster commented 6 years ago

It is working. Thanks. One minor issue, the first value for temp is zero degrees.

img_7989

honkmaster commented 6 years ago

Same is true after a restart of homebridge (for both tamp and humidity). Maybe only report valid data from cache.

img_7990

werthdavid commented 6 years ago

Should be fixed with 1.6.2

Cool feature actually!

werthdavid commented 6 years ago

@honkmaster could you please test if it still works with 1.6.3? Don't know how homebridge behaves with potential undefined values...

honkmaster commented 6 years ago

There is no initial jump in the graph, seems to work. If you want, i can provide a screenshot after logging has taken place for a few days ...

werthdavid commented 6 years ago

Yes please, that would be cool! Thanks

werthdavid commented 6 years ago

eve-example

Got one :wink: But thanks! Really cool feature!