Fix negative PvPower Calcualtion if not Meter is installed.
This commit is contained in:
parent
887394fc0e
commit
e15bee407c
1 changed files with 3 additions and 0 deletions
|
|
@ -353,6 +353,9 @@ func (site *Site) sitePower(totalChargePower float64) (float64, error) {
|
|||
// allow using Grid and charge as estimate for pv power
|
||||
if site.pvMeters == nil {
|
||||
site.pvPower = totalChargePower - site.gridPower + site.ResidualPower
|
||||
if site.pvPower < 0 {
|
||||
site.pvPower = 0
|
||||
}
|
||||
site.log.DEBUG.Printf("pv power: %.0fW", site.pvPower)
|
||||
site.publish("pvPower", site.pvPower)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue