From e95e41fc5e8816a277f6acfa40073cf4ca3c55ed Mon Sep 17 00:00:00 2001 From: Gijsbert Date: Sun, 17 Mar 2024 17:42:51 +0100 Subject: [PATCH] Change homeload calculation again --- control/control.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/control/control.go b/control/control.go index e542441..64341a1 100644 --- a/control/control.go +++ b/control/control.go @@ -77,13 +77,7 @@ func (c *Control) Start() { metrics.SetMetricValue("control", "action", map[string]string{"action": "pull_from_grid"}, 0) // 1. Get current home energy consumption - inverterInputPower, err := metrics.GetMetricLastEntrySum("sun2000", "input_power") - if err != nil { - c.errChannel <- err - continue - } - - batteryChargingStatus, err := metrics.GetMetricLastEntrySum("luna2000", "charging_status") + inverterInputPower, err := metrics.GetMetricLastEntrySum("sun2000", "active_power") if err != nil { c.errChannel <- err continue @@ -95,7 +89,7 @@ func (c *Control) Start() { continue } - avgHomeLoad := (inverterInputPower * 1000) - batteryChargingStatus - powerMeterActivePower + avgHomeLoad := (inverterInputPower * 1000) - powerMeterActivePower if avgHomeLoad < 0 { avgHomeLoad = 0 }