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

Total time calculation seems to be incorrect #9

Open
wlupton opened this issue Jul 24, 2022 · 2 comments
Open

Total time calculation seems to be incorrect #9

wlupton opened this issue Jul 24, 2022 · 2 comments

Comments

@wlupton
Copy link

wlupton commented Jul 24, 2022

I just noticed (after receiving the energy usage email reports for many weeks!) that the total time calculation seems to be incorrect. It looks like it uses six days (the number of days between the first and last) rather than seven days (the number of days in the week).

For example, this is from my latest email. Given a total usage of 70.8 kWh I'd expect 70.8 / 7 = 10.1 per day, not 11.8!

Total Use: 70.8 kWh
11.8 kWh per day

I think that that the following two lines are incorrect. I'm not sure what the cleanest fix is (I'll leave that to you unless you'd like a suggestion). Thanks!

$totaltime = ($data[6][0] - $data[0][0])*0.001;

$totaltime = ($use_data[6][0] - $use_data[0][0])*0.001;

@wlupton
Copy link
Author

wlupton commented Jul 24, 2022

Ah, it looks like this was changed relatively recently, in 458987b. Perhaps the fix is just reverting 6 to 7?

Update: Well, no that won't work. I'm guessing that the earlier 7 to 6 change resulted from having reduced the number of days of data from 8 to 7. So perhaps the fix is to set the total time to be the period over which the data was collected (a week)?

@wlupton
Copy link
Author

wlupton commented Aug 6, 2022

@TrystanLea any thoughts about this? Thanks

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

No branches or pull requests

1 participant