OCPP: update docs (#3669)
Co-authored-by: xantalor <giullian.franke@ic-consult.de>
This commit is contained in:
parent
551b870cbd
commit
ae09fbba72
5 changed files with 91 additions and 15 deletions
|
|
@ -18,6 +18,7 @@ Evcc is an extensible EV Charge Controller with PV integration implemented in [G
|
|||
- wide range of supported [chargers](https://docs.evcc.io/docs/devices/chargers):
|
||||
- ABL eMH1, Alfen (Eve), Bender (CC612/613), cFos (PowerBrain), Daheimladen, Ebee (Wallbox), Ensto (Chago Wallbox), [EVSEWifi/ smartWB](https://www.evse-wifi.de), Garo (GLB, GLB+, LS4), go-eCharger, HardyBarth (eCB1, cPH1, cPH2), Heidelberg (Energy Control), Innogy (eBox), Juice (Charger Me), KEBA/BMW, Menneckes (Amedio, Amtron Premium/Xtra, Amtron ChargeConrol), NRGkick, [openWB (includes Pro)](https://openwb.de/), Optec (Mobility One), PC Electric (includes Garo), TechniSat (Technivolt), Ubitricity (Heinz), Vestel, Wallbe, Webasto (Live), Mobile Charger Connect
|
||||
- experimental EEBus support (PMCC)
|
||||
- experimental OCPP support
|
||||
- Build-your-own: Phoenix (includes ESL Walli), [EVSE DIN](https://www.evse-wifi.de/produkt-schlagwort/simple-evse-wb/)
|
||||
- Smart-Home outlets: FritzDECT, Shelly, Tasmota, TP-Link
|
||||
- wide range of supported [meters](https://docs.evcc.io/docs/devices/meters) for grid, pv, battery and charger:
|
||||
|
|
|
|||
|
|
@ -34,15 +34,14 @@ func init() {
|
|||
// NewOCPPFromConfig creates a OCPP charger from generic config
|
||||
func NewOCPPFromConfig(other map[string]interface{}) (api.Charger, error) {
|
||||
cc := struct {
|
||||
StationId string
|
||||
IdTag string
|
||||
Connector int
|
||||
MeterSupported bool
|
||||
MeterInterval time.Duration
|
||||
InitialReset core.ResetType
|
||||
StationId string
|
||||
IdTag string
|
||||
Connector int
|
||||
Meter bool
|
||||
MeterInterval time.Duration
|
||||
InitialReset core.ResetType
|
||||
}{
|
||||
Connector: 1,
|
||||
MeterInterval: 0, // disable meter sample data as we are taking care on our own
|
||||
Connector: 1,
|
||||
}
|
||||
|
||||
if err := util.DecodeOther(other, &cc); err != nil {
|
||||
|
|
@ -58,7 +57,7 @@ func NewOCPPFromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
return nil, fmt.Errorf("unknown configuration option detected for reset: %s", cc.InitialReset)
|
||||
}
|
||||
|
||||
ocpp, err := NewOCPP(cc.StationId, cc.Connector, cc.IdTag, cc.MeterSupported, cc.MeterInterval, cc.InitialReset)
|
||||
ocpp, err := NewOCPP(cc.StationId, cc.Connector, cc.IdTag, cc.Meter, cc.MeterInterval, cc.InitialReset)
|
||||
if err != nil {
|
||||
return ocpp, err
|
||||
}
|
||||
|
|
@ -69,7 +68,7 @@ func NewOCPPFromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
chargeRater func() (float64, error)
|
||||
)
|
||||
|
||||
if cc.MeterSupported {
|
||||
if cc.Meter {
|
||||
meter = ocpp.currentPower
|
||||
meterCurrent = ocpp.currents
|
||||
chargeRater = ocpp.chargedEnergy
|
||||
|
|
@ -81,8 +80,8 @@ func NewOCPPFromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
//go:generate go run ../cmd/tools/decorate.go -f decorateOCPP -b *OCPP -r api.Charger -t "api.Meter,CurrentPower,func() (float64, error)" -t "api.MeterCurrent,Currents,func() (float64, float64, float64, error)" -t "api.ChargeRater,ChargedEnergy,func() (float64, error)"
|
||||
|
||||
// NewOCPP creates OCPP charger
|
||||
func NewOCPP(id string, connector int, idtag string, meterSupported bool, meterInterval time.Duration, initialReset core.ResetType) (*OCPP, error) {
|
||||
cp := ocpp.Instance().Register(id, meterSupported)
|
||||
func NewOCPP(id string, connector int, idtag string, hasMeter bool, meterInterval time.Duration, initialReset core.ResetType) (*OCPP, error) {
|
||||
cp := ocpp.Instance().Register(id, hasMeter)
|
||||
c := &OCPP{
|
||||
log: util.NewLogger(fmt.Sprintf("ocpp-%s:%d", id, connector)),
|
||||
cp: cp,
|
||||
|
|
@ -142,7 +141,7 @@ func NewOCPP(id string, connector int, idtag string, meterSupported bool, meterI
|
|||
}
|
||||
}
|
||||
|
||||
if meterSupported {
|
||||
if hasMeter {
|
||||
if meterValuesSampledDataString != "Current.Import,Current.Offered,Energy.Active.Import.Register,Power.Active.Import,Temperature" {
|
||||
c.log.TRACE.Printf("Current values \n\t%s != \n\t%+v", ocpp.ValuePreferedMeterValuesSampleData, meterValuesSampledDataString)
|
||||
rc = make(chan error, 1)
|
||||
|
|
@ -182,7 +181,7 @@ func NewOCPP(id string, connector int, idtag string, meterSupported bool, meterI
|
|||
}
|
||||
|
||||
// get inital meter values
|
||||
if meterSupported {
|
||||
if hasMeter {
|
||||
ocpp.Instance().TriggerMeterValueRequest(cp)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
- charger: all charger templates
|
||||
- meter: all meter templates
|
||||
- vehicle: all vehicle templates
|
||||
- docs: content is generated via `go generate ./..` using the above templates for the evcc documentation page to be used
|
||||
- docs: content is generated via `go generate ./...` using the above templates for the evcc documentation page to be used
|
||||
|
||||
## Template Documentation
|
||||
|
||||
|
|
|
|||
55
templates/definition/charger/ocpp.yaml
Normal file
55
templates/definition/charger/ocpp.yaml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
template: ocpp
|
||||
products:
|
||||
- description:
|
||||
de: OCPP v1.6 kompatible Wallbox mit Smart Charging Profile
|
||||
en: OCPP v1.6 compatible charger with smart charging profile
|
||||
group: generic
|
||||
requirements:
|
||||
description:
|
||||
de: |
|
||||
Voraussetzungen:
|
||||
* Löschen zuvor konfigurierter Ladeprofile (z.B. durch ein anderes Backend)
|
||||
* Konfiguration des Backends der Wallbox: `ws://evcc.local:8887/`
|
||||
en: |
|
||||
Requirements:
|
||||
* Deletion prior configured load profiles (e.g. from another backend)
|
||||
* Backend configuration of the charger: `ws://evcc.local:8887/`
|
||||
params:
|
||||
- name: stationid
|
||||
required: true
|
||||
help:
|
||||
en: The charger's unique station id
|
||||
de: Die Stations-ID der Wallbox
|
||||
example: EVB-P12354
|
||||
- name: connector
|
||||
default: 1
|
||||
valuetype: int
|
||||
advanced: true
|
||||
help:
|
||||
en: Connector number, usually 1 for first connector.
|
||||
de: Verwendeter Ladepunkt, normalerweise 1 für den ersten Anschluss.
|
||||
- name: meter
|
||||
default: false
|
||||
valuetype: bool
|
||||
help:
|
||||
en: Use of the integrated meter (if present)
|
||||
de: Verwendung des integrierten Zählers (falls vorhanden)
|
||||
- name: idtag
|
||||
valuetype: string
|
||||
advanced: true
|
||||
help:
|
||||
en: RFID token used for transactions (currently no authorization implemented)
|
||||
de: ID des Tokens, welcher für Ladevorgänge genutzt werden soll, (aktuell nicht für Autorisierung verwendet) e.g
|
||||
example: 04E6B78921BBA0
|
||||
render: |
|
||||
type: ocpp
|
||||
stationid: {{ .stationid }}
|
||||
{{- if ne .connector "1 "}}
|
||||
connector: {{ .connector }}
|
||||
{{- end }}
|
||||
{{- if ne .idtag "" }}
|
||||
idtag: {{ .idtag }}
|
||||
{{- end }}
|
||||
{{- if ne .meter "false" }}
|
||||
meter: {{ .meter }}
|
||||
{{- end }}
|
||||
21
templates/docs/charger/ocpp_0.yaml
Normal file
21
templates/docs/charger/ocpp_0.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
product:
|
||||
description: OCPP v1.6 kompatible Wallbox mit Smart Charging Profile
|
||||
group: Generische Unterstützung
|
||||
description: |
|
||||
Voraussetzungen:
|
||||
* Löschen zuvor konfigurierter Ladeprofile (z.B. durch ein anderes Backend)
|
||||
* Konfiguration des Backends der Wallbox: `ws://evcc.local:8887/`
|
||||
|
||||
render:
|
||||
- default: |
|
||||
type: template
|
||||
template: ocpp
|
||||
stationid: EVB-P12354 # Die Stations-ID der Wallbox
|
||||
meter: false # Verwendung des integrierten Zählers (falls vorhanden) # Optional
|
||||
advanced: |
|
||||
type: template
|
||||
template: ocpp
|
||||
stationid: EVB-P12354 # Die Stations-ID der Wallbox
|
||||
connector: 1 # Verwendeter Ladepunkt, normalerweise 1 für den ersten Anschluss. # Optional
|
||||
meter: false # Verwendung des integrierten Zählers (falls vorhanden) # Optional
|
||||
idtag: 04E6B78921BBA0 # ID des Tokens, welcher für Ladevorgänge genutzt werden soll, (aktuell nicht für Autorisierung verwendet) e.g # Optional
|
||||
Loading…
Add table
Add a link
Reference in a new issue