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
Savings updates #2226
Conversation
|
||
log *util.Logger | ||
clock clock.Clock | ||
tariffs tariff.Tariffs |
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.
das muss ein Pointer sein, sonst doppelt sich das mit dem Tariff aus der Config- da schau ich nochmal rein
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)) |
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.
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.
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.
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()) |
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.
Die Funktion braucht ein early exit wenn sich nichts geändert hat, z.b. weil wir gar nicht laden. Spart jede Menge log lines.
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.
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 |
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.
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) |
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.
warum braucht es das "consumption"? Was ist hier mehr consumption als bei der Grid Consumption die aber nicht so heisst?
Fix #2225
use charged energy instead of power