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

Savings updates #2226

Merged
merged 22 commits into from Jan 9, 2022
Merged

Savings updates #2226

merged 22 commits into from Jan 9, 2022

Conversation

andig
Copy link
Member

@andig andig commented Jan 6, 2022

Fix #2225

  • running total in backend
  • use charged energy instead of power
  • re-fix tests

@andig andig added the enhancement New feature or request label Jan 6, 2022
core/savings.go Outdated Show resolved Hide resolved
assets/js/mixins/formatter.js Show resolved Hide resolved
core/savings.go Outdated Show resolved Hide resolved
core/savings.go Outdated Show resolved Hide resolved
core/savings.go Outdated Show resolved Hide resolved

log *util.Logger
clock clock.Clock
tariffs tariff.Tariffs
Copy link
Member Author

Choose a reason for hiding this comment

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

das muss ein Pointer sein, sonst doppelt sich das mit dem Tariff aus der Config- da schau ich nochmal rein

core/savings.go Outdated Show resolved Hide resolved
core/savings.go Outdated

s.log.DEBUG.Printf("%.1fkWh charged since %s", s.chargedTotal, time.Since(s.started).Round(time.Second))
s.log.DEBUG.Printf("%.1fkWh charged since %s", s.ChargedTotal(), time.Since(s.started).Round(time.Second))
Copy link
Member Author

Choose a reason for hiding this comment

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

können wir die Zeilen noch in 1 kombinieren? Brauchen wir das jetzt nach der Debugphase überhaupt noch? Weniger Loglines = viel einfachere Fehleranalyse.

Mein Vorschlag: raus, Rest ist im Cache sichtbar.

Copy link
Member

Choose a reason for hiding this comment

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

Jo, brauchen wir nicht mehr. ist raus.

core/savings.go Outdated
s.log.DEBUG.Printf("%.1fkWh own energy (%.1f%%)", s.chargedSelfConsumption, s.SelfPercentage())

p.publish("savingsChargedTotal", s.ChargedTotal())
Copy link
Member Author

Choose a reason for hiding this comment

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

Die Funktion braucht ein early exit wenn sich nichts geändert hat, z.b. weil wir gar nicht laden. Spart jede Menge log lines.

Copy link
Member

Choose a reason for hiding this comment

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

Ist ein bisschen komplizierter. Nun wird publiziert wenn geladen wird oder sich der Grid-Preis geändert hat.

site.loadpoints = loadpoints
site.savings = NewSavings()
site.tariffs = tariffs
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to self: need pointer

Clock clock.Clock
gridCharged float64 // Grid energy charged since startup (kWh)
gridCost float64 // Running total of charged grid energy cost (e.g. EUR)
selfConsumptionCharged float64 // Self-produced energy charged since startup (kWh)
Copy link
Member Author

Choose a reason for hiding this comment

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

warum braucht es das "consumption"? Was ist hier mehr consumption als bei der Grid Consumption die aber nicht so heisst?

@andig andig merged commit 8ba710f into master Jan 9, 2022
@andig andig deleted the feature/savings branch January 9, 2022 11:20
dontbyte pushed a commit to dontbyte/evcc that referenced this pull request Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate savings in backend
2 participants