jertel / vuegraf

Populate metrics from your Emporia Vue energy monitoring devices into an InfluxDB
MIT License
167 stars 55 forks source link

Ingesting Historical Data #88

Closed MichaelMedford closed 2 years ago

MichaelMedford commented 2 years ago

This PR adds support for ingesting historical one-minute data into InfluxDB the first time that Vuegraf is run. A new parameter is added to the configuration, historyDays, to support this feature. Emporia currently retains one-minute data for 7 days, and therefore historyDays must be less than or equal to 7. If historyDays is set to 0, no historical data will be ingested into InfluxDB.

If this PR is accepted, I would be happy to create another PR for ingestion of historical one-hour data. Emporia currently retains one-hour data for the lifetime of the device.

MichaelMedford commented 2 years ago

@jertel After addressing your comments, I have added in some additional code to (1) pause between day calls to the API to avoid errors from Emporia and (2) correctly catch keyboard interrupts within the loop.