HardyBarth: add echarge brand, cPμ2 (#4393)

This commit is contained in:
andig 2022-09-12 13:25:44 +02:00 • committed by GitHub
parent 851b3c9066
commit b38d641cf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 12 deletions

View file

@ -18,6 +18,7 @@ package charger
// SOFTWARE.
import (
"errors"
"fmt"
"net/http"
"strconv"
@ -32,7 +33,6 @@ import (
"github.com/evcc-io/evcc/util/sponsor"
)
// http://apidoc.ecb1.de
// https://github.com/evcc-io/evcc/discussions/778
// Salia charger implementation
@ -55,13 +55,10 @@ func init() {
// NewSaliaFromConfig creates a Salia cPH2 charger from generic config
func NewSaliaFromConfig(other map[string]interface{}) (api.Charger, error) {
cc := struct {
URI string
ChargeControl int
Meter int
Cache time.Duration
URI string
Cache time.Duration
}{
ChargeControl: 1,
Meter: 1,
Cache: time.Second,
}
if err := util.DecodeOther(other, &cc); err != nil {
@ -89,7 +86,18 @@ func NewSalia(uri string, cache time.Duration) (api.Charger, error) {
return nil, api.ErrSponsorRequired
}
err := wb.post(salia.ChargeMode, echarge.ModeManual)
// set chargemode manual
res, err := wb.get()
if err == nil && res.Secc.Port0.Salia.ChargeMode != echarge.ModeManual {
if err = wb.post(salia.ChargeMode, echarge.ModeManual); err == nil {
res, err = wb.get()
}
if err == nil && res.Secc.Port0.Salia.ChargeMode != echarge.ModeManual {
err = errors.New("could not change chargemode to manual")
}
}
if err == nil {
go wb.heartbeat()

View file

@ -2,7 +2,10 @@ template: hardybarth-ecb1
products:
- brand: HardyBarth
description:
generic: cPH1 (eCB1 Controller)
generic: cPH1
- brand: echarge
description:
generic: cPH1
requirements:
evcc: ["sponsorship"]
params:

View file

@ -2,7 +2,10 @@ template: hardybarth-salia
products:
- brand: HardyBarth
description:
generic: cPH2 (Salia PLCC Controller)
generic: cPH2, cPμ2
- brand: echarge
description:
generic: cPH2, cPμ2
requirements:
evcc: ["sponsorship"]
params:

View file

@ -1,6 +1,6 @@
product:
brand: HardyBarth
description: cPH1 (eCB1 Controller)
description: cPH1
requirements: ["sponsorship"]
render:
- default: |

View file

@ -0,0 +1,9 @@
product:
brand: echarge
description: cPH1
requirements: ["sponsorship"]
render:
- default: |
type: template
template: hardybarth-ecb1
host: 192.0.2.2 # IP-Adresse oder Hostname

View file

@ -1,6 +1,6 @@
product:
brand: HardyBarth
description: cPH2 (Salia PLCC Controller)
description: cPH2, cPμ2
requirements: ["sponsorship"]
render:
- default: |

View file

@ -0,0 +1,9 @@
product:
brand: echarge
description: cPH2, cPμ2
requirements: ["sponsorship"]
render:
- default: |
type: template
template: hardybarth-salia
host: 192.0.2.2 # IP-Adresse oder Hostname

View file

@ -11,6 +11,7 @@
"DaheimLaden",
"Easee",
"Ebee",
"echarge",
"Ensto",
"Etrel",
"Garo",