Log minSoc and batteryPrioritySoc (#10282)

This commit is contained in:
jheinitz 2023-10-20 19:14:19 +02:00 • committed by GitHub
parent 25f6e1311a
commit d516e84c42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -825,6 +825,9 @@ func (lp *Loadpoint) minSocNotReached() bool {
}
if lp.vehicleSoc != 0 {
if lp.vehicleSoc < float64(lp.Soc.min) {
lp.log.DEBUG.Printf("forced charging at vehicle soc %.0f%% (< %.0f%% min soc)", lp.vehicleSoc, float64(lp.Soc.min))
}
return lp.vehicleSoc < float64(lp.Soc.min)
}

View file

@ -768,6 +768,7 @@ func TestMinSoc(t *testing.T) {
for _, tc := range tc {
lp := &Loadpoint{
log: util.NewLogger("foo"),
Soc: SocConfig{
min: tc.min,
},

View file

@ -613,7 +613,7 @@ func (site *Site) sitePower(totalChargePower, flexiblePower float64) (float64, b
// if battery is charging below prioritySoc give it priority
if site.batterySoc < site.PrioritySoc && batteryPower < 0 {
site.log.DEBUG.Printf("giving priority to battery charging at soc: %.0f%%", site.batterySoc)
site.log.DEBUG.Printf("battery has priority at soc %.0f%% (< %.0f%%)", site.batterySoc, site.PrioritySoc)
batteryPower = 0
} else {
// if battery is above bufferSoc allow using it for charging