Skip to content

Total time calculation seems to be incorrect #9

@wlupton

Description

@wlupton

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions