Ignore pv self-consumption (#2873)
This commit is contained in:
parent
080bbe9324
commit
616514a741
1 changed files with 5 additions and 4 deletions
|
|
@ -275,8 +275,9 @@ func (site *Site) updateMeters() error {
|
|||
err := retry.Do(site.updateMeter(meter, &power), retryOptions...)
|
||||
|
||||
if err == nil {
|
||||
site.pvPower += power
|
||||
if power < -1000 {
|
||||
// ignore negative values which represent self-consumption
|
||||
site.pvPower += math.Max(0, power)
|
||||
if power < -500 {
|
||||
site.log.WARN.Printf("pv %d power: %.0fW is negative - check configuration if sign is correct", id, power)
|
||||
}
|
||||
} else {
|
||||
|
|
@ -353,7 +354,7 @@ func (site *Site) sitePower(totalChargePower float64) (float64, error) {
|
|||
for id, battery := range site.batteryMeters {
|
||||
soc, err := battery.(api.Battery).SoC()
|
||||
if err != nil {
|
||||
err = fmt.Errorf("updating battery soc %d: %v", id, err)
|
||||
err = fmt.Errorf("battery soc %d: %v", id, err)
|
||||
site.log.ERROR.Println(err)
|
||||
} else {
|
||||
site.log.DEBUG.Printf("battery soc %d: %.0f%%", id, soc)
|
||||
|
|
@ -367,7 +368,7 @@ func (site *Site) sitePower(totalChargePower float64) (float64, error) {
|
|||
|
||||
// if battery is charging below prioritySoC give it priority
|
||||
if socs < site.PrioritySoC && batteryPower < 0 {
|
||||
site.log.DEBUG.Printf("giving priority to battery charging at soc: %.0f", socs)
|
||||
site.log.DEBUG.Printf("giving priority to battery charging at soc: %.0f%%", socs)
|
||||
batteryPower = 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue