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

Request: Energy usage _from date_ #784

Closed
BuildTheRobots opened this issue Apr 11, 2018 · 3 comments
Closed

Request: Energy usage _from date_ #784

BuildTheRobots opened this issue Apr 11, 2018 · 3 comments

Comments

@BuildTheRobots
Copy link
Contributor

Request: Report date and time when energy consumption was last reset (eg "Energy #0 [40kwh]
HLW8012 @ GPIO(5,14,13), since 20180411-1052")

Having a count of energy consumed is extremely useful, especially now #671 gives us the ability to reset it. However not knowing the time period this applies to makes the data less useful (the difference between that 40kwh being used over the last day, week or month is massive).

Having the unit record when the usage was manually reset would be great; even better if it could notice first boot as well (energy gets reset after firmware update).

Greatest of thanks :)

@BuildTheRobots BuildTheRobots changed the title Request: Energy Usage _from date_ Request: Energy usage _from date_ Apr 11, 2018
@xoseperez xoseperez added this to the 1.13.0 milestone Apr 12, 2018
@xoseperez xoseperez modified the milestones: 1.13.0, 1.12.6 Apr 12, 2018
@xoseperez
Copy link
Owner

Staged for release. Closing.

@BuildTheRobots
Copy link
Contributor Author

BuildTheRobots commented Jan 18, 2020

After extensive testing, it seems that it's possible for the Energy usage counter on the status page to roll-over (reset to 0) without the date/time of last reset updating.

I'm not entirely sure what the limit it, when it last rolled over, or even how many times it rolled over since the date (this is my hot water tank so might burn 7kWh/day.

I'll test on more recent firmware and create a new ticket if necessary.

Unrelated, but I'm thrilled by how stable the firmware is - it's last reset is October 2018, it's been stable without any intervention since then :)

@mcspr
Copy link
Collaborator

mcspr commented Jan 31, 2020

Just to clarify, timestamp should be from last report (after ~N readings, depending on the setting. webui only loads it once, it is never dynamically updated). Status page shows the latest reading, so values there are the most up-to-date.

What is interesting is that specific limit per HLW library is 232 since unsigned long is return type of it's getEnergy():
https://github.com/xoseperez/hlw8012/blob/2dace562c339e77a2889446d461e8e56048fe634/src/HLW8012.cpp#L134
Other sensor stuff uses double as a container, so bit limit goes to 51 (if I still remember how floating-point works).
No overflow checks are in place for that, so it kind-of fills up until it doesn't anymore.

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

3 participants