chore: add more logging for #16599
This commit is contained in:
parent
04721ef4c5
commit
017e2c0e1a
1 changed files with 6 additions and 0 deletions
|
|
@ -1209,6 +1209,8 @@ func (lp *Loadpoint) pvScalePhases(sitePower, minCurrent, maxCurrent float64) in
|
|||
availablePower := lp.chargePower - sitePower
|
||||
scalable := (sitePower > 0 || !lp.enabled) && activePhases > 1 && lp.configuredPhases < 3
|
||||
|
||||
lp.log.DEBUG.Printf("!! pvScalePhases DOWN activePhases: %d, available power: %.0fW, scalable: %T", activePhases, availablePower, scalable)
|
||||
|
||||
// scale down phases
|
||||
if targetCurrent := powerToCurrent(availablePower, activePhases); targetCurrent < minCurrent && scalable {
|
||||
lp.log.DEBUG.Printf("available power %.0fW < %.0fW min %dp threshold", availablePower, float64(activePhases)*Voltage*minCurrent, activePhases)
|
||||
|
|
@ -1238,6 +1240,8 @@ func (lp *Loadpoint) pvScalePhases(sitePower, minCurrent, maxCurrent float64) in
|
|||
target1pCurrent := powerToCurrent(availablePower, 1)
|
||||
scalable = maxPhases > 1 && phases < maxPhases && target1pCurrent > maxCurrent
|
||||
|
||||
lp.log.DEBUG.Printf("!! pvScalePhases UP maxPhases: %d, available power: %.0fW, scalable: %T", maxPhases, availablePower, scalable)
|
||||
|
||||
// scale up phases
|
||||
if targetCurrent := powerToCurrent(availablePower, maxPhases); targetCurrent >= minCurrent && scalable {
|
||||
lp.log.DEBUG.Printf("available power %.0fW > %.0fW min %dp threshold", availablePower, 3*Voltage*minCurrent, maxPhases)
|
||||
|
|
@ -1268,6 +1272,8 @@ func (lp *Loadpoint) pvScalePhases(sitePower, minCurrent, maxCurrent float64) in
|
|||
lp.resetPhaseTimer()
|
||||
}
|
||||
|
||||
lp.log.DEBUG.Println("!! pvScalePhases EXIT")
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue