-
Notifications
You must be signed in to change notification settings - Fork 57
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
zn/#2301 fix charging power plots #2302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if you addressed my comment, but I assume you've run this past others and your own records more accurate - so approving.
val energyInJoules = refuelSessionEvent.energyInJoules | ||
val sessionDuration = refuelSessionEvent.sessionDuration | ||
val currentEventAverageLoad = if (sessionDuration != 0) energyInJoules / sessionDuration / 1000 else 0 | ||
val energyInkWh = refuelSessionEvent.energyInJoules / 3.6e6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't session duration need to be factored because we want the average...or do we want the total energy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to get another set of eyes here. @colinsheppard or @wrashid maybe?
I think that session duration is being factored in implicitly because the time bins have fixed length. So if we count the number of kWh (energy) during a time bin and then divide by the bin duration (1 hr, so not explicitly done here) we get the average rate of power consumption, in kW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, but isn't session duration often less than the hour bin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right--let's say we have a 30 minute charging session that delivers 10 kWh. If that's the only session, the charger was delivering 20 kW for 30 minutes and 0 kW for 30 minutes, so it had an average load of 10 kW for the hour. I guess this isn't the only reasonable definition for average charging power, but I think this one will end up being the most useful.
The average load during an hour in kW should be the sum of the energy delivered (in kWh) of all charging events during that hour. This still doesn't handle charging sessions that span multiple hour bins, but that effect shouldn't be too big with fast chargers.
Fixes #2301
This change is