Fix phase detection unstable with estimated power usage
This commit is contained in:
parent
1f1c062f99
commit
94b889707c
1 changed files with 4 additions and 3 deletions
|
|
@ -1196,10 +1196,11 @@ func (lp *LoadPoint) updateChargeCurrents() {
|
|||
lp.chargeCurrents = nil
|
||||
phaseMeter, ok := lp.chargeMeter.(api.MeterCurrent)
|
||||
if !ok {
|
||||
// guess active phases from power consumption
|
||||
// assumes that chargePower has been updated before
|
||||
// Guess active phases from power consumption. Assumes that chargePower has been
|
||||
// updated before. Discussion in https://github.com/evcc-io/evcc/issues/2146 and
|
||||
// https://github.com/evcc-io/evcc/issues/2177
|
||||
if lp.charging() && lp.chargeCurrent > 0 {
|
||||
phases := int(math.Round(lp.chargePower / Voltage / lp.chargeCurrent))
|
||||
phases := int(math.Ceil(lp.chargePower/Voltage/lp.chargeCurrent - 0.05))
|
||||
if phases >= 1 && phases <= 3 {
|
||||
lp.activePhases = phases
|
||||
lp.log.DEBUG.Printf("detected phases: %dp (%.1fA @ %.0fW)", lp.activePhases, lp.chargeCurrent, lp.chargePower)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue