-
+
{{
$t(
@@ -166,7 +166,8 @@ export default {
id: [String, Number],
phasesConfigured: Number,
phasesActive: Number,
- phases1p3p: Boolean,
+ chargerPhases1p3p: Boolean,
+ chargerPhysicalPhases: Number,
minSoc: Number,
maxCurrent: Number,
minCurrent: Number,
@@ -182,13 +183,19 @@ export default {
},
computed: {
phasesOptions: function () {
- if (this.phases1p3p) {
+ if (this.chargerPhysicalPhases == 1) {
+ // known fixed phase configuration, no settings required
+ return [];
+ }
+ if (this.chargerPhases1p3p) {
+ // automatic switching
return [PHASES_AUTO, PHASES_3, PHASES_1];
}
+ // 1p or 3p possible
return [PHASES_3, PHASES_1];
},
maxPower: function () {
- if (this.phases1p3p) {
+ if (this.chargerPhases1p3p) {
if (this.phasesConfigured === PHASES_AUTO) {
return this.maxPowerPhases(3);
}
@@ -199,7 +206,7 @@ export default {
return this.fmtKw(this.maxCurrent * V * this.phasesActive);
},
minPower: function () {
- if (this.phases1p3p) {
+ if (this.chargerPhases1p3p) {
if (this.phasesConfigured === PHASES_AUTO) {
return this.minPowerPhases(1);
}
diff --git a/charger/switchsocket.go b/charger/switchsocket.go
index 99ef1333c..45b5193a6 100644
--- a/charger/switchsocket.go
+++ b/charger/switchsocket.go
@@ -98,3 +98,10 @@ var _ loadpoint.Controller = (*switchSocket)(nil)
func (c *switchSocket) LoadpointControl(lp loadpoint.API) {
c.lp = lp
}
+
+var _ api.PhaseDescriber = (*switchSocket)(nil)
+
+// Phases implements the api.PhasesDescriber interface
+func (v *switchSocket) Phases() int {
+ return 1
+}
diff --git a/core/keys/loadpoint.go b/core/keys/loadpoint.go
index 2fb543d11..8fd627a41 100644
--- a/core/keys/loadpoint.go
+++ b/core/keys/loadpoint.go
@@ -14,12 +14,13 @@ const (
DisableThreshold = "disableThreshold"
PhasesConfigured = "phasesConfigured" // configured phases (1/3, 0 for auto on 1p3p chargers, nil for plain chargers)
- Phases1p3p = "phases1p3p" // phase switcher (1p3p chargers)
PhasesEnabled = "phasesEnabled" // enabled phases (1/3)
PhasesActive = "phasesActive" // active phases as used by vehicle (1/2/3)
- ChargerIcon = "chargerIcon" // charger icon for ui
- ChargerFeature = "chargerFeature" // charger feature
+ ChargerIcon = "chargerIcon" // charger icon for ui
+ ChargerFeature = "chargerFeature" // charger feature
+ ChargerPhysicalPhases = "chargerPhysicalPhases" // charger phases
+ ChargerPhases1p3p = "chargerPhases1p3p" // phase switcher (1p3p chargers)
// loadpoint status
Enabled = "enabled" // loadpoint enabled
diff --git a/core/loadpoint.go b/core/loadpoint.go
index a46db5907..54ca29272 100644
--- a/core/loadpoint.go
+++ b/core/loadpoint.go
@@ -595,13 +595,19 @@ func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even
lp.publish(keys.DisableThreshold, lp.Disable.Threshold)
lp.publish(keys.PhasesConfigured, lp.configuredPhases)
- lp.publish(keys.Phases1p3p, lp.hasPhaseSwitching())
+ lp.publish(keys.ChargerPhases1p3p, lp.hasPhaseSwitching())
lp.publish(keys.PhasesEnabled, lp.phases)
lp.publish(keys.PhasesActive, lp.ActivePhases())
lp.publishTimer(phaseTimer, 0, timerInactive)
lp.publishTimer(pvTimer, 0, timerInactive)
lp.publishTimer(guardTimer, 0, timerInactive)
+ if phases := lp.getChargerPhysicalPhases(); phases != 0 {
+ lp.publish(keys.ChargerPhysicalPhases, phases)
+ } else {
+ lp.publish(keys.ChargerPhysicalPhases, nil)
+ }
+
// charger features
for _, f := range []api.Feature{api.IntegratedDevice, api.Heating} {
lp.publishChargerFeature(f)
diff --git a/core/loadpoint_phases.go b/core/loadpoint_phases.go
index b2b96d695..e665e4327 100644
--- a/core/loadpoint_phases.go
+++ b/core/loadpoint_phases.go
@@ -62,8 +62,9 @@ func (lp *Loadpoint) ActivePhases() int {
physical := lp.GetPhases()
vehicle := lp.getVehiclePhases()
measured := lp.getMeasuredPhases()
+ charger := lp.getChargerPhysicalPhases()
- active := min(expect(vehicle), expect(physical), expect(measured))
+ active := min(expect(vehicle), expect(physical), expect(measured), expect(charger))
// sanity check - we should not assume less active phases than actually measured
if measured > 0 && active < measured {
@@ -78,6 +79,7 @@ func (lp *Loadpoint) maxActivePhases() int {
physical := lp.GetPhases()
measured := lp.getMeasuredPhases()
vehicle := lp.getVehiclePhases()
+ charger := lp.getChargerPhysicalPhases()
// during 1p or unknown config, 1p measured is not a restriction
if physical <= 1 || vehicle == 1 {
@@ -89,7 +91,7 @@ func (lp *Loadpoint) maxActivePhases() int {
physical = lp.configuredPhases
}
- return min(expect(vehicle), expect(physical), expect(measured))
+ return min(expect(vehicle), expect(physical), expect(measured), expect(charger))
}
func (lp *Loadpoint) getVehiclePhases() int {
@@ -100,6 +102,14 @@ func (lp *Loadpoint) getVehiclePhases() int {
return 0
}
+func (lp *Loadpoint) getChargerPhysicalPhases() int {
+ if cc, ok := lp.charger.(api.PhaseDescriber); ok {
+ return cc.Phases()
+ }
+
+ return 0
+}
+
func (lp *Loadpoint) hasPhaseSwitching() bool {
_, ok := lp.charger.(api.PhaseSwitcher)
return ok