Tinkerforge Warp: detect charger type and deactivate auto phase switching if necessary (#27745)
This commit is contained in:
parent
a20c09eadd
commit
a418b8472b
4 changed files with 33 additions and 42 deletions
|
|
@ -64,14 +64,13 @@ func init() {
|
|||
|
||||
func NewWarpWSFromConfig(ctx context.Context, other map[string]any) (api.Charger, error) {
|
||||
var cc struct {
|
||||
URI string
|
||||
User string
|
||||
Password string
|
||||
EnergyManagerURI string
|
||||
EnergyManagerUser string
|
||||
EnergyManagerPassword string
|
||||
DisablePhaseAutoSwitch bool
|
||||
EnergyMeterIndex uint
|
||||
URI string
|
||||
User string
|
||||
Password string
|
||||
EnergyManagerURI string
|
||||
EnergyManagerUser string
|
||||
EnergyManagerPassword string
|
||||
EnergyMeterIndex uint
|
||||
}
|
||||
|
||||
if err := util.DecodeOther(other, &cc); err != nil {
|
||||
|
|
@ -131,10 +130,13 @@ func NewWarpWSFromConfig(ctx context.Context, other map[string]any) (api.Charger
|
|||
}
|
||||
}
|
||||
|
||||
// Phase Auto Switching needs to be disabled for WARP3
|
||||
// Phase Auto Switching needs to be disabled for WARP3 and WARP2 + EM
|
||||
// Necessary if charging 1p only vehicles
|
||||
if cc.DisablePhaseAutoSwitch {
|
||||
// unfortunately no feature to check for, instead this is set in template
|
||||
typ, err := wb.getWarpType()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if typ == "warp3" || (typ == "warp2" && wb.pmURI != "") {
|
||||
if err := wb.disablePhaseAutoSwitch(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -572,3 +574,10 @@ func (w *WarpWS) ensurePmState() (warp.PmState, error) {
|
|||
|
||||
return ns, nil
|
||||
}
|
||||
|
||||
func (w *WarpWS) getWarpType() (string, error) {
|
||||
var res warp.Name
|
||||
uri := fmt.Sprintf("%s/info/name", w.uri)
|
||||
err := w.GetJSON(uri, &res)
|
||||
return res.WarpType, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,13 @@ type MeterValues struct {
|
|||
TmpValues []float64
|
||||
}
|
||||
|
||||
type Name struct {
|
||||
Name string `json:"name"`
|
||||
WarpType string `json:"type"`
|
||||
DisplayType string `json:"display_type"`
|
||||
Uid string `json:"uid"`
|
||||
}
|
||||
|
||||
type PhasePair struct {
|
||||
CurrentID int
|
||||
VoltageID int
|
||||
|
|
|
|||
|
|
@ -2,11 +2,15 @@ template: tinkerforge-warp-ws
|
|||
products:
|
||||
- { brand: TinkerForge, description: { generic: WARP3 Smart } }
|
||||
- { brand: TinkerForge, description: { generic: WARP3 Pro } }
|
||||
- { brand: TinkerForge, description: { generic: WARP2 Smart } }
|
||||
- { brand: TinkerForge, description: { generic: WARP2 Pro } }
|
||||
- { brand: TinkerForge, description: { generic: WARP1 Smart } }
|
||||
- { brand: TinkerForge, description: { generic: WARP1 Pro } }
|
||||
capabilities: ["mA", "1p3p", "rfid"]
|
||||
requirements:
|
||||
description:
|
||||
de: Die WARP-eigene automatische Phasenumschaltung wird von EVCC beim Verbinden mit der Wallbox deaktiviert. Siehe [docs.warp-charger.com](https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3).
|
||||
en: WARP's own automatic phase switching will be deactivated by EVCC when connecting to the wallbox. See [docs.warp-charger.com](https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3).
|
||||
de: Falls notwendig wird die WARP-eigene automatische Phasenumschaltung von EVCC beim Verbinden mit der Wallbox deaktiviert. Siehe [docs.warp-charger.com](https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3).
|
||||
en: If necessary, WARP's own automatic phase switching will be deactivated by EVCC when connecting to the wallbox. See [docs.warp-charger.com](https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3).
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- name: uri
|
||||
|
|
@ -27,4 +31,3 @@ render: |
|
|||
user: {{ .user }}
|
||||
password: {{ .password }}
|
||||
energyMeterIndex: {{ .energyMeterIndex }}
|
||||
disablePhaseAutoSwitch: true
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
template: tinkerforge-warp1-ws
|
||||
products:
|
||||
- { brand: TinkerForge, description: { generic: WARP2 Smart } }
|
||||
- { brand: TinkerForge, description: { generic: WARP2 Pro } }
|
||||
- { brand: TinkerForge, description: { generic: WARP1 Smart } }
|
||||
- { brand: TinkerForge, description: { generic: WARP1 Pro } }
|
||||
capabilities: ["mA", "rfid"]
|
||||
requirements:
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- name: uri
|
||||
required: true
|
||||
- name: user
|
||||
- name: password
|
||||
- name: energyMeterIndex
|
||||
advanced: true
|
||||
default: 0
|
||||
description:
|
||||
generic: Energy Meter Index
|
||||
help:
|
||||
de: Index des in der Warp konfigurierten Meters dessen Werte genutzt werden sollen.
|
||||
en: Index of the meter configured in the WARP charger whose values should be used.
|
||||
render: |
|
||||
type: warp-ws
|
||||
uri: {{ .uri }}
|
||||
user: {{ .user }}
|
||||
password: {{ .password }}
|
||||
energyMeterIndex: {{ .energyMeterIndex }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue