jertel / vuegraf

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

Introduce timezone, detailedDataSecondsEnabled and detailedDataHoursEnabled #146

Closed cdolghier closed 8 months ago

cdolghier commented 8 months ago

This MR:

introduces detailedDataSecondsEnabled and detailedDataHoursEnabled

These are configuration options to selectively disable either hourly or per-second data collection. The reasoning is that collecting per-second data is expensive for both Emporia servers and the user (storage-wise and CPU-wise for underpowered shared servers). I run the script on an underpowered Intel Atom J4125 and the once-hourly fetch of 3600 datapoints per channel is a 10second x 50% CPU for data I don't need.

introduces timezone

This is a configuration knob to configure the timezone for the calculation of "end of day". Although it is strictly speaking not necessary, as the same end effect can be achieved via configuring the host system and/or Docker container, the preexisting way of doing things has certain disadvantages:

IMO it's just cleaner to make the account timezone a native functionality of the script.

updates the documentation

Easy-peasy update to README and json.sample files to reflect the above.

Add some whitespace around = in preexisting code to make it consistent with surroundings.

jertel commented 8 months ago

Very nice contribution here, thanks for continuing to improve this project. Please add the new features to the CHANGELOG.md and follow the pattern I started in the 1.6.1 release. You can add them to the TBD section since the next version number hasn't been selected yet.