Allow updating soc when vehicle disconnected (#228)

This commit is contained in:
andig 2020-07-21 08:36:28 +02:00 • committed by GitHub
parent d2feaca4d0
commit 387e39aff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -48,6 +48,9 @@ type LoadPoint struct {
Meters struct {
ChargeMeterRef string `mapstructure:"charge"` // Charge meter reference
}
SoC struct {
AlwaysUpdate bool `mapstructure:"alwaysUpdate"`
}
Enable, Disable ThresholdConfig
handler Handler
@ -462,7 +465,7 @@ func (lp *LoadPoint) publishSoC() {
return
}
if lp.connected() {
if lp.SoC.AlwaysUpdate || lp.connected() {
f, err := lp.vehicle.ChargeState()
if err == nil {
lp.log.DEBUG.Printf("vehicle soc: %.1f%%", f)

View file

@ -231,6 +231,8 @@ site:
loadpoints:
- title: Ladepunkt # ui display name
vehicle: audi
soc:
alwaysUpdate: false # set true to update vehicle soc even when disconnected
charger: wallbe # charger
phases: 3 # ev phases (default 3)
sensitivity: 1 # current raise/lower step size (default 10A)