diff --git a/assets/js/components/Config/defaultYaml/messaging.yaml b/assets/js/components/Config/defaultYaml/messaging.yaml index 43cd92e45..cb260c570 100644 --- a/assets/js/components/Config/defaultYaml/messaging.yaml +++ b/assets/js/components/Config/defaultYaml/messaging.yaml @@ -20,6 +20,9 @@ # asleep: # title: Vehicle asleep # msg: Charge release, vehicle {{ if .vehicleTitle }}{{ .vehicleTitle }} {{ end }}not charging. +# planoverrun: +# title: Plan overrun +# msg: "Plan {{- if .vehicleTitle }} for {{ .vehicleTitle }} will overrun.{{ else }} will overrun.{{end}}" #services: #- type: pushover diff --git a/core/loadpoint.go b/core/loadpoint.go index 08c8c758a..2929db407 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -151,6 +151,7 @@ type Loadpoint struct { planEnergyOffset float64 // already charged energy in kWh when plan was set planSlotEnd time.Time // current plan slot end time planActive bool // charge plan exists and has a currently active slot + planOverrunSent bool // notification has been sent already // cached state status api.ChargeStatus // Charger status diff --git a/core/loadpoint_plan.go b/core/loadpoint_plan.go index 536823aa2..5c3a34f12 100644 --- a/core/loadpoint_plan.go +++ b/core/loadpoint_plan.go @@ -16,6 +16,7 @@ import ( // setPlanActive updates plan active flag func (lp *Loadpoint) setPlanActive(active bool) { if !active { + lp.planOverrunSent = false lp.planSlotEnd = time.Time{} } if lp.planActive != active { @@ -154,6 +155,10 @@ func (lp *Loadpoint) plannerActive() (active bool) { if excessDuration := requiredDuration - lp.clock.Until(planTime); excessDuration > 0 { overrun = fmt.Sprintf("overruns by %v, ", excessDuration.Round(time.Second)) planOverrun = excessDuration + if !lp.planOverrunSent { + lp.pushEvent("planoverrun") + lp.planOverrunSent = true + } } planStart = planner.Start(plan) diff --git a/evcc.dist.yaml b/evcc.dist.yaml index 3f8764609..cc3178339 100644 --- a/evcc.dist.yaml +++ b/evcc.dist.yaml @@ -215,6 +215,9 @@ messaging: asleep: # vehicle doesn't start charging title: Vehicle asleep msg: Charge release, vehicle {{ if .vehicleTitle }}{{ .vehicleTitle }} {{ end }}not charging. + planoverrun: # current plan is going to overrun + title: Plan overrun + msg: "Plan {{- if .vehicleTitle }} for {{ .vehicleTitle }} will overrun.{{ else }} will overrun.{{ end }}" services: # - type: pushover # app: # app id