Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle energyConsumedToDate counters that decrease #54

Open
cammoore opened this issue Jul 13, 2013 · 0 comments
Open

Handle energyConsumedToDate counters that decrease #54

cammoore opened this issue Jul 13, 2013 · 0 comments

Comments

@cammoore
Copy link
Member

Reported by rbrewer, Sep 15, 2012
When retrieving data from an eGauge meter, it is possible to have an energy odometer value that is positive but decreasing. This violates WattDepot's assumption that odometers increase monotonically, and prevents all energy calculations from succeeding.

To handle this unusual case, the eGauge sensor could have a configuration parameter that causes the received meter data to be modified before storing in WattDepot. The sensor would retrieve the latest SensorData from WattDepot, extract the (positive) energyConsumedToDate value to use as a starting point. Then the odometer value from the meter would be subtracted from the starting point to determine how much energy has been used since the last sample, and that difference would be added to the starting point and stored as energyConsumedToDate in a new SensorData to be sent to the WattDepot server. This will preserve the monotenacity of the energyConsumedToDate counter, but will mean that the energyConsumedToDate will not match the actual odometer value from the meter, which is something that we have tried to preserve in the past. The sensor will need to remember the last energyConsumedToDate value to difference with each new incoming value.

Note that when the Source has no SensorData (first meter data), the starting odometer value can be whatever the meter value is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant