I have made some significant changes to the driver. It now functions as follows:
- Power/Energy: cumulative sum of the next 24 hours (no change)
- Renamed all attributes for clarity and better downstream compatibility. For example, influxdb/grafana did not like to read attributes names that start with an integer. (breaking change, check your automations)
- Removed all high/low calculations as I believe this just added clutter and I wanted to simplify the user experience.
- Peak/Cumulative values are now bound midnight to midnight instead of rolling 24/48/72 hour period. This means the today values will decrease throughout the day.
@OttoMation you may be interested in incorporating this change. It uses.findAll()
to limit by date ranges, then.max()
and.sum()
to get the desired values. - Added a test mode like @OttoMation (great idea), but I use state variable to store json instead of current state (just a matter of personal preference).
- Updated cron schedule to pull 1 minute before the hour/half hour. This helps ensure getting most accurate data at each poll. You will need to save your preferences after updating for this to take effect.