Skip to content

Conversation

@swiffer
Copy link
Collaborator

@swiffer swiffer commented May 20, 2025

fixes #3659

driving downhill and recovering more energy than what is actually consumed leads to wrong data as queries have actively excluded these cases so far, mostly by wrapping the range_diff used for consumption calculation with greatest(range_diff, 0).

multiple dashboards have been touched, see before and after for two examples that show the improvements.

before - drives
grafik

after - drives
grafik

before - drive details
grafik

after - drive details
grafik

fixes #4717

the explanation in #4717 is perfect, this pr is addressing that by entirely changing the way total consumption gross is calculated. It's now reusing the query results of Ø consumption gross.

@netlify
Copy link

netlify bot commented May 20, 2025

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit 78ba52d
🔍 Latest deploy log https://app.netlify.com/projects/teslamate/deploys/68317e2d5574030008509598
😎 Deploy Preview https://deploy-preview-4746--teslamate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@swiffer swiffer added the area:dashboard Related to a Grafana dashboard label May 20, 2025
@swiffer
Copy link
Collaborator Author

swiffer commented May 20, 2025

@micku7zu - please have a look / test / leave feedback as well.

@micku7zu
Copy link

I've saw in the code that this case was actively excluded by using the greatest(range_diff, 0) but I didn't know the reason and didn't have the time to dig all that deep to understand why.

What you've fixed here is a great addition, thanks for your work!

But my edge case described here #4717 it's a little bit different. It's not about the case when a drive has a positive soc difference at the end of the trip. it's about a drive that has a greater soc during the drive than the start of the trip, or it has a lower soc during the drive than the end of the trip.

This pull request does what it's supposed to do based on its description, so I think we can leave it as is and continue the discussion on the issue I reported.

@swiffer
Copy link
Collaborator Author

swiffer commented May 20, 2025

Sorry, will update this PR to cover that case as well!

@swiffer
Copy link
Collaborator Author

swiffer commented May 20, 2025

@micku7zu - updated this PR - performance should be better as well, I'm now reusing the query of the consumtion gross avg panel. could you maybe post a before and after screenshot hopefully showing correct numbers for the latter?

@swiffer swiffer assigned swiffer and unassigned JakobLichterfeld May 20, 2025
@swiffer swiffer requested a review from JakobLichterfeld May 20, 2025 21:03
@micku7zu
Copy link

Thanks! Will do but I'm currently away from laptop for 24 hours.

@JakobLichterfeld JakobLichterfeld changed the title fix consumption for drives with positive soc diff fix: consumption for drives with positive soc diff May 21, 2025
@micku7zu
Copy link

Before:
2025-05-22_13-46-36

After:
2025-05-22_13-46-50

Before: 41.35 kWh
After: 40.61 kWh

It's good now 👍

Thanks!

@JakobLichterfeld
Copy link
Member

I will test on slow HW before merging

@swiffer
Copy link
Collaborator Author

swiffer commented May 22, 2025

One query deleted, rest as is. Should be good!

@JakobLichterfeld
Copy link
Member

shall we merge this before #4756?

@swiffer
Copy link
Collaborator Author

swiffer commented May 24, 2025

Yes, will rebase #4756 afterwards!

@JakobLichterfeld
Copy link
Member

JakobLichterfeld commented May 24, 2025

will do a test on slow HW right now and then merge (and then ditch my slow production system)

Copy link
Member

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully tested on slow host HW

@JakobLichterfeld JakobLichterfeld merged commit 88eaf9a into main May 24, 2025
16 of 17 checks passed
@JakobLichterfeld JakobLichterfeld deleted the swiffer/drive-downhill branch May 24, 2025 08:07
@JakobLichterfeld JakobLichterfeld added this to the v2.1.0 milestone Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dashboard Related to a Grafana dashboard

Projects

None yet

4 participants