From d3720f03b6a5f9dd911179872be335ce46c3107d Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Wed, 12 Aug 2020 14:57:54 +0200 Subject: [PATCH 01/23] Added config input to enter the max battery charging/discharging power. --- .../src/io/openems/edge/goodwe/et/ess/Config.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java index dcf97159323..523c7c5845e 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java @@ -30,6 +30,9 @@ @AttributeDefinition(name = "Capacity", description = "Capacity of the battery in Wh") int capacity() default 9_000; + + @AttributeDefinition(name = "Max Battery Power", description = "Maximum Battery Charge/Discharge Power in Wh") + int maxBateryPower() default 5_200; @AttributeDefinition(name = "Modbus target filter", description = "This is auto-generated by 'Modbus-ID'.") String Modbus_target() default ""; From 5a2911391243d4ec55affd440752e03582fa5922 Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Wed, 12 Aug 2020 14:58:53 +0200 Subject: [PATCH 02/23] allowed charge and discharge values are auto adjusted based on the soc levels. --- .../et/ess/GoodWeEtBatteryInverterImpl.java | 70 +++++++++++++------ 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index ae539f6704c..3490622106c 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -382,6 +382,7 @@ protected ModbusProtocol defineModbusProtocol() { public void applyPower(int activePower, int reactivePower) throws OpenemsNamedException { final PowerModeEms nextPowerMode; + System.out.println("Active power:" + activePower); if (this.config.readOnlyMode()) { // Read-Only-Mode: fall-back to internal self-consumption optimization nextPowerMode = PowerModeEms.AUTO; @@ -400,17 +401,18 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx * * TODO PV mode is not working, need an update from GoodWe for this. */ - Integer productionPower = null; - for (AbstractGoodWeEtCharger charger : this.chargers) { - productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); - } - if (productionPower == null) { - // No PV-Power -> required to put on SELL_POWER - nextPowerMode = PowerModeEms.SELL_POWER; - } else { - // PV-Power exists -> set DISCHARGE_BAT - nextPowerMode = PowerModeEms.DISCHARGE_BAT; - } +// Integer productionPower = null; +// for (AbstractGoodWeEtCharger charger : this.chargers) { +// productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); +// } +// if (productionPower == null) { +// // No PV-Power -> required to put on SELL_POWER +// nextPowerMode = PowerModeEms.SELL_POWER; +// } else { +// // PV-Power exists -> set DISCHARGE_BAT +// nextPowerMode = PowerModeEms.DISCHARGE_BAT; +// } + nextPowerMode = PowerModeEms.DISCHARGE_PV; } } @@ -472,7 +474,9 @@ private void updatechannels() { */ final Channel batteryPower = this.channel(EssChannelId.P_BATTERY1); Integer activePower = batteryPower.getNextValue().get(); + Integer productionPower = null; for (AbstractGoodWeEtCharger charger : this.chargers) { + productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); activePower = TypeUtils.sum(activePower, charger.getActualPowerChannel().getNextValue().get()); } this._setActivePower(activePower); @@ -480,20 +484,41 @@ private void updatechannels() { /* * Update Allowed charge and Allowed discharge */ - Integer soc = this.getSoc().get(); - Integer maxApparentPower = this.getMaxApparentPower().get(); - - if (soc == null || soc >= 99) { - this._setAllowedChargePower(0); - } else { - this._setAllowedChargePower(TypeUtils.multiply(maxApparentPower, -1)); + Integer maxBatteryPower = this.config.maxBateryPower(); + + Integer allowedCharge = null; + Integer allowedDischarge = null; + + if (soc == null) { + + allowedCharge = 0; + allowedDischarge = 0; + + } else if (soc == 100) { + + allowedDischarge = maxBatteryPower + productionPower; + allowedCharge = 0; + + } else if (soc >= 50) { + + allowedDischarge = maxBatteryPower + productionPower; + allowedCharge = maxBatteryPower - productionPower; + + } else if (soc >= 0) { + + allowedDischarge = productionPower; + allowedCharge = maxBatteryPower - productionPower; + } - if (soc == null || soc <= 0) { - this._setAllowedDischargePower(0); - } else { - this._setAllowedDischargePower(maxApparentPower); + + // to avoid charging when production is greater than maximum battery power. + if (allowedCharge < 0) { + allowedCharge = 0; } + + this._setAllowedChargePower(TypeUtils.multiply(allowedCharge * -1)); + this._setAllowedDischargePower(allowedDischarge); } @Override @@ -515,6 +540,7 @@ public Constraint[] getStaticConstraints() throws OpenemsNamedException { this.createPowerConstraint("Read-Only-Mode", Phase.ALL, Pwr.REACTIVE, Relationship.EQUALS, 0) // }; } + return Power.NO_CONSTRAINTS; } } From ad1e929dc7ef784238b9c61feed58dc4d821dcd9 Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Wed, 12 Aug 2020 15:01:32 +0200 Subject: [PATCH 03/23] restructured the code. --- .../et/ess/GoodWeEtBatteryInverterImpl.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 3490622106c..9799e028d5a 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -394,24 +394,6 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx } else { // ActivePower is positive -> DISCHARGE - - /* - * Check if PV is available. Discharge mode changes according to availability of - * PV - * - * TODO PV mode is not working, need an update from GoodWe for this. - */ -// Integer productionPower = null; -// for (AbstractGoodWeEtCharger charger : this.chargers) { -// productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); -// } -// if (productionPower == null) { -// // No PV-Power -> required to put on SELL_POWER -// nextPowerMode = PowerModeEms.SELL_POWER; -// } else { -// // PV-Power exists -> set DISCHARGE_BAT -// nextPowerMode = PowerModeEms.DISCHARGE_BAT; -// } nextPowerMode = PowerModeEms.DISCHARGE_PV; } } From c0871e045e942831e0166b3163f67ab05e0a3a09 Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Thu, 24 Sep 2020 11:19:39 +0200 Subject: [PATCH 04/23] Latest Changes charge/discharge --- .../edge/goodwe/et/ess/EssChannelId.java | 6 ++++ .../et/ess/GoodWeEtBatteryInverterImpl.java | 36 +++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java index a3f3ff5ddad..3fb55902000 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java @@ -294,6 +294,12 @@ public enum EssChannelId implements ChannelId { BATTERY_PROTOCOL(Doc.of(OpenemsType.INTEGER) // .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + + BMS_ALLOWED_CHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + + BMS_ALLOWED_DISCHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // // Setting Parameter USER_PASSWORD1(Doc.of(OpenemsType.STRING) // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 9799e028d5a..b5da8fe8f3f 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -34,6 +34,7 @@ import io.openems.edge.common.channel.Channel; import io.openems.edge.common.channel.EnumReadChannel; import io.openems.edge.common.channel.EnumWriteChannel; +import io.openems.edge.common.channel.IntegerReadChannel; import io.openems.edge.common.channel.IntegerWriteChannel; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.event.EdgeEventConstants; @@ -198,6 +199,10 @@ protected ModbusProtocol defineModbusProtocol() { m(EssChannelId.P_BATTERY1, new SignedWordElement(35183)), // m(EssChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // + new FC3ReadRegistersTask(37102, Priority.HIGH, // + m(EssChannelId.BMS_ALLOWED_CHARGE, new UnsignedWordElement(37102)), // + m(EssChannelId.BMS_ALLOWED_DISCHARGE, new SignedWordElement(37104))), // + new FC3ReadRegistersTask(35185, Priority.LOW, // m(EssChannelId.WARNING_CODE, new UnsignedWordElement(35185)), // m(EssChannelId.SAFETY_COUNTRY, new UnsignedWordElement(35186)), // @@ -383,18 +388,29 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx final PowerModeEms nextPowerMode; System.out.println("Active power:" + activePower); + + IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); + Integer allowedChargePower = allowedCharge.value().get(); + + IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); + Integer allowedDischargePower = allowedDischarge.value().get(); + + System.out.println("Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); + if (this.config.readOnlyMode()) { // Read-Only-Mode: fall-back to internal self-consumption optimization nextPowerMode = PowerModeEms.AUTO; activePower = 0; } else { - if (activePower <= 0) { + if (activePower < 0) { // ActivePower is negative or zero -> CHARGE + System.out.println(" Setting Charging"); nextPowerMode = PowerModeEms.CHARGE_BAT; } else { // ActivePower is positive -> DISCHARGE - nextPowerMode = PowerModeEms.DISCHARGE_PV; + System.out.println(" Setting Discharging"); + nextPowerMode = PowerModeEms.EXPORT_AC; } } @@ -473,25 +489,25 @@ private void updatechannels() { Integer allowedDischarge = null; if (soc == null) { - + allowedCharge = 0; allowedDischarge = 0; - + } else if (soc == 100) { - + allowedDischarge = maxBatteryPower + productionPower; allowedCharge = 0; - + } else if (soc >= 50) { - + allowedDischarge = maxBatteryPower + productionPower; allowedCharge = maxBatteryPower - productionPower; - + } else if (soc >= 0) { - + allowedDischarge = productionPower; allowedCharge = maxBatteryPower - productionPower; - + } // to avoid charging when production is greater than maximum battery power. From 6ad88f8e36ca1a403ac8eddde2821e6477f25fcb Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Wed, 7 Oct 2020 09:32:32 +0200 Subject: [PATCH 05/23] changed power limits --- .../et/ess/GoodWeEtBatteryInverterImpl.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index b5da8fe8f3f..dda0ad1fdc8 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -199,9 +199,9 @@ protected ModbusProtocol defineModbusProtocol() { m(EssChannelId.P_BATTERY1, new SignedWordElement(35183)), // m(EssChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // - new FC3ReadRegistersTask(37102, Priority.HIGH, // - m(EssChannelId.BMS_ALLOWED_CHARGE, new UnsignedWordElement(37102)), // - m(EssChannelId.BMS_ALLOWED_DISCHARGE, new SignedWordElement(37104))), // +// new FC3ReadRegistersTask(37102, Priority.HIGH, // +// m(EssChannelId.BMS_ALLOWED_CHARGE, new UnsignedWordElement(37102)), // +// m(EssChannelId.BMS_ALLOWED_DISCHARGE, new SignedWordElement(37104))), // new FC3ReadRegistersTask(35185, Priority.LOW, // m(EssChannelId.WARNING_CODE, new UnsignedWordElement(35185)), // @@ -389,13 +389,14 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx System.out.println("Active power:" + activePower); - IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); - Integer allowedChargePower = allowedCharge.value().get(); - - IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); - Integer allowedDischargePower = allowedDischarge.value().get(); - - System.out.println("Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); +// IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); +// Integer allowedChargePower = allowedCharge.value().get(); +// +// IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); +// Integer allowedDischargePower = allowedDischarge.value().get(); +// +// System.out.println( +// "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); if (this.config.readOnlyMode()) { // Read-Only-Mode: fall-back to internal self-consumption optimization @@ -410,7 +411,12 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx } else { // ActivePower is positive -> DISCHARGE System.out.println(" Setting Discharging"); - nextPowerMode = PowerModeEms.EXPORT_AC; + Integer soc = this.getSoc().get(); + if (soc == 100 || activePower == 0) { + nextPowerMode = PowerModeEms.EXPORT_AC; + } else { + nextPowerMode = PowerModeEms.DISCHARGE_PV; + } } } @@ -501,12 +507,12 @@ private void updatechannels() { } else if (soc >= 50) { allowedDischarge = maxBatteryPower + productionPower; - allowedCharge = maxBatteryPower - productionPower; + allowedCharge = maxBatteryPower; } else if (soc >= 0) { allowedDischarge = productionPower; - allowedCharge = maxBatteryPower - productionPower; + allowedCharge = maxBatteryPower; } From 399035f3cd7827bba38ad04758fc05acdf0a277d Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Mon, 19 Oct 2020 14:59:35 +0200 Subject: [PATCH 06/23] Adjusting in the static battery limits. --- .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index dda0ad1fdc8..2cf79ee4da6 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -34,7 +34,6 @@ import io.openems.edge.common.channel.Channel; import io.openems.edge.common.channel.EnumReadChannel; import io.openems.edge.common.channel.EnumWriteChannel; -import io.openems.edge.common.channel.IntegerReadChannel; import io.openems.edge.common.channel.IntegerWriteChannel; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.event.EdgeEventConstants; @@ -504,12 +503,12 @@ private void updatechannels() { allowedDischarge = maxBatteryPower + productionPower; allowedCharge = 0; - } else if (soc >= 50) { + } else if (soc > 0) { allowedDischarge = maxBatteryPower + productionPower; allowedCharge = maxBatteryPower; - } else if (soc >= 0) { + } else if (soc == 0) { allowedDischarge = productionPower; allowedCharge = maxBatteryPower; From 92a5e9961afa416ff45958a2c4680a5ae0aa1443 Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Mon, 19 Oct 2020 15:36:25 +0200 Subject: [PATCH 07/23] merge problems rectified --- .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 3ecffc87781..1fa861b4e5b 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -497,8 +497,6 @@ private void updatechannels() { /* * Calculate AC Energy */ -<<<<<<< HEAD -======= if (activePower == null) { // Not available this.calculateAcChargeEnergy.update(null); @@ -516,7 +514,6 @@ private void updatechannels() { /* * Update Allowed charge and Allowed discharge */ ->>>>>>> develop Integer soc = this.getSoc().get(); Integer maxBatteryPower = this.config.maxBateryPower(); From b7e5081bcf530e6be8d2b88e978173961804866b Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Tue, 20 Oct 2020 11:06:05 +0200 Subject: [PATCH 08/23] corrected null pointer exception --- .../et/ess/GoodWeEtBatteryInverterImpl.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 1fa861b4e5b..91aa0251e80 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -399,15 +399,6 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx System.out.println("Active power:" + activePower); -// IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); -// Integer allowedChargePower = allowedCharge.value().get(); -// -// IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); -// Integer allowedDischargePower = allowedDischarge.value().get(); -// -// System.out.println( -// "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); - if (this.config.readOnlyMode()) { // Read-Only-Mode: fall-back to internal self-consumption optimization nextPowerMode = PowerModeEms.AUTO; @@ -514,12 +505,26 @@ private void updatechannels() { /* * Update Allowed charge and Allowed discharge */ + +// IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); +// Integer allowedChargePower = allowedCharge.value().get(); +// +// IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); +// Integer allowedDischargePower = allowedDischarge.value().get(); +// +// System.out.println( +// "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); + Integer soc = this.getSoc().get(); Integer maxBatteryPower = this.config.maxBateryPower(); Integer allowedCharge = null; Integer allowedDischarge = null; + if (productionPower == null) { + productionPower = 0; + } + if (soc == null) { allowedCharge = 0; From e6ac2dcd94931a4123234eec89b46caa46aece1d Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 20 Oct 2020 20:43:46 +0200 Subject: [PATCH 09/23] Fix typo 'bateryPower' --- .../src/io/openems/edge/goodwe/et/ess/Config.java | 6 +++--- .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java index 523c7c5845e..3ba3a94d99f 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java @@ -30,9 +30,9 @@ @AttributeDefinition(name = "Capacity", description = "Capacity of the battery in Wh") int capacity() default 9_000; - - @AttributeDefinition(name = "Max Battery Power", description = "Maximum Battery Charge/Discharge Power in Wh") - int maxBateryPower() default 5_200; + + @AttributeDefinition(name = "Maximum power", description = "Maximum charge/discharge power in [W]") + int maxBatteryPower() default 5_200; @AttributeDefinition(name = "Modbus target filter", description = "This is auto-generated by 'Modbus-ID'.") String Modbus_target() default ""; diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 91aa0251e80..39c0f1777db 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -516,7 +516,7 @@ private void updatechannels() { // "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); Integer soc = this.getSoc().get(); - Integer maxBatteryPower = this.config.maxBateryPower(); + Integer maxBatteryPower = this.config.maxBatteryPower(); Integer allowedCharge = null; Integer allowedDischarge = null; From 522721ec136786a8df0cc6a2694fa32b1ef18690 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 20 Oct 2020 20:44:59 +0200 Subject: [PATCH 10/23] Drop unused channels --- .../src/io/openems/edge/goodwe/et/ess/EssChannelId.java | 6 ------ .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 6 ------ 2 files changed, 12 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java index 53ee13d5881..5cc003c67c2 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java @@ -294,12 +294,6 @@ public enum EssChannelId implements ChannelId { BATTERY_PROTOCOL(Doc.of(OpenemsType.INTEGER) // .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - - BMS_ALLOWED_CHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - - BMS_ALLOWED_DISCHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // // Setting Parameter USER_PASSWORD1(Doc.of(OpenemsType.STRING) // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 39c0f1777db..f17feb97f27 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -506,12 +506,6 @@ private void updatechannels() { * Update Allowed charge and Allowed discharge */ -// IntegerReadChannel allowedCharge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); -// Integer allowedChargePower = allowedCharge.value().get(); -// -// IntegerReadChannel allowedDischarge = this.channel(EssChannelId.BMS_ALLOWED_CHARGE); -// Integer allowedDischargePower = allowedDischarge.value().get(); -// // System.out.println( // "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); From 62edc9bdec5f48221d670ca176a77ebb895e36b8 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 20 Oct 2020 20:46:36 +0200 Subject: [PATCH 11/23] Align comments with code --- .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index f17feb97f27..f523141915b 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -405,12 +405,12 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx activePower = 0; } else { if (activePower < 0) { - // ActivePower is negative or zero -> CHARGE + // ActivePower is negative -> CHARGE System.out.println(" Setting Charging"); nextPowerMode = PowerModeEms.CHARGE_BAT; } else { - // ActivePower is positive -> DISCHARGE + // ActivePower is positive or zero -> DISCHARGE System.out.println(" Setting Discharging"); Integer soc = this.getSoc().get(); if (soc == 100 || activePower == 0) { From 4bfac2befc8cbfe944650d195634921262c828a7 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 20 Oct 2020 20:49:07 +0200 Subject: [PATCH 12/23] Drop unused channels (2nd try) --- .../edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index f523141915b..d872185b1e8 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -211,10 +211,6 @@ protected ModbusProtocol defineModbusProtocol() { m(EssChannelId.P_BATTERY1, new SignedWordElement(35183)), // m(EssChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // -// new FC3ReadRegistersTask(37102, Priority.HIGH, // -// m(EssChannelId.BMS_ALLOWED_CHARGE, new UnsignedWordElement(37102)), // -// m(EssChannelId.BMS_ALLOWED_DISCHARGE, new SignedWordElement(37104))), // - new FC3ReadRegistersTask(35185, Priority.LOW, // m(EssChannelId.WARNING_CODE, new UnsignedWordElement(35185)), // m(EssChannelId.SAFETY_COUNTRY, new UnsignedWordElement(35186)), // From 3bcf7a7af81386059b41d5b6dcf4ae70295a52ee Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 20 Oct 2020 22:20:44 +0200 Subject: [PATCH 13/23] Add JUnit tests according to definition of scenarios --- io.openems.edge.goodwe.et/bnd.bnd | 3 +- .../edge/goodwe/et/charger/ConfigPV1.java | 3 + .../edge/goodwe/et/charger/ConfigPV2.java | 3 + .../io/openems/edge/goodwe/et/ess/Config.java | 4 +- .../edge/goodwe/et/charger/MyConfig.java | 85 +++++++++++++++ .../ess/GoodWeEtBatteryInverterImplTest.java | 98 +++++++++++++++++ .../openems/edge/goodwe/et/ess/MyConfig.java | 102 ++++++++++++++++++ 7 files changed, 295 insertions(+), 3 deletions(-) create mode 100644 io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java create mode 100644 io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java create mode 100644 io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java diff --git a/io.openems.edge.goodwe.et/bnd.bnd b/io.openems.edge.goodwe.et/bnd.bnd index ae28dcb026e..6410f917d14 100644 --- a/io.openems.edge.goodwe.et/bnd.bnd +++ b/io.openems.edge.goodwe.et/bnd.bnd @@ -13,4 +13,5 @@ Bundle-Version: 1.0.0.${tstamp} io.openems.edge.timedata.api -testpath: \ - ${testpath} + ${testpath},\ + com.ghgande.j2mod diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java index 3481f3f6e4a..034412ddecc 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java @@ -31,5 +31,8 @@ @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus bridge.") String modbus_id() default "modbus0"; + @AttributeDefinition(name = "Modbus target filter", description = "This is auto-generated by 'Modbus-ID'.") + String Modbus_target() default ""; + String webconsole_configurationFactory_nameHint() default "GoodWe ET Charger PV1 [{id}]"; } \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java index b97a1d00b6c..c01a039030e 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java @@ -31,5 +31,8 @@ @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus bridge.") String modbus_id() default "modbus0"; + @AttributeDefinition(name = "Modbus target filter", description = "This is auto-generated by 'Modbus-ID'.") + String Modbus_target() default ""; + String webconsole_configurationFactory_nameHint() default "GoodWe ET Charger PV2 [{id}]"; } \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java index 3ba3a94d99f..c5ebf989eed 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java @@ -27,8 +27,8 @@ @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus brige.") String modbus_id() default "modbus0"; - - @AttributeDefinition(name = "Capacity", description = "Capacity of the battery in Wh") + + @AttributeDefinition(name = "Capacity", description = "Capacity of the battery in [Wh]") int capacity() default 9_000; @AttributeDefinition(name = "Maximum power", description = "Maximum charge/discharge power in [W]") diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java new file mode 100644 index 00000000000..aa7cada7d92 --- /dev/null +++ b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java @@ -0,0 +1,85 @@ +package io.openems.edge.goodwe.et.charger; + +import io.openems.common.utils.ConfigUtils; +import io.openems.edge.common.test.AbstractComponentConfig; + +@SuppressWarnings("all") +public class MyConfig extends AbstractComponentConfig implements ConfigPV1 { + + public static class Builder { + private String id = null; + public String essId; + public int unitId; + public String modbusId; + + private Builder() { + + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Builder setEssId(String essId) { + this.essId = essId; + return this; + } + + public Builder setModbusId(String modbusId) { + this.modbusId = modbusId; + return this; + } + + public Builder setUnitId(int unitId) { + this.unitId = unitId; + return this; + } + + public MyConfig build() { + return new MyConfig(this); + } + } + + /** + * Create a Config builder. + * + * @return a {@link Builder} + */ + public static Builder create() { + return new Builder(); + } + + private final Builder builder; + + private MyConfig(Builder builder) { + super(ConfigPV1.class, builder.id); + this.builder = builder; + } + + @Override + public int unit_id() { + return this.builder.unitId; + } + + @Override + public String modbus_id() { + return this.builder.modbusId; + } + + @Override + public String Modbus_target() { + return ConfigUtils.generateReferenceTargetFilter(this.id(), this.modbus_id()); + } + + @Override + public String ess_id() { + return this.builder.essId; + } + + @Override + public String Ess_target() { + return ConfigUtils.generateReferenceTargetFilter(this.id(), this.ess_id()); + } + +} \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java new file mode 100644 index 00000000000..83991686b37 --- /dev/null +++ b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java @@ -0,0 +1,98 @@ +package io.openems.edge.goodwe.et.ess; + +import org.junit.Test; + +import io.openems.common.types.ChannelAddress; +import io.openems.edge.bridge.modbus.test.DummyModbusBridge; +import io.openems.edge.common.test.AbstractComponentTest.TestCase; +import io.openems.edge.common.test.ComponentTest; +import io.openems.edge.common.test.DummyConfigurationAdmin; +import io.openems.edge.ess.test.DummyPower; +import io.openems.edge.ess.test.ManagedSymmetricEssTest; +import io.openems.edge.goodwe.et.GoodWeEtConstants; +import io.openems.edge.goodwe.et.charger.GoodWeEtChargerPv1; + +public class GoodWeEtBatteryInverterImplTest { + + private static final String MODBUS_ID = "modbus0"; + + private static final String ESS_ID = "ess0"; + private static final ChannelAddress ESS_SET_ACTIVE_POWER_EQUALS = new ChannelAddress(ESS_ID, + "SetActivePowerEquals"); + private static final ChannelAddress ESS_SOC = new ChannelAddress(ESS_ID, "Soc"); + private static final ChannelAddress ESS_EMS_POWER_MODE = new ChannelAddress(ESS_ID, "EmsPowerMode"); + private static final ChannelAddress ESS_EMS_POWER_SET = new ChannelAddress(ESS_ID, "EmsPowerSet"); + + private static final String CHARGER_ID = "charger0"; + private static final ChannelAddress CHARGER_ACTUAL_POWER = new ChannelAddress(CHARGER_ID, "ActualPower"); + + @Test + public void test() throws Exception { + GoodWeEtChargerPv1 charger = new GoodWeEtChargerPv1(); + new ComponentTest(charger) // + .addReference("cm", new DummyConfigurationAdmin()) // + .addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // + .activate(io.openems.edge.goodwe.et.charger.MyConfig.create() // + .setId(CHARGER_ID) // + .setEssId(ESS_ID) // + .setModbusId(MODBUS_ID) // + .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .build()); + + GoodWeEtBatteryInverterImpl ess = new GoodWeEtBatteryInverterImpl(); + ess.addCharger(charger); + new ManagedSymmetricEssTest(ess) // + .addReference("power", new DummyPower()) // + .addReference("cm", new DummyConfigurationAdmin()) // + .addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // + .addComponent(charger) // + .activate(MyConfig.create() // + .setId(ESS_ID) // + .setModbusId(MODBUS_ID) // + .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .setCapacity(9_000) // + .setMaxBatteryPower(5_200) // + .setReadOnlyMode(false) // + .build()) // + .next(new TestCase("Scenario 1: (set-point is positive && set-point is lower than pv production)") // + .input(CHARGER_ACTUAL_POWER, 5_000) // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.CHARGE_BAT) // + .output(ESS_EMS_POWER_SET, 2000)) // + .next(new TestCase("Scenario 2: (set-point is positive && set-Point is bigger than pv production)") // + .input(CHARGER_ACTUAL_POWER, 5_000) // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 8_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_PV) // + .output(ESS_EMS_POWER_SET, 3000)) // + .next(new TestCase( + "Scenario 3: (set-point is negative && PV-Power is smaller than max charge power of the battery)") // + .input(CHARGER_ACTUAL_POWER, 3_000) // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, -2_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.CHARGE_BAT) // + .output(ESS_EMS_POWER_SET, 5_000)) // + .next(new TestCase( + "Scenario 4: (set-point is negative && PV-Power equals max charge power of the battery)") // + .input(CHARGER_ACTUAL_POWER, 3_000) // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, -4_000)) // + // TODO .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_PV) // + // TODO .output(ESS_EMS_POWER_SET, 3000)) // + .next(new TestCase("Scenario 5: (set-point is positive && set-point is higher than pv production)") // + .input(CHARGER_ACTUAL_POWER, 3_000) // + .input(ESS_SOC, 100) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 8_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_BAT) // + .output(ESS_EMS_POWER_SET, 5_000)) // + .next(new TestCase("Scenario 6: (set-point is positive && set-point is lower than pv production)") // + .input(CHARGER_ACTUAL_POWER, 5_000) // + .input(ESS_SOC, 100) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000)) // + // TODO .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_BAT) // + // TODO .output(ESS_EMS_POWER_SET, 5_000)) // + ; + } + +} diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java new file mode 100644 index 00000000000..7de5cc6d14e --- /dev/null +++ b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java @@ -0,0 +1,102 @@ +package io.openems.edge.goodwe.et.ess; + +import io.openems.common.utils.ConfigUtils; +import io.openems.edge.common.test.AbstractComponentConfig; + +@SuppressWarnings("all") +public class MyConfig extends AbstractComponentConfig implements Config { + + protected static class Builder { + private String id = null; + public boolean readOnlyMode; + public int unitId; + public String modbusId; + public int capacity; + public int maxBatteryPower; + + private Builder() { + + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Builder setCapacity(int capacity) { + this.capacity = capacity; + return this; + } + + public Builder setMaxBatteryPower(int maxBatteryPower) { + this.maxBatteryPower = maxBatteryPower; + return this; + } + + public Builder setModbusId(String modbusId) { + this.modbusId = modbusId; + return this; + } + + public Builder setReadOnlyMode(boolean readOnlyMode) { + this.readOnlyMode = readOnlyMode; + return this; + } + + public Builder setUnitId(int unitId) { + this.unitId = unitId; + return this; + } + + public MyConfig build() { + return new MyConfig(this); + } + } + + /** + * Create a Config builder. + * + * @return a {@link Builder} + */ + public static Builder create() { + return new Builder(); + } + + private final Builder builder; + + private MyConfig(Builder builder) { + super(Config.class, builder.id); + this.builder = builder; + } + + @Override + public boolean readOnlyMode() { + return this.builder.readOnlyMode; + } + + @Override + public int unit_id() { + return this.builder.unitId; + } + + @Override + public String modbus_id() { + return this.builder.modbusId; + } + + @Override + public int capacity() { + return this.builder.capacity; + } + + @Override + public int maxBatteryPower() { + return this.builder.maxBatteryPower; + } + + @Override + public String Modbus_target() { + return ConfigUtils.generateReferenceTargetFilter(this.id(), this.modbus_id()); + } + +} \ No newline at end of file From b29a80942249842288c606a6b461e49c4fc40758 Mon Sep 17 00:00:00 2001 From: venu-sagar Date: Thu, 22 Oct 2020 16:51:42 +0200 Subject: [PATCH 14/23] rework on apply power funtion and converting it into a state machine --- .../common/test/AbstractComponentTest.java | 3 + .../edge/goodwe/et/ess/EssChannelId.java | 3 + .../et/ess/GoodWeEtBatteryInverterImpl.java | 142 ++++++++++++----- .../applypower/ApplyPowerStateMachine.java | 145 ++++++++++++++++++ .../goodwe/et/ess/applypower/Context.java | 34 ++++ .../EmptyNegativeChargeHandler.java | 17 ++ .../applypower/EmptyPositivePvHandler.java | 17 ++ .../FullNegativeCurtailHandler.java | 17 ++ .../FullPositiveCurtailHandler.java | 17 ++ .../FullPositiveDischargeHandler.java | 16 ++ .../InBetweenNegativeChargeHandler.java | 17 ++ .../InBetweenPositiveChargeHandler.java | 17 ++ .../InBetweenPositiveDischargeHandler.java | 16 ++ .../et/ess/applypower/ReadOnlyHandler.java | 16 ++ .../et/ess/applypower/UndefinedHandler.java | 16 ++ .../ess/GoodWeEtBatteryInverterImplTest.java | 23 +-- 16 files changed, 469 insertions(+), 47 deletions(-) create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java diff --git a/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java b/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java index 8dfbbdf3ac2..e02fe5daaae 100644 --- a/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java +++ b/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java @@ -182,6 +182,9 @@ protected void validateOutputs(Map components) throws gotText = Objects.toString(got); } } + if (got instanceof OptionsEnum) { + gotText = ((OptionsEnum) got).getName(); + } if (!Objects.equals(expected, got)) { throw new Exception("On TestCase [" + this.description + "]: " // + "expected [" + output.value + "] " // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java index 5cc003c67c2..b2896e75a32 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java @@ -6,8 +6,11 @@ import io.openems.common.types.OpenemsType; import io.openems.edge.common.channel.ChannelId; import io.openems.edge.common.channel.Doc; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; public enum EssChannelId implements ChannelId { + APPLY_POWER_STATE_MACHINE(Doc.of(ApplyPowerStateMachine.State.values())), + MODBUS_PROTOCOL_VERSION(Doc.of(OpenemsType.INTEGER) // .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), RATED_POWER(Doc.of(OpenemsType.INTEGER) // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index d872185b1e8..6f4e8d03712 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -49,6 +49,8 @@ import io.openems.edge.ess.power.api.Pwr; import io.openems.edge.ess.power.api.Relationship; import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; +import io.openems.edge.goodwe.et.ess.applypower.Context; import io.openems.edge.timedata.api.Timedata; import io.openems.edge.timedata.api.TimedataProvider; import io.openems.edge.timedata.api.utils.CalculateEnergyFromPower; @@ -83,6 +85,9 @@ public class GoodWeEtBatteryInverterImpl extends AbstractOpenemsModbusComponent private final Set chargers = new HashSet<>(); + private final ApplyPowerStateMachine applyPowerStateMachine = new ApplyPowerStateMachine( + ApplyPowerStateMachine.State.UNDEFINED); + @Reference(policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.MANDATORY) protected void setModbus(BridgeModbus modbus) { super.setModbus(modbus); @@ -391,49 +396,98 @@ protected ModbusProtocol defineModbusProtocol() { @Override public void applyPower(int activePower, int reactivePower) throws OpenemsNamedException { - final PowerModeEms nextPowerMode; + int pvProduction = getPvProduction(); + int soc = this.getSoc().orElse(0); + ApplyPowerStateMachine.State state = ApplyPowerStateMachine.evaluateState(config.readOnlyMode(), pvProduction, + soc, activePower); - System.out.println("Active power:" + activePower); + // Store the current State + this.channel(EssChannelId.APPLY_POWER_STATE_MACHINE).setNextValue(state); - if (this.config.readOnlyMode()) { - // Read-Only-Mode: fall-back to internal self-consumption optimization - nextPowerMode = PowerModeEms.AUTO; - activePower = 0; - } else { - if (activePower < 0) { - // ActivePower is negative -> CHARGE - System.out.println(" Setting Charging"); - nextPowerMode = PowerModeEms.CHARGE_BAT; - - } else { - // ActivePower is positive or zero -> DISCHARGE - System.out.println(" Setting Discharging"); - Integer soc = this.getSoc().get(); - if (soc == 100 || activePower == 0) { - nextPowerMode = PowerModeEms.EXPORT_AC; - } else { - nextPowerMode = PowerModeEms.DISCHARGE_PV; - } - } - } + // Prepare Context + Context context = new Context(this, pvProduction, activePower); - // Set the PowerMode and PowerSet - IntegerWriteChannel emsPowerSetChannel = this.channel(EssChannelId.EMS_POWER_SET); + this.applyPowerStateMachine.forceNextState(state); + this.applyPowerStateMachine.run(context); // apply the force next state + this.applyPowerStateMachine.run(context); // execute correct handler - Integer essPowerSet = emsPowerSetChannel.value().get(); - if (essPowerSet == null || activePower != essPowerSet) { - // Set to new power mode only if the previous activePower is different or - // undefined - emsPowerSetChannel.setNextWriteValue(Math.abs(activePower)); - } + IntegerWriteChannel emsPowerSetChannel = this.channel(EssChannelId.EMS_POWER_SET); + emsPowerSetChannel.setNextWriteValue(context.getEssPowerSet()); EnumWriteChannel emsPowerModeChannel = this.channel(EssChannelId.EMS_POWER_MODE); - PowerModeEms emsPowerMode = emsPowerModeChannel.value().asEnum(); - if (emsPowerMode != nextPowerMode) { - // Set to new power mode only if the previous mode is different - emsPowerModeChannel.setNextWriteValue(nextPowerMode); - } - // TODO : Add Reactive Power Register + emsPowerModeChannel.setNextWriteValue(context.getNextPowerMode()); + +// final PowerModeEms nextPowerMode; +// final Integer essPowerSet; +// +// System.out.println("Active power:" + activePower); +// +// if (this.config.readOnlyMode()) { +// // Read-Only-Mode: fall-back to internal self-consumption optimization +// +// +// } else { +// int pvProduction = getPvProduction(); +// int soc = this.getSoc().orElse(0); +// +// if (soc > 99) { +// // battery is full +// if (activePower > 0) { +// // Set-Point is positive -> take power either from pv or battery +// if (activePower > pvProduction) { +// // Senario 5 +// essPowerSet = activePower - pvProduction; +// nextPowerMode = PowerModeEms.DISCHARGE_BAT; +// +// } else { +// // Senario 6 +// essPowerSet = pvProduction - activePower; +// nextPowerMode = PowerModeEms.EXPORT_AC; +// } +// } else { +// // Set-Point is negative or zero -> this should never happen and should be +// // restricted by allowed charge power +// essPowerSet = 0; +// nextPowerMode = PowerModeEms.EXPORT_AC; // curtail PV to zero +// } +// +// } else if (soc < 1) { +// // battery is empty +// // TODO define when battery is empty +// if (activePower > 0) { +// // Set-Point is positive -> 'discharge' the pv production +// essPowerSet = pvProduction - activePower; // TODO define +// nextPowerMode = PowerModeEms.CHARGE_BAT; // TODO define +// +// } else { +// // Set-Point is negative or zero -> 'charge' from pv production and grid +// essPowerSet = pvProduction - activePower; // TODO define +// nextPowerMode = PowerModeEms.CHARGE_BAT; // TODO define +// } +// +// } else { +// // battery is neither empty nor full +// if (activePower > 0) { +// // Set-Point is positive +// if (activePower > pvProduction) { +// // Scenario 2 +// essPowerSet = pvProduction - activePower; +// nextPowerMode = PowerModeEms.CHARGE_BAT; +// } else { +// // Scenario 1 +// essPowerSet = activePower - pvProduction; +// nextPowerMode = PowerModeEms.DISCHARGE_PV; +// } +// +// } else { +// // Set-Point is negative or zero +// // Scenario 3 +// essPowerSet = pvProduction - activePower; +// nextPowerMode = PowerModeEms.CHARGE_BAT; +// } +// } +// } + } @Override @@ -589,4 +643,18 @@ public Integer getSurplusPower() { return productionPower; } + /** + * Gets the PV production. Returns 0 if the PV production is not available. + * + * @return production power + */ + private int getPvProduction() { + int productionPower = 0; + for (AbstractGoodWeEtCharger charger : this.chargers) { + productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); + } + + return productionPower; + } + } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java new file mode 100644 index 00000000000..cccaf72f613 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java @@ -0,0 +1,145 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.common.types.OptionsEnum; +import io.openems.edge.common.statemachine.AbstractStateMachine; +import io.openems.edge.common.statemachine.StateHandler; + +public class ApplyPowerStateMachine extends AbstractStateMachine { + + public enum State implements io.openems.edge.common.statemachine.State, OptionsEnum { + UNDEFINED(-1), // + + READ_ONLY(10), // + + FULL_POSITIVE_DISCHARGE(20), // + FULL_POSITIVE_CURTAIL(21), // + FULL_NEGATIVE_CURTAIL(21), // + + EMPTY_POSITIVE_PV(30), // + EMPTY_NEGATIVE_CHARGE(31), // + + INBETWEEN_POSITIVE_DISCHARGE(41), // + INBETWEEN_POSITIVE_CHARGE(42), // + INBETWEEN_NEGATIVE_CHARGE(43) // + ; + + private final int value; + + private State(int value) { + this.value = value; + } + + @Override + public int getValue() { + return this.value; + } + + @Override + public String getName() { + return this.name(); + } + + @Override + public OptionsEnum getUndefined() { + return UNDEFINED; + } + + @Override + public State[] getStates() { + return State.values(); + } + } + + public ApplyPowerStateMachine(State initialState) { + super(initialState); + } + + @Override + public StateHandler getStateHandler(State state) { + switch (state) { + case UNDEFINED: + return new UndefinedHandler(); + case READ_ONLY: + return new ReadOnlyHandler(); + case EMPTY_NEGATIVE_CHARGE: + return new EmptyNegativeChargeHandler(); + case EMPTY_POSITIVE_PV: + return new EmptyPositivePvHandler(); + case FULL_NEGATIVE_CURTAIL: + return new FullNegativeCurtailHandler(); + case FULL_POSITIVE_CURTAIL: + return new FullPositiveCurtailHandler(); + case FULL_POSITIVE_DISCHARGE: + return new FullPositiveDischargeHandler(); + case INBETWEEN_NEGATIVE_CHARGE: + return new InBetweenNegativeChargeHandler(); + case INBETWEEN_POSITIVE_CHARGE: + return new InBetweenPositiveChargeHandler(); + case INBETWEEN_POSITIVE_DISCHARGE: + return new InBetweenPositiveDischargeHandler(); + default: + break; + } + throw new IllegalArgumentException("Unknown State [" + state + "]"); + } + + /** + * Evaluates the State we are currently in. + * + * @param readOnlyMode + * @param pvProduction + * @param soc + * @param activePowerSetPoint + * @return + */ + public static State evaluateState(boolean readOnlyMode, int pvProduction, int soc, int activePowerSetPoint) { + if (readOnlyMode) { + // Read-Only-Mode: fall-back to internal self-consumption optimization + return State.READ_ONLY; + + } else { + if (soc > 99) { + // battery is full + if (activePowerSetPoint > 0) { + // Set-Point is positive -> take power either from pv or battery + if (activePowerSetPoint > pvProduction) { + return State.FULL_POSITIVE_DISCHARGE; + + } else { + return State.FULL_POSITIVE_CURTAIL; + } + } else { + return State.FULL_NEGATIVE_CURTAIL; + } + + } else if (soc < 1) { + // battery is empty + // TODO define when battery is empty + if (activePowerSetPoint > 0) { + return State.EMPTY_POSITIVE_PV; + + } else { + // Set-Point is negative or zero -> 'charge' from pv production and grid + return State.EMPTY_NEGATIVE_CHARGE; + } + + } else { + // battery is neither empty nor full + if (activePowerSetPoint > 0) { + // Set-Point is positive + if (activePowerSetPoint > pvProduction) { + return State.INBETWEEN_POSITIVE_DISCHARGE; + + } else { + return State.INBETWEEN_POSITIVE_CHARGE; + + } + + } else { + // Set-Point is negative or zero + return State.INBETWEEN_NEGATIVE_CHARGE; + } + } + } + } +} \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java new file mode 100644 index 00000000000..ecd575ecbcf --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java @@ -0,0 +1,34 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.goodwe.et.ess.GoodWeEtBatteryInverterImpl; +import io.openems.edge.goodwe.et.ess.PowerModeEms; + +public class Context { + + protected final GoodWeEtBatteryInverterImpl component; + protected final int pvProduction; + protected final int activePowerSetPoint; + + private PowerModeEms nextPowerMode; + private int essPowerSet; + + public Context(GoodWeEtBatteryInverterImpl component, int pvProduction, int activePowerSetPoint) { + super(); + this.component = component; + this.pvProduction = pvProduction; + this.activePowerSetPoint = activePowerSetPoint; + } + + protected void setMode(PowerModeEms nextPowerMode, int essPowerSet) { + this.nextPowerMode = nextPowerMode; + this.essPowerSet = essPowerSet; + } + + public int getEssPowerSet() { + return essPowerSet; + } + + public PowerModeEms getNextPowerMode() { + return nextPowerMode; + } +} \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java new file mode 100644 index 00000000000..49ad20df34e --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class EmptyNegativeChargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); + + return State.EMPTY_NEGATIVE_CHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java new file mode 100644 index 00000000000..cb985b99078 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class EmptyPositivePvHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); + + return State.EMPTY_POSITIVE_PV; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java new file mode 100644 index 00000000000..4391edff741 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class FullNegativeCurtailHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.EXPORT_AC, 0); + + return State.FULL_NEGATIVE_CURTAIL; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java new file mode 100644 index 00000000000..10ae4faf67c --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class FullPositiveCurtailHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.EXPORT_AC, context.activePowerSetPoint); + + return State.FULL_POSITIVE_CURTAIL; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java new file mode 100644 index 00000000000..2e47844a457 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java @@ -0,0 +1,16 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class FullPositiveDischargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + context.setMode(PowerModeEms.DISCHARGE_BAT, context.activePowerSetPoint - context.pvProduction); + + return State.FULL_POSITIVE_DISCHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java new file mode 100644 index 00000000000..beb1bf8e09c --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class InBetweenNegativeChargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); + + return State.INBETWEEN_NEGATIVE_CHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java new file mode 100644 index 00000000000..911c66892cf --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class InBetweenPositiveChargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); + + return State.INBETWEEN_POSITIVE_CHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java new file mode 100644 index 00000000000..5925d985b0d --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java @@ -0,0 +1,16 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class InBetweenPositiveDischargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + context.setMode(PowerModeEms.DISCHARGE_PV, context.activePowerSetPoint - context.pvProduction); + + return State.INBETWEEN_POSITIVE_DISCHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java new file mode 100644 index 00000000000..3ef25e9252f --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java @@ -0,0 +1,16 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class ReadOnlyHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + context.setMode(PowerModeEms.AUTO, 0); + + return State.READ_ONLY; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java new file mode 100644 index 00000000000..d38d27ade48 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java @@ -0,0 +1,16 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class UndefinedHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + context.setMode(PowerModeEms.AUTO, 0); + + return State.UNDEFINED; + } + +} diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java index 83991686b37..8e6f7efe0ea 100644 --- a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java +++ b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java @@ -73,13 +73,16 @@ public void test() throws Exception { .input(ESS_SET_ACTIVE_POWER_EQUALS, -2_000) // .output(ESS_EMS_POWER_MODE, PowerModeEms.CHARGE_BAT) // .output(ESS_EMS_POWER_SET, 5_000)) // - .next(new TestCase( - "Scenario 4: (set-point is negative && PV-Power equals max charge power of the battery)") // - .input(CHARGER_ACTUAL_POWER, 3_000) // - .input(ESS_SOC, 50) // - .input(ESS_SET_ACTIVE_POWER_EQUALS, -4_000)) // - // TODO .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_PV) // - // TODO .output(ESS_EMS_POWER_SET, 3000)) // + // Impossible scenario. We limit allowed charge/discharge power so that this + // falls back to scenario 3 + // .next(new TestCase( + // "Scenario 4: (set-point is negative && PV-Power equals max charge power of + // the battery)") // + // .input(CHARGER_ACTUAL_POWER, 3_000) // + // .input(ESS_SOC, 50) // + // .input(ESS_SET_ACTIVE_POWER_EQUALS, -2_000) // + // .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_PV) // + // .output(ESS_EMS_POWER_SET, 3000)) // .next(new TestCase("Scenario 5: (set-point is positive && set-point is higher than pv production)") // .input(CHARGER_ACTUAL_POWER, 3_000) // .input(ESS_SOC, 100) // @@ -89,9 +92,9 @@ public void test() throws Exception { .next(new TestCase("Scenario 6: (set-point is positive && set-point is lower than pv production)") // .input(CHARGER_ACTUAL_POWER, 5_000) // .input(ESS_SOC, 100) // - .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000)) // - // TODO .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_BAT) // - // TODO .output(ESS_EMS_POWER_SET, 5_000)) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.EXPORT_AC) // + .output(ESS_EMS_POWER_SET, 3_000)) // ; } From 6d67c0de9af082fb05fddd58286c8a96ea044972 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 27 Oct 2020 21:53:28 +0100 Subject: [PATCH 15/23] Integrate BT + refactoring - Add Channel "GoodweType": holds automatically detected information if it is a ET or BT - Add special handling for BT - Rename State-Machine States for BT and ET --- .../edge/goodwe/et/ess/EssChannelId.java | 4 +- .../et/ess/GoodWeEtBatteryInverterImpl.java | 119 +++++--------- .../edge/goodwe/et/ess/GoodweType.java | 32 ++++ .../applypower/ApplyPowerStateMachine.java | 151 +++++++++++------- .../et/ess/applypower/BtChargeHandler.java | 17 ++ .../et/ess/applypower/BtDischargeHandler.java | 17 ++ ...java => EtEmptyNegativeChargeHandler.java} | 4 +- ...ler.java => EtEmptyPositivePvHandler.java} | 4 +- ...java => EtFullNegativeCurtailHandler.java} | 4 +- ...java => EtFullPositiveCurtailHandler.java} | 4 +- ...va => EtFullPositiveDischargeHandler.java} | 4 +- ... => EtInbetweenNegativeChargeHandler.java} | 4 +- ... => EtInbetweenPositiveChargeHandler.java} | 4 +- ... EtInbetweenPositiveDischargeHandler.java} | 4 +- .../ess/GoodWeEtBatteryInverterImplTest.java | 33 +++- 15 files changed, 253 insertions(+), 152 deletions(-) create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java create mode 100644 io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{EmptyNegativeChargeHandler.java => EtEmptyNegativeChargeHandler.java} (76%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{EmptyPositivePvHandler.java => EtEmptyPositivePvHandler.java} (78%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{FullNegativeCurtailHandler.java => EtFullNegativeCurtailHandler.java} (74%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{FullPositiveCurtailHandler.java => EtFullPositiveCurtailHandler.java} (75%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{FullPositiveDischargeHandler.java => EtFullPositiveDischargeHandler.java} (76%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{InBetweenNegativeChargeHandler.java => EtInbetweenNegativeChargeHandler.java} (75%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{InBetweenPositiveChargeHandler.java => EtInbetweenPositiveChargeHandler.java} (75%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/{InBetweenPositiveDischargeHandler.java => EtInbetweenPositiveDischargeHandler.java} (74%) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java index b2896e75a32..98bf982cf7d 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java @@ -18,8 +18,8 @@ public enum EssChannelId implements ChannelId { AC_OUTPUT_TYPE(Doc.of(OutputTypeAC.values())), // SERIAL_NUMBER(Doc.of(OpenemsType.STRING) // .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - DEVICE_TYPE(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + GOODWE_TYPE(Doc.of(GoodweType.values()) // + .accessMode(AccessMode.READ_ONLY)), DSP1_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), DSP2_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index 6f4e8d03712..cc111492b2a 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -17,6 +17,8 @@ import org.osgi.service.event.EventConstants; import org.osgi.service.event.EventHandler; import org.osgi.service.metatype.annotations.Designate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import io.openems.common.exceptions.OpenemsError.OpenemsNamedException; import io.openems.common.types.OpenemsType; @@ -27,6 +29,7 @@ import io.openems.edge.bridge.modbus.api.element.BitsWordElement; import io.openems.edge.bridge.modbus.api.element.DummyRegisterElement; import io.openems.edge.bridge.modbus.api.element.SignedWordElement; +import io.openems.edge.bridge.modbus.api.element.StringWordElement; import io.openems.edge.bridge.modbus.api.element.UnsignedDoublewordElement; import io.openems.edge.bridge.modbus.api.element.UnsignedWordElement; import io.openems.edge.bridge.modbus.api.task.FC16WriteRegistersTask; @@ -35,6 +38,7 @@ import io.openems.edge.common.channel.EnumReadChannel; import io.openems.edge.common.channel.EnumWriteChannel; import io.openems.edge.common.channel.IntegerWriteChannel; +import io.openems.edge.common.channel.value.Value; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.event.EdgeEventConstants; import io.openems.edge.common.sum.GridMode; @@ -65,6 +69,8 @@ public class GoodWeEtBatteryInverterImpl extends AbstractOpenemsModbusComponent implements GoodWeEtBatteryInverter, HybridEss, ManagedSymmetricEss, SymmetricEss, OpenemsComponent, TimedataProvider, EventHandler { + private final Logger log = LoggerFactory.getLogger(GoodWeEtBatteryInverterImpl.class); + protected EnumWriteChannel setEmsPowerMode; private Config config; @@ -125,7 +131,24 @@ protected ModbusProtocol defineModbusProtocol() { return new ModbusProtocol(this, // new FC3ReadRegistersTask(35001, Priority.ONCE, // - m(SymmetricEss.ChannelId.MAX_APPARENT_POWER, new UnsignedWordElement(35001))), // + m(SymmetricEss.ChannelId.MAX_APPARENT_POWER, new UnsignedWordElement(35001)), // + new DummyRegisterElement(35002), // + m(EssChannelId.SERIAL_NUMBER, new StringWordElement(35003, 8)), // + m(EssChannelId.GOODWE_TYPE, new StringWordElement(35011, 5), + new ElementToChannelConverter((value) -> { + String stringValue = TypeUtils.getAsType(OpenemsType.STRING, value); + switch (stringValue) { + case "GW10K-BT": + this.logInfo(this.log, "Identified GoodWe GW10K-BT"); + return GoodweType.GOODWE_10K_BT; + case "GW10K-ET": + this.logInfo(this.log, "Identified GoodWe GW10K-ET"); + return GoodweType.GOODWE_10K_ET; + default: + this.logError(this.log, "Unable to identify GoodWe [" + stringValue + "]"); + return GoodweType.UNDEFINED; + } + }))), // new FC3ReadRegistersTask(35111, Priority.LOW, // m(EssChannelId.V_PV3, new UnsignedWordElement(35111), @@ -398,8 +421,8 @@ protected ModbusProtocol defineModbusProtocol() { public void applyPower(int activePower, int reactivePower) throws OpenemsNamedException { int pvProduction = getPvProduction(); int soc = this.getSoc().orElse(0); - ApplyPowerStateMachine.State state = ApplyPowerStateMachine.evaluateState(config.readOnlyMode(), pvProduction, - soc, activePower); + ApplyPowerStateMachine.State state = ApplyPowerStateMachine.evaluateState(this.getDeviceType(), + config.readOnlyMode(), pvProduction, soc, activePower); // Store the current State this.channel(EssChannelId.APPLY_POWER_STATE_MACHINE).setNextValue(state); @@ -416,78 +439,6 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx EnumWriteChannel emsPowerModeChannel = this.channel(EssChannelId.EMS_POWER_MODE); emsPowerModeChannel.setNextWriteValue(context.getNextPowerMode()); - -// final PowerModeEms nextPowerMode; -// final Integer essPowerSet; -// -// System.out.println("Active power:" + activePower); -// -// if (this.config.readOnlyMode()) { -// // Read-Only-Mode: fall-back to internal self-consumption optimization -// -// -// } else { -// int pvProduction = getPvProduction(); -// int soc = this.getSoc().orElse(0); -// -// if (soc > 99) { -// // battery is full -// if (activePower > 0) { -// // Set-Point is positive -> take power either from pv or battery -// if (activePower > pvProduction) { -// // Senario 5 -// essPowerSet = activePower - pvProduction; -// nextPowerMode = PowerModeEms.DISCHARGE_BAT; -// -// } else { -// // Senario 6 -// essPowerSet = pvProduction - activePower; -// nextPowerMode = PowerModeEms.EXPORT_AC; -// } -// } else { -// // Set-Point is negative or zero -> this should never happen and should be -// // restricted by allowed charge power -// essPowerSet = 0; -// nextPowerMode = PowerModeEms.EXPORT_AC; // curtail PV to zero -// } -// -// } else if (soc < 1) { -// // battery is empty -// // TODO define when battery is empty -// if (activePower > 0) { -// // Set-Point is positive -> 'discharge' the pv production -// essPowerSet = pvProduction - activePower; // TODO define -// nextPowerMode = PowerModeEms.CHARGE_BAT; // TODO define -// -// } else { -// // Set-Point is negative or zero -> 'charge' from pv production and grid -// essPowerSet = pvProduction - activePower; // TODO define -// nextPowerMode = PowerModeEms.CHARGE_BAT; // TODO define -// } -// -// } else { -// // battery is neither empty nor full -// if (activePower > 0) { -// // Set-Point is positive -// if (activePower > pvProduction) { -// // Scenario 2 -// essPowerSet = pvProduction - activePower; -// nextPowerMode = PowerModeEms.CHARGE_BAT; -// } else { -// // Scenario 1 -// essPowerSet = activePower - pvProduction; -// nextPowerMode = PowerModeEms.DISCHARGE_PV; -// } -// -// } else { -// // Set-Point is negative or zero -// // Scenario 3 -// essPowerSet = pvProduction - activePower; -// nextPowerMode = PowerModeEms.CHARGE_BAT; -// } -// } -// } - } @Override @@ -657,4 +608,22 @@ private int getPvProduction() { return productionPower; } + /** + * Gets the Channel for {@link EssChannelId#GOODWE_TYPE}. + * + * @return the Channel + */ + private Channel getDeviceTypeChannel() { + return this.channel(EssChannelId.GOODWE_TYPE); + } + + /** + * Gets the Device Type. See {@link EssChannelId#GOODWE_TYPE}. + * + * @return the Channel {@link Value} + */ + private GoodweType getDeviceType() { + return this.getDeviceTypeChannel().value().asEnum(); + } + } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java new file mode 100644 index 00000000000..646d87d0efe --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java @@ -0,0 +1,32 @@ +package io.openems.edge.goodwe.et.ess; + +import io.openems.common.types.OptionsEnum; + +public enum GoodweType implements OptionsEnum { + UNDEFINED(-1, "Undefined"), // + GOODWE_10K_BT(1, "GoodWe GW10K-BT"), // + GOODWE_10K_ET(2, "GoodWe GW10K-ET"); + + private final int value; + private final String option; + + private GoodweType(int value, String option) { + this.value = value; + this.option = option; + } + + @Override + public int getValue() { + return this.value; + } + + @Override + public String getName() { + return this.option; + } + + @Override + public OptionsEnum getUndefined() { + return UNDEFINED; + } +} \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java index cccaf72f613..3a6a21095df 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java @@ -3,6 +3,7 @@ import io.openems.common.types.OptionsEnum; import io.openems.edge.common.statemachine.AbstractStateMachine; import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.GoodweType; public class ApplyPowerStateMachine extends AbstractStateMachine { @@ -11,16 +12,25 @@ public enum State implements io.openems.edge.common.statemachine.State, O READ_ONLY(10), // - FULL_POSITIVE_DISCHARGE(20), // - FULL_POSITIVE_CURTAIL(21), // - FULL_NEGATIVE_CURTAIL(21), // - - EMPTY_POSITIVE_PV(30), // - EMPTY_NEGATIVE_CHARGE(31), // - - INBETWEEN_POSITIVE_DISCHARGE(41), // - INBETWEEN_POSITIVE_CHARGE(42), // - INBETWEEN_NEGATIVE_CHARGE(43) // + /* + * GoodWe ET handling + */ + ET_FULL_POSITIVE_DISCHARGE(20), // + ET_FULL_POSITIVE_CURTAIL(21), // + ET_FULL_NEGATIVE_CURTAIL(21), // + + ET_EMPTY_POSITIVE_PV(30), // + ET_EMPTY_NEGATIVE_CHARGE(31), // + + ET_INBETWEEN_POSITIVE_DISCHARGE(41), // + ET_INBETWEEN_POSITIVE_CHARGE(42), // + ET_INBETWEEN_NEGATIVE_CHARGE(43), // + + /* + * GoodWe BT handling + */ + BT_CHARGE(50), // + BT_DISCHARGE(51), // ; private final int value; @@ -61,24 +71,28 @@ public StateHandler getStateHandler(State state) { return new UndefinedHandler(); case READ_ONLY: return new ReadOnlyHandler(); - case EMPTY_NEGATIVE_CHARGE: - return new EmptyNegativeChargeHandler(); - case EMPTY_POSITIVE_PV: - return new EmptyPositivePvHandler(); - case FULL_NEGATIVE_CURTAIL: - return new FullNegativeCurtailHandler(); - case FULL_POSITIVE_CURTAIL: - return new FullPositiveCurtailHandler(); - case FULL_POSITIVE_DISCHARGE: - return new FullPositiveDischargeHandler(); - case INBETWEEN_NEGATIVE_CHARGE: - return new InBetweenNegativeChargeHandler(); - case INBETWEEN_POSITIVE_CHARGE: - return new InBetweenPositiveChargeHandler(); - case INBETWEEN_POSITIVE_DISCHARGE: - return new InBetweenPositiveDischargeHandler(); - default: - break; + + case ET_EMPTY_NEGATIVE_CHARGE: + return new EtEmptyNegativeChargeHandler(); + case ET_EMPTY_POSITIVE_PV: + return new EtEmptyPositivePvHandler(); + case ET_FULL_NEGATIVE_CURTAIL: + return new EtFullNegativeCurtailHandler(); + case ET_FULL_POSITIVE_CURTAIL: + return new EtFullPositiveCurtailHandler(); + case ET_FULL_POSITIVE_DISCHARGE: + return new EtFullPositiveDischargeHandler(); + case ET_INBETWEEN_NEGATIVE_CHARGE: + return new EtInbetweenNegativeChargeHandler(); + case ET_INBETWEEN_POSITIVE_CHARGE: + return new EtInbetweenPositiveChargeHandler(); + case ET_INBETWEEN_POSITIVE_DISCHARGE: + return new EtInbetweenPositiveDischargeHandler(); + + case BT_CHARGE: + return new BtChargeHandler(); + case BT_DISCHARGE: + return new BtDischargeHandler(); } throw new IllegalArgumentException("Unknown State [" + state + "]"); } @@ -92,54 +106,75 @@ public StateHandler getStateHandler(State state) { * @param activePowerSetPoint * @return */ - public static State evaluateState(boolean readOnlyMode, int pvProduction, int soc, int activePowerSetPoint) { + public static State evaluateState(GoodweType deviceType, boolean readOnlyMode, int pvProduction, int soc, + int activePowerSetPoint) { if (readOnlyMode) { // Read-Only-Mode: fall-back to internal self-consumption optimization return State.READ_ONLY; } else { - if (soc > 99) { - // battery is full + switch (deviceType) { + case GOODWE_10K_BT: if (activePowerSetPoint > 0) { - // Set-Point is positive -> take power either from pv or battery - if (activePowerSetPoint > pvProduction) { - return State.FULL_POSITIVE_DISCHARGE; + // Set-Point is positive + return State.BT_DISCHARGE; + } else { + // Set-Point is negative or zero + return State.BT_CHARGE; + } + case GOODWE_10K_ET: + if (soc > 99) { + // battery is full + if (activePowerSetPoint > 0) { + // Set-Point is positive -> take power either from pv or battery + if (activePowerSetPoint > pvProduction) { + return State.ET_FULL_POSITIVE_DISCHARGE; + + } else { + return State.ET_FULL_POSITIVE_CURTAIL; + } } else { - return State.FULL_POSITIVE_CURTAIL; + return State.ET_FULL_NEGATIVE_CURTAIL; } - } else { - return State.FULL_NEGATIVE_CURTAIL; - } - } else if (soc < 1) { - // battery is empty - // TODO define when battery is empty - if (activePowerSetPoint > 0) { - return State.EMPTY_POSITIVE_PV; + } else if (soc < 1) { + // battery is empty + // TODO define when battery is empty + if (activePowerSetPoint > 0) { + return State.ET_EMPTY_POSITIVE_PV; + + } else { + // Set-Point is negative or zero -> 'charge' from pv production and grid + return State.ET_EMPTY_NEGATIVE_CHARGE; + } } else { - // Set-Point is negative or zero -> 'charge' from pv production and grid - return State.EMPTY_NEGATIVE_CHARGE; - } + // battery is neither empty nor full + if (activePowerSetPoint > 0) { + // Set-Point is positive + if (activePowerSetPoint > pvProduction) { + return State.ET_INBETWEEN_POSITIVE_DISCHARGE; - } else { - // battery is neither empty nor full - if (activePowerSetPoint > 0) { - // Set-Point is positive - if (activePowerSetPoint > pvProduction) { - return State.INBETWEEN_POSITIVE_DISCHARGE; + } else { + return State.ET_INBETWEEN_POSITIVE_CHARGE; - } else { - return State.INBETWEEN_POSITIVE_CHARGE; + } + } else { + // Set-Point is negative or zero + return State.ET_INBETWEEN_NEGATIVE_CHARGE; } - - } else { - // Set-Point is negative or zero - return State.INBETWEEN_NEGATIVE_CHARGE; } + + case UNDEFINED: + // This should not stay for long on bootup... + return State.UNDEFINED; } + } + + // should not come here + return State.UNDEFINED; } } \ No newline at end of file diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java new file mode 100644 index 00000000000..0e804ccb871 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class BtChargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.CHARGE_BAT, context.activePowerSetPoint * -1); + + return State.BT_CHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java new file mode 100644 index 00000000000..71769ebc2f2 --- /dev/null +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java @@ -0,0 +1,17 @@ +package io.openems.edge.goodwe.et.ess.applypower; + +import io.openems.edge.common.statemachine.StateHandler; +import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; + +public class BtDischargeHandler extends StateHandler { + + @Override + public State runAndGetNextState(Context context) { + + context.setMode(PowerModeEms.DISCHARGE_BAT, context.activePowerSetPoint); + + return State.BT_DISCHARGE; + } + +} diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java similarity index 76% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java index 49ad20df34e..b28f2633e34 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyNegativeChargeHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class EmptyNegativeChargeHandler extends StateHandler { +public class EtEmptyNegativeChargeHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); - return State.EMPTY_NEGATIVE_CHARGE; + return State.ET_EMPTY_NEGATIVE_CHARGE; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java similarity index 78% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java index cb985b99078..166285a2f4b 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EmptyPositivePvHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class EmptyPositivePvHandler extends StateHandler { +public class EtEmptyPositivePvHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); - return State.EMPTY_POSITIVE_PV; + return State.ET_EMPTY_POSITIVE_PV; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java similarity index 74% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java index 4391edff741..e64a9fe015b 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullNegativeCurtailHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class FullNegativeCurtailHandler extends StateHandler { +public class EtFullNegativeCurtailHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.EXPORT_AC, 0); - return State.FULL_NEGATIVE_CURTAIL; + return State.ET_FULL_NEGATIVE_CURTAIL; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java similarity index 75% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java index 10ae4faf67c..c7dcc8986e9 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveCurtailHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class FullPositiveCurtailHandler extends StateHandler { +public class EtFullPositiveCurtailHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.EXPORT_AC, context.activePowerSetPoint); - return State.FULL_POSITIVE_CURTAIL; + return State.ET_FULL_POSITIVE_CURTAIL; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java similarity index 76% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java index 2e47844a457..88a642ef042 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/FullPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java @@ -4,13 +4,13 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class FullPositiveDischargeHandler extends StateHandler { +public class EtFullPositiveDischargeHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.DISCHARGE_BAT, context.activePowerSetPoint - context.pvProduction); - return State.FULL_POSITIVE_DISCHARGE; + return State.ET_FULL_POSITIVE_DISCHARGE; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java similarity index 75% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java index beb1bf8e09c..69090b2b7d8 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenNegativeChargeHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class InBetweenNegativeChargeHandler extends StateHandler { +public class EtInbetweenNegativeChargeHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); - return State.INBETWEEN_NEGATIVE_CHARGE; + return State.ET_INBETWEEN_NEGATIVE_CHARGE; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java similarity index 75% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java index 911c66892cf..ce0ac9164ba 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveChargeHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java @@ -4,14 +4,14 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class InBetweenPositiveChargeHandler extends StateHandler { +public class EtInbetweenPositiveChargeHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.CHARGE_BAT, context.pvProduction - context.activePowerSetPoint); - return State.INBETWEEN_POSITIVE_CHARGE; + return State.ET_INBETWEEN_POSITIVE_CHARGE; } } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java similarity index 74% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java rename to io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java index 5925d985b0d..cc8d8bd7e64 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/InBetweenPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java @@ -4,13 +4,13 @@ import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -public class InBetweenPositiveDischargeHandler extends StateHandler { +public class EtInbetweenPositiveDischargeHandler extends StateHandler { @Override public State runAndGetNextState(Context context) { context.setMode(PowerModeEms.DISCHARGE_PV, context.activePowerSetPoint - context.pvProduction); - return State.INBETWEEN_POSITIVE_DISCHARGE; + return State.ET_INBETWEEN_POSITIVE_DISCHARGE; } } diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java index 8e6f7efe0ea..9977efcfc78 100644 --- a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java +++ b/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java @@ -17,6 +17,7 @@ public class GoodWeEtBatteryInverterImplTest { private static final String MODBUS_ID = "modbus0"; private static final String ESS_ID = "ess0"; + private static final ChannelAddress ESS_GOODWE_TYPE = new ChannelAddress(ESS_ID, "GoodweType"); private static final ChannelAddress ESS_SET_ACTIVE_POWER_EQUALS = new ChannelAddress(ESS_ID, "SetActivePowerEquals"); private static final ChannelAddress ESS_SOC = new ChannelAddress(ESS_ID, "Soc"); @@ -27,7 +28,7 @@ public class GoodWeEtBatteryInverterImplTest { private static final ChannelAddress CHARGER_ACTUAL_POWER = new ChannelAddress(CHARGER_ID, "ActualPower"); @Test - public void test() throws Exception { + public void testEt() throws Exception { GoodWeEtChargerPv1 charger = new GoodWeEtChargerPv1(); new ComponentTest(charger) // .addReference("cm", new DummyConfigurationAdmin()) // @@ -55,6 +56,7 @@ public void test() throws Exception { .setReadOnlyMode(false) // .build()) // .next(new TestCase("Scenario 1: (set-point is positive && set-point is lower than pv production)") // + .input(ESS_GOODWE_TYPE, GoodweType.GOODWE_10K_ET) // .input(CHARGER_ACTUAL_POWER, 5_000) // .input(ESS_SOC, 50) // .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000) // @@ -98,4 +100,33 @@ public void test() throws Exception { ; } + @Test + public void testBt() throws Exception { + GoodWeEtBatteryInverterImpl ess = new GoodWeEtBatteryInverterImpl(); + new ManagedSymmetricEssTest(ess) // + .addReference("power", new DummyPower()) // + .addReference("cm", new DummyConfigurationAdmin()) // + .addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // + .activate(MyConfig.create() // + .setId(ESS_ID) // + .setModbusId(MODBUS_ID) // + .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .setCapacity(9_000) // + .setMaxBatteryPower(5_200) // + .setReadOnlyMode(false) // + .build()) // + .next(new TestCase("Scenario 1: (set-point is positive)") // + .input(ESS_GOODWE_TYPE, GoodweType.GOODWE_10K_BT) // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, 3_000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.DISCHARGE_BAT) // + .output(ESS_EMS_POWER_SET, 3000)) // + .next(new TestCase("Scenario 2: (set-point is negative)") // + .input(ESS_SOC, 50) // + .input(ESS_SET_ACTIVE_POWER_EQUALS, -4000) // + .output(ESS_EMS_POWER_MODE, PowerModeEms.CHARGE_BAT) // + .output(ESS_EMS_POWER_SET, 4000)) // + ; + } + } From 5b67b1f11f425e0bd5083d722f79f0ce385d06f5 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 27 Oct 2020 22:20:57 +0100 Subject: [PATCH 16/23] ATTENTION: Renaming bundle to GoodWe instead of GoodWe.ET. this will break existing configurations! --- io.openems.edge.application/EdgeApp.bndrun | 4 ++-- .../.classpath | 0 .../.gitignore | 0 .../.project | 2 +- .../bnd.bnd | 0 .../readme.adoc | 0 .../io/openems/edge/goodwe/et/GoodWeConstants.java | 2 +- .../goodwe/et/charger/AbstractGoodWeEtCharger.java | 0 .../io/openems/edge/goodwe/et/charger/ConfigPV1.java | 4 ++-- .../io/openems/edge/goodwe/et/charger/ConfigPV2.java | 4 ++-- .../edge/goodwe/et/charger/GoodWeChargerPv1.java | 6 +++--- .../edge/goodwe/et/charger/GoodWeChargerPv2.java | 6 +++--- .../openems/edge/goodwe/et/charger/PvChannelId.java | 0 .../io/openems/edge/goodwe/et/ess/AppModeIndex.java | 0 .../io/openems/edge/goodwe/et/ess/BatteryMode.java | 0 .../src/io/openems/edge/goodwe/et/ess/Config.java | 4 ++-- .../io/openems/edge/goodwe/et/ess/EssChannelId.java | 0 .../edge/goodwe/et/ess/GoodWeEtBatteryInverter.java | 0 .../goodwe/et/ess/GoodWeEtBatteryInverterImpl.java | 4 +--- .../io/openems/edge/goodwe/et/ess/GoodweType.java | 0 .../src/io/openems/edge/goodwe/et/ess/GridMode.java | 0 .../src/io/openems/edge/goodwe/et/ess/LoadMode.java | 0 .../edge/goodwe/et/ess/MeterCommunicateStatus.java | 0 .../edge/goodwe/et/ess/MeterConnectCheckFlag.java | 0 .../edge/goodwe/et/ess/MeterConnectStatus.java | 0 .../io/openems/edge/goodwe/et/ess/OperationMode.java | 0 .../io/openems/edge/goodwe/et/ess/OutputTypeAC.java | 0 .../io/openems/edge/goodwe/et/ess/PowerModeEms.java | 0 .../io/openems/edge/goodwe/et/ess/SafetyCountry.java | 0 .../src/io/openems/edge/goodwe/et/ess/WorkMode.java | 0 .../et/ess/applypower/ApplyPowerStateMachine.java | 0 .../goodwe/et/ess/applypower/BtChargeHandler.java | 0 .../goodwe/et/ess/applypower/BtDischargeHandler.java | 0 .../edge/goodwe/et/ess/applypower/Context.java | 0 .../ess/applypower/EtEmptyNegativeChargeHandler.java | 0 .../et/ess/applypower/EtEmptyPositivePvHandler.java | 0 .../ess/applypower/EtFullNegativeCurtailHandler.java | 0 .../ess/applypower/EtFullPositiveCurtailHandler.java | 0 .../applypower/EtFullPositiveDischargeHandler.java | 0 .../applypower/EtInbetweenNegativeChargeHandler.java | 0 .../applypower/EtInbetweenPositiveChargeHandler.java | 0 .../EtInbetweenPositiveDischargeHandler.java | 0 .../goodwe/et/ess/applypower/ReadOnlyHandler.java | 0 .../goodwe/et/ess/applypower/UndefinedHandler.java | 0 .../io/openems/edge/goodwe/et/gridmeter/Config.java | 0 .../edge/goodwe/et/gridmeter/GoodWeGridMeter.java | 6 +++--- .../edge/goodwe/et/gridmeter/GridMeterChannelId.java | 0 .../test/.gitignore | 0 .../io/openems/edge/goodwe/et/charger/MyConfig.java | 0 .../et/ess/GoodWeEtBatteryInverterImplTest.java | 12 ++++++------ .../test/io/openems/edge/goodwe/et/ess/MyConfig.java | 0 51 files changed, 26 insertions(+), 28 deletions(-) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/.classpath (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/.gitignore (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/.project (92%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/bnd.bnd (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/readme.adoc (100%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/GoodWeEtConstants.java => io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java (75%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java (93%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java (93%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv1.java => io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java (94%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv2.java => io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java (92%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/charger/PvChannelId.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/BatteryMode.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/Config.java (93%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/EssChannelId.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java (99%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/GoodweType.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/GridMode.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/LoadMode.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/OperationMode.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/WorkMode.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/Context.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/gridmeter/Config.java (100%) rename io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GoodWeEtGridMeter.java => io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java (98%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/test/.gitignore (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/test/io/openems/edge/goodwe/et/charger/MyConfig.java (100%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java (94%) rename {io.openems.edge.goodwe.et => io.openems.edge.goodwe}/test/io/openems/edge/goodwe/et/ess/MyConfig.java (100%) diff --git a/io.openems.edge.application/EdgeApp.bndrun b/io.openems.edge.application/EdgeApp.bndrun index 31108b0d8c3..726e05707be 100644 --- a/io.openems.edge.application/EdgeApp.bndrun +++ b/io.openems.edge.application/EdgeApp.bndrun @@ -102,7 +102,7 @@ bnd.identity;id='io.openems.edge.fenecon.dess',\ bnd.identity;id='io.openems.edge.fenecon.mini',\ bnd.identity;id='io.openems.edge.fenecon.pro',\ - bnd.identity;id='io.openems.edge.goodwe.et',\ + bnd.identity;id='io.openems.edge.goodwe',\ bnd.identity;id='io.openems.edge.io.kmtronic',\ bnd.identity;id='io.openems.edge.io.revpi',\ bnd.identity;id='io.openems.edge.io.shelly',\ @@ -226,7 +226,7 @@ io.openems.edge.fenecon.dess;version=snapshot,\ io.openems.edge.fenecon.mini;version=snapshot,\ io.openems.edge.fenecon.pro;version=snapshot,\ - io.openems.edge.goodwe.et;version=snapshot,\ + io.openems.edge.goodwe;version=snapshot,\ io.openems.edge.io.api;version=snapshot,\ io.openems.edge.io.kmtronic;version=snapshot,\ io.openems.edge.io.revpi;version=snapshot,\ diff --git a/io.openems.edge.goodwe.et/.classpath b/io.openems.edge.goodwe/.classpath similarity index 100% rename from io.openems.edge.goodwe.et/.classpath rename to io.openems.edge.goodwe/.classpath diff --git a/io.openems.edge.goodwe.et/.gitignore b/io.openems.edge.goodwe/.gitignore similarity index 100% rename from io.openems.edge.goodwe.et/.gitignore rename to io.openems.edge.goodwe/.gitignore diff --git a/io.openems.edge.goodwe.et/.project b/io.openems.edge.goodwe/.project similarity index 92% rename from io.openems.edge.goodwe.et/.project rename to io.openems.edge.goodwe/.project index 1d5fa09ac5b..11f2ddc1a2c 100644 --- a/io.openems.edge.goodwe.et/.project +++ b/io.openems.edge.goodwe/.project @@ -1,6 +1,6 @@ - io.openems.edge.goodwe.et + io.openems.edge.goodwe diff --git a/io.openems.edge.goodwe.et/bnd.bnd b/io.openems.edge.goodwe/bnd.bnd similarity index 100% rename from io.openems.edge.goodwe.et/bnd.bnd rename to io.openems.edge.goodwe/bnd.bnd diff --git a/io.openems.edge.goodwe.et/readme.adoc b/io.openems.edge.goodwe/readme.adoc similarity index 100% rename from io.openems.edge.goodwe.et/readme.adoc rename to io.openems.edge.goodwe/readme.adoc diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/GoodWeEtConstants.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java similarity index 75% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/GoodWeEtConstants.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java index 666166cf269..8bf8d5accfe 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/GoodWeEtConstants.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java @@ -1,6 +1,6 @@ package io.openems.edge.goodwe.et; -public class GoodWeEtConstants { +public class GoodWeConstants { public static final int DEFAULT_UNIT_ID = 0xF7; // 0xF7 -> 247 } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java similarity index 93% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java index 034412ddecc..75ef5344a96 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java @@ -3,7 +3,7 @@ import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeEtConstants; +import io.openems.edge.goodwe.et.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Charger PV1", // @@ -26,7 +26,7 @@ String Ess_target() default ""; @AttributeDefinition(name = "Modbus Unit-id", description = "Unit-id") - int unit_id() default GoodWeEtConstants.DEFAULT_UNIT_ID; + int unit_id() default GoodWeConstants.DEFAULT_UNIT_ID; @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus bridge.") String modbus_id() default "modbus0"; diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java similarity index 93% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java index c01a039030e..afa2e748ada 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java @@ -3,7 +3,7 @@ import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeEtConstants; +import io.openems.edge.goodwe.et.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Charger PV2", // @@ -26,7 +26,7 @@ String Ess_target() default ""; @AttributeDefinition(name = "Modbus Unit-id", description = "Unit-id") - int unit_id() default GoodWeEtConstants.DEFAULT_UNIT_ID; + int unit_id() default GoodWeConstants.DEFAULT_UNIT_ID; @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus bridge.") String modbus_id() default "modbus0"; diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java similarity index 94% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv1.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java index f63702b7bc6..64719e1ee66 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java @@ -24,11 +24,11 @@ @Designate(ocd = ConfigPV1.class, factory = true) @Component(// - name = "GoodWe.ET.Charger-PV1", // + name = "GoodWe.Charger-PV1", // immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE // ) -public class GoodWeEtChargerPv1 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent { +public class GoodWeChargerPv1 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent { @Reference protected ConfigurationAdmin cm; @@ -41,7 +41,7 @@ protected void setModbus(BridgeModbus modbus) { super.setModbus(modbus); } - public GoodWeEtChargerPv1() { + public GoodWeChargerPv1() { super(); } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java similarity index 92% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv2.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java index 3a466837906..9bff653b051 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/GoodWeEtChargerPv2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java @@ -19,11 +19,11 @@ @Designate(ocd = ConfigPV2.class, factory = true) @Component(// - name = "GoodWe.ET.Charger-PV2", // + name = "GoodWe.Charger-PV2", // immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE // ) -public class GoodWeEtChargerPv2 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent { +public class GoodWeChargerPv2 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent { @Reference protected ConfigurationAdmin cm; @@ -36,7 +36,7 @@ protected void setModbus(BridgeModbus modbus) { super.setModbus(modbus); } - public GoodWeEtChargerPv2() { + public GoodWeChargerPv2() { super(); } diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/PvChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/PvChannelId.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/charger/PvChannelId.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/PvChannelId.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/BatteryMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/BatteryMode.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/BatteryMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/BatteryMode.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java similarity index 93% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java index c5ebf989eed..a03ff10a7cc 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/Config.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java @@ -3,7 +3,7 @@ import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeEtConstants; +import io.openems.edge.goodwe.et.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Battery-Inverter", // @@ -23,7 +23,7 @@ boolean readOnlyMode() default true; @AttributeDefinition(name = "Modbus Unit-id", description = "Unit-id") - int unit_id() default GoodWeEtConstants.DEFAULT_UNIT_ID; + int unit_id() default GoodWeConstants.DEFAULT_UNIT_ID; @AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus brige.") String modbus_id() default "modbus0"; diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/EssChannelId.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java similarity index 99% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java index cc111492b2a..96babc0bb76 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java @@ -61,7 +61,7 @@ @Designate(ocd = Config.class, factory = true) @Component(// - name = "GoodWe.ET.Battery-Inverter", // + name = "GoodWe.Ess", // immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE, // property = EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_BEFORE_PROCESS_IMAGE // @@ -71,8 +71,6 @@ public class GoodWeEtBatteryInverterImpl extends AbstractOpenemsModbusComponent private final Logger log = LoggerFactory.getLogger(GoodWeEtBatteryInverterImpl.class); - protected EnumWriteChannel setEmsPowerMode; - private Config config; @Reference(policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.OPTIONAL) diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodweType.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GoodweType.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodweType.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GridMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/GridMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/LoadMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/LoadMode.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/LoadMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/LoadMode.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/OperationMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OperationMode.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/OperationMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OperationMode.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/WorkMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/WorkMode.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/WorkMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/WorkMode.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/Context.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/Config.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/Config.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/Config.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/Config.java diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GoodWeEtGridMeter.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java similarity index 98% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GoodWeEtGridMeter.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java index 994ed74fae3..9c2812b2bbb 100644 --- a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GoodWeEtGridMeter.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java @@ -35,14 +35,14 @@ @Designate(ocd = Config.class, factory = true) @Component(// - name = "GoodWe.ET.Grid-Meter", // + name = "GoodWe.Grid-Meter", // immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE, // property = { // EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_AFTER_PROCESS_IMAGE, // "type=GRID" // }) -public class GoodWeEtGridMeter extends AbstractOpenemsModbusComponent +public class GoodWeGridMeter extends AbstractOpenemsModbusComponent implements AsymmetricMeter, SymmetricMeter, OpenemsComponent, TimedataProvider, EventHandler { @Reference @@ -61,7 +61,7 @@ protected void setModbus(BridgeModbus modbus) { private final CalculateEnergyFromPower calculateConsumptionEnergy = new CalculateEnergyFromPower(this, SymmetricMeter.ChannelId.ACTIVE_CONSUMPTION_ENERGY); - public GoodWeEtGridMeter() { + public GoodWeGridMeter() { super(// OpenemsComponent.ChannelId.values(), // AsymmetricMeter.ChannelId.values(), // diff --git a/io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java similarity index 100% rename from io.openems.edge.goodwe.et/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java diff --git a/io.openems.edge.goodwe.et/test/.gitignore b/io.openems.edge.goodwe/test/.gitignore similarity index 100% rename from io.openems.edge.goodwe.et/test/.gitignore rename to io.openems.edge.goodwe/test/.gitignore diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/charger/MyConfig.java similarity index 100% rename from io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/charger/MyConfig.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/charger/MyConfig.java diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java similarity index 94% rename from io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java index 9977efcfc78..e40cdeb7e0c 100644 --- a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java +++ b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java @@ -9,8 +9,8 @@ import io.openems.edge.common.test.DummyConfigurationAdmin; import io.openems.edge.ess.test.DummyPower; import io.openems.edge.ess.test.ManagedSymmetricEssTest; -import io.openems.edge.goodwe.et.GoodWeEtConstants; -import io.openems.edge.goodwe.et.charger.GoodWeEtChargerPv1; +import io.openems.edge.goodwe.et.GoodWeConstants; +import io.openems.edge.goodwe.et.charger.GoodWeChargerPv1; public class GoodWeEtBatteryInverterImplTest { @@ -29,7 +29,7 @@ public class GoodWeEtBatteryInverterImplTest { @Test public void testEt() throws Exception { - GoodWeEtChargerPv1 charger = new GoodWeEtChargerPv1(); + GoodWeChargerPv1 charger = new GoodWeChargerPv1(); new ComponentTest(charger) // .addReference("cm", new DummyConfigurationAdmin()) // .addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // @@ -37,7 +37,7 @@ public void testEt() throws Exception { .setId(CHARGER_ID) // .setEssId(ESS_ID) // .setModbusId(MODBUS_ID) // - .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .setUnitId(GoodWeConstants.DEFAULT_UNIT_ID) // .build()); GoodWeEtBatteryInverterImpl ess = new GoodWeEtBatteryInverterImpl(); @@ -50,7 +50,7 @@ public void testEt() throws Exception { .activate(MyConfig.create() // .setId(ESS_ID) // .setModbusId(MODBUS_ID) // - .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .setUnitId(GoodWeConstants.DEFAULT_UNIT_ID) // .setCapacity(9_000) // .setMaxBatteryPower(5_200) // .setReadOnlyMode(false) // @@ -110,7 +110,7 @@ public void testBt() throws Exception { .activate(MyConfig.create() // .setId(ESS_ID) // .setModbusId(MODBUS_ID) // - .setUnitId(GoodWeEtConstants.DEFAULT_UNIT_ID) // + .setUnitId(GoodWeConstants.DEFAULT_UNIT_ID) // .setCapacity(9_000) // .setMaxBatteryPower(5_200) // .setReadOnlyMode(false) // diff --git a/io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/MyConfig.java similarity index 100% rename from io.openems.edge.goodwe.et/test/io/openems/edge/goodwe/et/ess/MyConfig.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/MyConfig.java From dfac5e92d8960f63f471b4ef3528f0cb30824d97 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 27 Oct 2020 22:28:54 +0100 Subject: [PATCH 17/23] Cleanup code --- .../goodwe/et/charger/GoodWeChargerPv1.java | 4 +- .../goodwe/et/charger/GoodWeChargerPv2.java | 4 +- .../edge/goodwe/et/ess/EssChannelId.java | 683 ---------------- .../openems/edge/goodwe/et/ess/GoodWeEss.java | 729 ++++++++++++++++++ ...ryInverterImpl.java => GoodWeEssImpl.java} | 347 ++++----- .../et/ess/GoodWeEtBatteryInverter.java | 17 - .../openems/edge/goodwe/et/ess/GridMode.java | 33 - .../applypower/ApplyPowerStateMachine.java | 6 +- .../et/ess/applypower/BtChargeHandler.java | 2 +- .../et/ess/applypower/BtDischargeHandler.java | 2 +- .../goodwe/et/ess/applypower/Context.java | 8 +- .../EtEmptyNegativeChargeHandler.java | 2 +- .../applypower/EtEmptyPositivePvHandler.java | 2 +- .../EtFullNegativeCurtailHandler.java | 2 +- .../EtFullPositiveCurtailHandler.java | 2 +- .../EtFullPositiveDischargeHandler.java | 2 +- .../EtInbetweenNegativeChargeHandler.java | 2 +- .../EtInbetweenPositiveChargeHandler.java | 2 +- .../EtInbetweenPositiveDischargeHandler.java | 2 +- .../et/ess/applypower/ReadOnlyHandler.java | 2 +- .../et/ess/applypower/UndefinedHandler.java | 2 +- .../et/ess/{ => enums}/AppModeIndex.java | 2 +- .../et/ess/{ => enums}/BatteryMode.java | 2 +- .../goodwe/et/ess/{ => enums}/GoodweType.java | 2 +- .../goodwe/et/ess/{ => enums}/LoadMode.java | 2 +- .../{ => enums}/MeterCommunicateStatus.java | 2 +- .../{ => enums}/MeterConnectCheckFlag.java | 2 +- .../ess/{ => enums}/MeterConnectStatus.java | 2 +- .../et/ess/{ => enums}/OperationMode.java | 2 +- .../et/ess/{ => enums}/OutputTypeAC.java | 2 +- .../et/ess/{ => enums}/PowerModeEms.java | 2 +- .../et/ess/{ => enums}/SafetyCountry.java | 2 +- .../goodwe/et/ess/{ => enums}/WorkMode.java | 2 +- .../ess/GoodWeEtBatteryInverterImplTest.java | 6 +- 34 files changed, 933 insertions(+), 952 deletions(-) delete mode 100644 io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java create mode 100644 io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{GoodWeEtBatteryInverterImpl.java => GoodWeEssImpl.java} (57%) delete mode 100644 io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java delete mode 100644 io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/AppModeIndex.java (93%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/BatteryMode.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/GoodweType.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/LoadMode.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/MeterCommunicateStatus.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/MeterConnectCheckFlag.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/MeterConnectStatus.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/OperationMode.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/OutputTypeAC.java (93%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/PowerModeEms.java (96%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/SafetyCountry.java (98%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/{ => enums}/WorkMode.java (94%) diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java index 64719e1ee66..92897fb1784 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java @@ -20,7 +20,7 @@ import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.taskmanager.Priority; import io.openems.edge.ess.dccharger.api.EssDcCharger; -import io.openems.edge.goodwe.et.ess.GoodWeEtBatteryInverter; +import io.openems.edge.goodwe.et.ess.GoodWeEss; @Designate(ocd = ConfigPV1.class, factory = true) @Component(// @@ -34,7 +34,7 @@ public class GoodWeChargerPv1 extends AbstractGoodWeEtCharger implements EssDcCh protected ConfigurationAdmin cm; @Reference(policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.MANDATORY) - private GoodWeEtBatteryInverter ess; + private GoodWeEss ess; @Reference(policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.MANDATORY) protected void setModbus(BridgeModbus modbus) { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java index 9bff653b051..e9cd102ca38 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java @@ -15,7 +15,7 @@ import io.openems.edge.bridge.modbus.api.BridgeModbus; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.ess.dccharger.api.EssDcCharger; -import io.openems.edge.goodwe.et.ess.GoodWeEtBatteryInverter; +import io.openems.edge.goodwe.et.ess.GoodWeEss; @Designate(ocd = ConfigPV2.class, factory = true) @Component(// @@ -29,7 +29,7 @@ public class GoodWeChargerPv2 extends AbstractGoodWeEtCharger implements EssDcCh protected ConfigurationAdmin cm; @Reference(policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.MANDATORY) - private GoodWeEtBatteryInverter ess; + private GoodWeEss ess; @Reference(policy = ReferencePolicy.STATIC, policyOption = ReferencePolicyOption.GREEDY, cardinality = ReferenceCardinality.MANDATORY) protected void setModbus(BridgeModbus modbus) { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java deleted file mode 100644 index 98bf982cf7d..00000000000 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/EssChannelId.java +++ /dev/null @@ -1,683 +0,0 @@ -package io.openems.edge.goodwe.et.ess; - -import io.openems.common.channel.AccessMode; -import io.openems.common.channel.Level; -import io.openems.common.channel.Unit; -import io.openems.common.types.OpenemsType; -import io.openems.edge.common.channel.ChannelId; -import io.openems.edge.common.channel.Doc; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; - -public enum EssChannelId implements ChannelId { - APPLY_POWER_STATE_MACHINE(Doc.of(ApplyPowerStateMachine.State.values())), - - MODBUS_PROTOCOL_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - RATED_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - AC_OUTPUT_TYPE(Doc.of(OutputTypeAC.values())), // - SERIAL_NUMBER(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - GOODWE_TYPE(Doc.of(GoodweType.values()) // - .accessMode(AccessMode.READ_ONLY)), - DSP1_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - DSP2_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - DSP_SPN_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - ARM_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - ARM_SVN_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - DSP_INTERNAL_FIRMWARE_VERSION(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - ARM_INTERNAL_FIRMWARE_VERSION(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - SIMCCID(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - - // Running Data - RTC_YEAR_MONTH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - RTC_DATE_HOUR(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - RTC_MINUTE_SECOND(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), - V_PV3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), - I_PV3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), - P_PV3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), - V_PV4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), - I_PV4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), - P_PV4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), - PV_MODE(Doc.of(WorkMode.values())), // - TOTAL_INV_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - AC_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - AC_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT_AMPERE_REACTIVE).accessMode(AccessMode.READ_ONLY)), // - AC_APPARENT_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT_AMPERE).accessMode(AccessMode.READ_ONLY)), // - BACK_UP_V_LOAD_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), - BACK_UP_I_LOAD_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), - BACK_UP_F_LOAD_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), - LOAD_MODE_R(Doc.of(LoadMode.values())), // - BACK_UP_P_LOAD_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), - BACK_UP_V_LOAD_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), - BACK_UP_I_LOAD_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), - BACK_UP_F_LOAD_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), - LOAD_MODE_S(Doc.of(LoadMode.values())), // - BACK_UP_P_LOAD_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), - BACK_UP_V_LOAD_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), - BACK_UP_I_LOAD_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), - BACK_UP_F_LOAD_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), - LOAD_MODE_T(Doc.of(LoadMode.values())), // - BACK_UP_P_LOAD_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), - P_LOAD_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - P_LOAD_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - P_LOAD_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - TOTAL_BACK_UP_LOAD(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - TOTAL_LOAD_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - UPS_LOAD_PERCENT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_ONLY)), // - AIR_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // - MODULE_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // - RADIATOR_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // - FUNCTION_BIT_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - BUS_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // - NBUS_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // - V_BATTERY1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // - I_BATTERY1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // - P_BATTERY1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - BATTERY_MODE(Doc.of(BatteryMode.values())), // - WARNING_CODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - SAFETY_COUNTRY(Doc.of(SafetyCountry.values())), // . - WORK_MODE(Doc.of(WorkMode.values())), // - OPERATION_MODE(Doc.of(OperationMode.values())), // - - // Error Message - STATE_0(Doc.of(Level.FAULT).text("The GFCI detecting circuit is abnormal")), // - STATE_1(Doc.of(Level.FAULT).text("The output current sensor is abnormal")), // - STATE_2(Doc.of(Level.WARNING).text("TBD")), // - STATE_3(Doc.of(Level.FAULT).text("DCI Consistency Failure")), // - STATE_4(Doc.of(Level.FAULT).text("GFCI Consistency Failure")), // - STATE_5(Doc.of(Level.WARNING).text("TBD")), // - STATE_6(Doc.of(Level.FAULT).text("GFCI Device Failure")), // - STATE_7(Doc.of(Level.FAULT).text("Relay Device Failure")), // - STATE_8(Doc.of(Level.FAULT).text("AC HCT Failure")), // - STATE_9(Doc.of(Level.FAULT).text("Utility Loss")), // - STATE_10(Doc.of(Level.FAULT).text("Gournd I Failure")), // - STATE_11(Doc.of(Level.WARNING).text("DC Bus High")), // - STATE_12(Doc.of(Level.FAULT).text("Internal Fan Failure(Back-Up Over Load for ES)")), // - STATE_13(Doc.of(Level.WARNING).text("Over Temperature")), // - STATE_14(Doc.of(Level.FAULT).text("Auto Test Failure")), // - STATE_15(Doc.of(Level.WARNING).text("PV Over Voltage")), // - STATE_16(Doc.of(Level.FAULT).text("External Fan Failure")), // - STATE_17(Doc.of(Level.FAULT).text("Vac Failure")), // - STATE_18(Doc.of(Level.FAULT).text("Isolation Failure")), // - STATE_19(Doc.of(Level.WARNING).text("DC Injection High")), // - STATE_20(Doc.of(Level.WARNING).text("TBD")), // - STATE_21(Doc.of(Level.WARNING).text("TBD")), // - STATE_22(Doc.of(Level.FAULT).text("Fac Consistency Failure")), // - STATE_23(Doc.of(Level.FAULT).text("Vac Consistency Failure")), // - STATE_24(Doc.of(Level.WARNING).text("TBD")), // - STATE_25(Doc.of(Level.WARNING).text("Relay Check Failure")), // - STATE_26(Doc.of(Level.WARNING).text("TBD")), // - STATE_27(Doc.of(Level.WARNING).text("TBD")), // - STATE_28(Doc.of(Level.WARNING).text("TBD")), // - STATE_29(Doc.of(Level.FAULT).text("Fac Failure")), // - STATE_30(Doc.of(Level.FAULT).text("EEPROM R/W Failure")), // - STATE_31(Doc.of(Level.FAULT).text("Internal Communication Failure")), // - - PV_E_TOTAL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - PV_E_DAY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_TOTAL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - H_TOTAL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HOUR).accessMode(AccessMode.READ_ONLY)), // - E_DAY_SELL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_TOTAL_BUY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_DAY_BUY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_TOTAL_LOAD(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_LOAD_DAY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_BATTERY_CHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_CHARGE_DAY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_BATTERY_DISCHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_DISCHARGE_DAY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - BATT_STRINGS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - CPLD_WARNING_CODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - W_CHARGER_CTRL_FLAG(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - DERATE_FLAG(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - DERATE_FROZEN_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - DIAG_STATUS_H(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - DIAG_STATUS_L(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - - // External Communication Data (ARM) - COM_MODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - RSSI(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - MANIFACTURE_CODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - B_METER_COMMUNICATE_STATUS(Doc.of(MeterConnectStatus.values())), // - METER_COMMUNICATE_STATUS(Doc.of(MeterCommunicateStatus.values())), // - MT_ACTIVE_POWER_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - MT_ACTIVE_POWER_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - MT_ACTIVE_POWER_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - MT_TOTAL_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - MT_TOTAL_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // - METER_PF_R(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - METER_PF_S(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - METER_PF_T(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - METER_POWER_FACTOR(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - METER_FREQUENCE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - E_TOTAL_SELL(Doc.of(OpenemsType.FLOAT) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - E_TOTAL_BUY2(Doc.of(OpenemsType.FLOAT) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // - - STATE_32(Doc.of(Level.WARNING).text("DRM0")), // - STATE_33(Doc.of(Level.WARNING).text("DRM1")), // - STATE_34(Doc.of(Level.WARNING).text("DRM2")), // - STATE_35(Doc.of(Level.WARNING).text("DRM3")), // - STATE_36(Doc.of(Level.WARNING).text("DRM4")), // - STATE_37(Doc.of(Level.WARNING).text("DRM5")), // - STATE_38(Doc.of(Level.WARNING).text("DRM6")), // - STATE_39(Doc.of(Level.WARNING).text("DRM7")), // - STATE_40(Doc.of(Level.WARNING).text("DRM8")), // - STATE_41(Doc.of(Level.WARNING).text("DRED Connect Status")), // - - BATTERY_TYPE_INDEX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - BMS_STATUS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - BMS_PACK_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // - BMS_CHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - BMS_DISCHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - - STATE_42(Doc.of(Level.WARNING).text("Charging over-voltage2")), // - STATE_43(Doc.of(Level.WARNING).text("Discharging under-voltage2")), // - STATE_44(Doc.of(Level.WARNING).text("CellHigh temperature2")), // - STATE_45(Doc.of(Level.WARNING).text("CellLow temperature2")), // - STATE_46(Doc.of(Level.WARNING).text("Charging overcurrent2")), // - STATE_47(Doc.of(Level.WARNING).text("Discharging overcurrent2")), // - STATE_48(Doc.of(Level.WARNING).text("Precharge fault")), // - STATE_49(Doc.of(Level.WARNING).text("DC bus fault")), // - STATE_50(Doc.of(Level.WARNING).text("Battery break")), // - STATE_51(Doc.of(Level.WARNING).text("Battery Lock")), // - STATE_52(Doc.of(Level.WARNING).text("Discharge circuit Fault")), // - STATE_53(Doc.of(Level.WARNING).text("Charging circuit Failure")), // - STATE_54(Doc.of(Level.WARNING).text("Communication failure2")), // - STATE_55(Doc.of(Level.WARNING).text("Cell High temperature3")), // - STATE_56(Doc.of(Level.WARNING).text("Discharging under-voltage3")), // - STATE_57(Doc.of(Level.WARNING).text("Charging over-voltage3")), // - - BMS_SOH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_ONLY)), - BMS_BATTERY_STRINGS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - - STATE_58(Doc.of(Level.WARNING).text("Charging over-voltage1")), // - STATE_59(Doc.of(Level.WARNING).text("Discharging under-voltage1")), // - STATE_60(Doc.of(Level.WARNING).text("Cell High temperature1")), // - STATE_61(Doc.of(Level.WARNING).text("Cell Low temperature1")), // - STATE_62(Doc.of(Level.WARNING).text("Charging over-current1")), // - STATE_63(Doc.of(Level.WARNING).text("Discharging over-current1")), // - STATE_64(Doc.of(Level.WARNING).text("communication failure1")), // - STATE_65(Doc.of(Level.WARNING).text("System Reboot")), // - STATE_66(Doc.of(Level.WARNING).text("Cell- imbalance")), // - STATE_67(Doc.of(Level.WARNING).text("System Low temperature1")), // - STATE_68(Doc.of(Level.WARNING).text("System Low temperature2")), // - STATE_69(Doc.of(Level.WARNING).text("System High temperature")), // - - BATTERY_PROTOCOL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // - - // Setting Parameter - USER_PASSWORD1(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - USER_PASSWORD2(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - USER_PASSWORD3(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - ROUTER_SSID(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - ROUTER_PASSWORD(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - ROUTER_ENCRYPTION_METHOD(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DOMAIN1(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - PORT_NUMBER1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DOMAIN2(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - PORT_NUMBER2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - MODBUS_ADDRESS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - MODBUS_MANUFACTURER(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - MODBUS_BADRATE_485(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RTC_YEAR_MONTH_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RTC_DAY_HOUR_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RTC_MINUTE_SECOND_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - SERIAL_NUMBER_2(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DEVICE_TYPE_2(Doc.of(OpenemsType.STRING) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RESUME_FACTORY_SETTING(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - CLEAR_DATA(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - START(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - STOP(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - RESET(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - RESET_SPS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - PV_E_TOTAL_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - PV_E_DAY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_TOTAL_SELL_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - H_TOTAL_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HOUR).accessMode(AccessMode.READ_WRITE)), // - E_DAY_SELL_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_TOTAL_BUY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_DAY_BUY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_TOTAL_LOAD_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_LOAD_DAY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_BATTERY_CHARGE_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_CHARGE_DAY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_BATTERY_DISCHARGE_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - E_DISCHARGE_DAY_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // - LANGUAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - SAFETY_COUNTRY_CODE(Doc.of(SafetyCountry.values())), // - ISO(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - LVRT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - ISLANDING(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BURN_IN_RESET_TIME(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.MINUTE).accessMode(AccessMode.READ_WRITE)), // - PV_START_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - ENABLE_MPPT_4SHADOW(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BACK_UP_ENABLE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - AUTO_START_BACKUP(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - GRID_WAVE_CHECK_LEVEL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - REPAID_CUT_OFF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BACKUP_START_DLY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - UPS_STD_VOLT_TYPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - UNDER_ATS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BURN_IN_MODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BACKUP_OVERLOAD_DELAY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - UPSPHASE_TYPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DERATE_RATE_VDE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - LEAD_BAT_CAPACITY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATTERY_STRINGS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_CHARGE_VOLT_MAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_CHARGE_CURR_MAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_VOLT_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_DISCHARGE_CURR_MAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_SOC_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_OFF_LINE_VOLT_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_OFFLINE_SOC_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - CLEAR_BATTERY_SETTING(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - - // CosPhi curve - ENABLE_CURVE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - POINT_A_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - POINT_A_PF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - POINT_B_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - POINT_B_PF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - POINT_C_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - POINT_C_PF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - LOCK_IN_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - LOCK_OUT_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - LOCK_OUT_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - - // Power and frequency curve - STATE_70(Doc.of(Level.INFO).text("ON/OFF")), // - STATE_71(Doc.of(Level.INFO).text("response mode")), // - - FFROZEN_DCH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - FFROZEN_CH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - FSTOP_DCH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - FSTOP_CH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - RECOVERY_WAITING_TIME(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.SECONDS).accessMode(AccessMode.READ_WRITE)), // - RECOVERY_FREQURNCY1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - RECOVERY_FREQUENCY2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - RECOVERY_SLOPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - FFROZEN_DCH_SLOPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - FFROZEN_CH_SLOPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // - DOWN_SLOPE_POWER_REFERENCE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DOWN_SLOP(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - - // QU curve - ENABLE_CURVE_QU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - LOCK_IN_POWER_QU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - LOCK_OUT_POWER_QU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - V1_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V1_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - V2_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V2_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - V3_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V3_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - V4_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V4_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - K_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - TIME_CONSTANT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - MISCELLANEA(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RATED_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - RESPONSE_TIME(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - - // PU curve - PU_CURVE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - POWER_CHANGE_RATE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - V1_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V1_VALUE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - V2_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V2_VALUE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - V3_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V3_VALUE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - V4_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - V4_VALUE_PU(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - FIXED_POWER_FACTOR(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - FIXED_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - FIXED_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - GRID_LIMIT_BY_VOLT_START_VOL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - GRID_LIMIT_BY_VOLT_START_PER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - GRID_LIMIT_BY_VOLT_SLOPE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.WRITE_ONLY)), // - AUTO_TEST_ENABLE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - AUTO_TEST_STEP(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - UW_ITALY_FREQ_MODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - - // Meter Control ARM - APP_MODE_INDEX(Doc.of(AppModeIndex.values())), // - METER_CHECK_VALUE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - WMETER_CONNECT_CHECK_FLAG(Doc.of(MeterConnectCheckFlag.values())), // - SIMULATE_METER_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BREEZE_ON_OFF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - LOG_DATA_ENABLE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DATA_SEND_INTERVAL(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.SECONDS).accessMode(AccessMode.READ_WRITE)), // - - // Battery Control Data ARM - STOP_SOC_PROTECT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATTERY_FLOAT_VOLT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - BATTERY_FLOAT_CURRENT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // - BATTERY_FLOAT_TIME(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.MINUTE).accessMode(AccessMode.READ_WRITE)), // - BATTERY_TYPE_INDEX_ARM(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - MANUFACTURE_CODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - DC_VOLT_OUTPUT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_AVG_CHG_VOLT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - BAT_AVG_CHG_HOURS(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.HOUR).accessMode(AccessMode.READ_WRITE)), // - FEED_POWER_ENABLE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - FEED_POWER_PARA(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // - EMS_POWER_MODE(Doc.of(PowerModeEms.values()) // - .accessMode(AccessMode.READ_WRITE)), // - EMS_POWER_SET(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_BMS_CURR_LMT_COFF(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATTERY_PROTOCOL_ARM(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - START_TIME_1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - END_TIME_1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_POWER_PERCENT_1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - - STATE_72(Doc.of(Level.INFO).text("SUNDAY")), // - STATE_73(Doc.of(Level.WARNING).text("MONDAY")), // - STATE_74(Doc.of(Level.WARNING).text("TUESDAY")), // - STATE_75(Doc.of(Level.WARNING).text("Wednesday")), // - STATE_76(Doc.of(Level.WARNING).text("Thursday")), // - STATE_77(Doc.of(Level.WARNING).text("Friday")), // - STATE_78(Doc.of(Level.WARNING).text("Saturday")), // - - START_TIME_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - END_TIME_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_POWER_PERCENT_2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - START_TIME_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - END_TIME_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_POWER_PERCENT_3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - START_TIME_4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - END_TIME_4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BAT_POWER_PERCENT_4(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - SOC_START_TO_FORCE_CHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - SOC_STOP_TO_FORCE_CHARGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - CLEAR_ALL_ECONOMIC_MODE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // - - // BMS for RS485 - BMS_VERSION(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - BATT_STRINGS_RS485(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_CHARGE_VMAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_CHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_DISCHARGE_VMIN(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_DISCHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_VOLTAGE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_CURRENT(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_SOC(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_SOH(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // - WBMS_BAT_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_WRITE)), // - - // BMS_STATUS(), // - STATE_79(Doc.of(Level.INFO).text("force to charge")), // - STATE_80(Doc.of(Level.INFO).text("Stop charging")), // TODO can be removed? - STATE_81(Doc.of(Level.INFO).text("Stop discharging")); - - private final Doc doc; - - private EssChannelId(Doc doc) { - this.doc = doc; - } - - @Override - public Doc doc() { - return this.doc; - } -} \ No newline at end of file diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java new file mode 100644 index 00000000000..072272b4ea7 --- /dev/null +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java @@ -0,0 +1,729 @@ +package io.openems.edge.goodwe.et.ess; + +import io.openems.common.channel.AccessMode; +import io.openems.common.channel.Level; +import io.openems.common.channel.Unit; +import io.openems.common.types.OpenemsType; +import io.openems.edge.common.channel.Channel; +import io.openems.edge.common.channel.Doc; +import io.openems.edge.common.channel.value.Value; +import io.openems.edge.common.component.OpenemsComponent; +import io.openems.edge.ess.api.SymmetricEss; +import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; +import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; +import io.openems.edge.goodwe.et.ess.enums.AppModeIndex; +import io.openems.edge.goodwe.et.ess.enums.BatteryMode; +import io.openems.edge.goodwe.et.ess.enums.GoodweType; +import io.openems.edge.goodwe.et.ess.enums.LoadMode; +import io.openems.edge.goodwe.et.ess.enums.MeterCommunicateStatus; +import io.openems.edge.goodwe.et.ess.enums.MeterConnectCheckFlag; +import io.openems.edge.goodwe.et.ess.enums.MeterConnectStatus; +import io.openems.edge.goodwe.et.ess.enums.OperationMode; +import io.openems.edge.goodwe.et.ess.enums.OutputTypeAC; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.et.ess.enums.SafetyCountry; +import io.openems.edge.goodwe.et.ess.enums.WorkMode; + +public interface GoodWeEss extends SymmetricEss, OpenemsComponent { + + public Integer getUnitId(); + + public String getModbusBridgeId(); + + public void addCharger(AbstractGoodWeEtCharger charger); + + public void removeCharger(AbstractGoodWeEtCharger charger); + + public static enum ChannelId implements io.openems.edge.common.channel.ChannelId { + APPLY_POWER_STATE_MACHINE(Doc.of(ApplyPowerStateMachine.State.values())), + + MODBUS_PROTOCOL_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + RATED_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + AC_OUTPUT_TYPE(Doc.of(OutputTypeAC.values())), // + SERIAL_NUMBER(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + GOODWE_TYPE(Doc.of(GoodweType.values()) // + .accessMode(AccessMode.READ_ONLY)), + DSP1_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + DSP2_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + DSP_SPN_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + ARM_SOFTWARE_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + ARM_SVN_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + DSP_INTERNAL_FIRMWARE_VERSION(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + ARM_INTERNAL_FIRMWARE_VERSION(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + SIMCCID(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + + // Running Data + RTC_YEAR_MONTH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + RTC_DATE_HOUR(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + RTC_MINUTE_SECOND(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), + V_PV3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), + I_PV3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), + P_PV3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), + V_PV4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), + I_PV4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), + P_PV4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), + PV_MODE(Doc.of(WorkMode.values())), // + TOTAL_INV_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + AC_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + AC_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT_AMPERE_REACTIVE).accessMode(AccessMode.READ_ONLY)), // + AC_APPARENT_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT_AMPERE).accessMode(AccessMode.READ_ONLY)), // + BACK_UP_V_LOAD_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), + BACK_UP_I_LOAD_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), + BACK_UP_F_LOAD_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), + LOAD_MODE_R(Doc.of(LoadMode.values())), // + BACK_UP_P_LOAD_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), + BACK_UP_V_LOAD_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), + BACK_UP_I_LOAD_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), + BACK_UP_F_LOAD_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), + LOAD_MODE_S(Doc.of(LoadMode.values())), // + BACK_UP_P_LOAD_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), + BACK_UP_V_LOAD_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), + BACK_UP_I_LOAD_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_ONLY)), + BACK_UP_F_LOAD_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_ONLY)), + LOAD_MODE_T(Doc.of(LoadMode.values())), // + BACK_UP_P_LOAD_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), + P_LOAD_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + P_LOAD_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + P_LOAD_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + TOTAL_BACK_UP_LOAD(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + TOTAL_LOAD_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + UPS_LOAD_PERCENT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_ONLY)), // + AIR_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // + MODULE_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // + RADIATOR_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // + FUNCTION_BIT_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + BUS_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // + NBUS_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // + V_BATTERY1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // + I_BATTERY1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_ONLY)), // + P_BATTERY1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + BATTERY_MODE(Doc.of(BatteryMode.values())), // + WARNING_CODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + SAFETY_COUNTRY(Doc.of(SafetyCountry.values())), // . + WORK_MODE(Doc.of(WorkMode.values())), // + OPERATION_MODE(Doc.of(OperationMode.values())), // + + // Error Message + STATE_0(Doc.of(Level.FAULT).text("The GFCI detecting circuit is abnormal")), // + STATE_1(Doc.of(Level.FAULT).text("The output current sensor is abnormal")), // + STATE_2(Doc.of(Level.WARNING).text("TBD")), // + STATE_3(Doc.of(Level.FAULT).text("DCI Consistency Failure")), // + STATE_4(Doc.of(Level.FAULT).text("GFCI Consistency Failure")), // + STATE_5(Doc.of(Level.WARNING).text("TBD")), // + STATE_6(Doc.of(Level.FAULT).text("GFCI Device Failure")), // + STATE_7(Doc.of(Level.FAULT).text("Relay Device Failure")), // + STATE_8(Doc.of(Level.FAULT).text("AC HCT Failure")), // + STATE_9(Doc.of(Level.FAULT).text("Utility Loss")), // + STATE_10(Doc.of(Level.FAULT).text("Gournd I Failure")), // + STATE_11(Doc.of(Level.WARNING).text("DC Bus High")), // + STATE_12(Doc.of(Level.FAULT).text("Internal Fan Failure(Back-Up Over Load for ES)")), // + STATE_13(Doc.of(Level.WARNING).text("Over Temperature")), // + STATE_14(Doc.of(Level.FAULT).text("Auto Test Failure")), // + STATE_15(Doc.of(Level.WARNING).text("PV Over Voltage")), // + STATE_16(Doc.of(Level.FAULT).text("External Fan Failure")), // + STATE_17(Doc.of(Level.FAULT).text("Vac Failure")), // + STATE_18(Doc.of(Level.FAULT).text("Isolation Failure")), // + STATE_19(Doc.of(Level.WARNING).text("DC Injection High")), // + STATE_20(Doc.of(Level.WARNING).text("TBD")), // + STATE_21(Doc.of(Level.WARNING).text("TBD")), // + STATE_22(Doc.of(Level.FAULT).text("Fac Consistency Failure")), // + STATE_23(Doc.of(Level.FAULT).text("Vac Consistency Failure")), // + STATE_24(Doc.of(Level.WARNING).text("TBD")), // + STATE_25(Doc.of(Level.WARNING).text("Relay Check Failure")), // + STATE_26(Doc.of(Level.WARNING).text("TBD")), // + STATE_27(Doc.of(Level.WARNING).text("TBD")), // + STATE_28(Doc.of(Level.WARNING).text("TBD")), // + STATE_29(Doc.of(Level.FAULT).text("Fac Failure")), // + STATE_30(Doc.of(Level.FAULT).text("EEPROM R/W Failure")), // + STATE_31(Doc.of(Level.FAULT).text("Internal Communication Failure")), // + + PV_E_TOTAL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + PV_E_DAY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_TOTAL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + H_TOTAL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HOUR).accessMode(AccessMode.READ_ONLY)), // + E_DAY_SELL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_TOTAL_BUY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_DAY_BUY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_TOTAL_LOAD(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_LOAD_DAY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_BATTERY_CHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_CHARGE_DAY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_BATTERY_DISCHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_DISCHARGE_DAY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + BATT_STRINGS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + CPLD_WARNING_CODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + W_CHARGER_CTRL_FLAG(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + DERATE_FLAG(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + DERATE_FROZEN_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + DIAG_STATUS_H(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + DIAG_STATUS_L(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + + // External Communication Data (ARM) + COM_MODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + RSSI(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + MANIFACTURE_CODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + B_METER_COMMUNICATE_STATUS(Doc.of(MeterConnectStatus.values())), // + METER_COMMUNICATE_STATUS(Doc.of(MeterCommunicateStatus.values())), // + MT_ACTIVE_POWER_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + MT_ACTIVE_POWER_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + MT_ACTIVE_POWER_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + MT_TOTAL_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + MT_TOTAL_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_ONLY)), // + METER_PF_R(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + METER_PF_S(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + METER_PF_T(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + METER_POWER_FACTOR(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + METER_FREQUENCE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + E_TOTAL_SELL(Doc.of(OpenemsType.FLOAT) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + E_TOTAL_BUY2(Doc.of(OpenemsType.FLOAT) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_ONLY)), // + + STATE_32(Doc.of(Level.WARNING).text("DRM0")), // + STATE_33(Doc.of(Level.WARNING).text("DRM1")), // + STATE_34(Doc.of(Level.WARNING).text("DRM2")), // + STATE_35(Doc.of(Level.WARNING).text("DRM3")), // + STATE_36(Doc.of(Level.WARNING).text("DRM4")), // + STATE_37(Doc.of(Level.WARNING).text("DRM5")), // + STATE_38(Doc.of(Level.WARNING).text("DRM6")), // + STATE_39(Doc.of(Level.WARNING).text("DRM7")), // + STATE_40(Doc.of(Level.WARNING).text("DRM8")), // + STATE_41(Doc.of(Level.WARNING).text("DRED Connect Status")), // + + BATTERY_TYPE_INDEX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + BMS_STATUS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + BMS_PACK_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_ONLY)), // + BMS_CHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + BMS_DISCHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + + STATE_42(Doc.of(Level.WARNING).text("Charging over-voltage2")), // + STATE_43(Doc.of(Level.WARNING).text("Discharging under-voltage2")), // + STATE_44(Doc.of(Level.WARNING).text("CellHigh temperature2")), // + STATE_45(Doc.of(Level.WARNING).text("CellLow temperature2")), // + STATE_46(Doc.of(Level.WARNING).text("Charging overcurrent2")), // + STATE_47(Doc.of(Level.WARNING).text("Discharging overcurrent2")), // + STATE_48(Doc.of(Level.WARNING).text("Precharge fault")), // + STATE_49(Doc.of(Level.WARNING).text("DC bus fault")), // + STATE_50(Doc.of(Level.WARNING).text("Battery break")), // + STATE_51(Doc.of(Level.WARNING).text("Battery Lock")), // + STATE_52(Doc.of(Level.WARNING).text("Discharge circuit Fault")), // + STATE_53(Doc.of(Level.WARNING).text("Charging circuit Failure")), // + STATE_54(Doc.of(Level.WARNING).text("Communication failure2")), // + STATE_55(Doc.of(Level.WARNING).text("Cell High temperature3")), // + STATE_56(Doc.of(Level.WARNING).text("Discharging under-voltage3")), // + STATE_57(Doc.of(Level.WARNING).text("Charging over-voltage3")), // + + BMS_SOH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_ONLY)), + BMS_BATTERY_STRINGS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + + STATE_58(Doc.of(Level.WARNING).text("Charging over-voltage1")), // + STATE_59(Doc.of(Level.WARNING).text("Discharging under-voltage1")), // + STATE_60(Doc.of(Level.WARNING).text("Cell High temperature1")), // + STATE_61(Doc.of(Level.WARNING).text("Cell Low temperature1")), // + STATE_62(Doc.of(Level.WARNING).text("Charging over-current1")), // + STATE_63(Doc.of(Level.WARNING).text("Discharging over-current1")), // + STATE_64(Doc.of(Level.WARNING).text("communication failure1")), // + STATE_65(Doc.of(Level.WARNING).text("System Reboot")), // + STATE_66(Doc.of(Level.WARNING).text("Cell- imbalance")), // + STATE_67(Doc.of(Level.WARNING).text("System Low temperature1")), // + STATE_68(Doc.of(Level.WARNING).text("System Low temperature2")), // + STATE_69(Doc.of(Level.WARNING).text("System High temperature")), // + + BATTERY_PROTOCOL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_ONLY)), // + + // Setting Parameter + USER_PASSWORD1(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + USER_PASSWORD2(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + USER_PASSWORD3(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + ROUTER_SSID(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + ROUTER_PASSWORD(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + ROUTER_ENCRYPTION_METHOD(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DOMAIN1(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + PORT_NUMBER1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DOMAIN2(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + PORT_NUMBER2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + MODBUS_ADDRESS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + MODBUS_MANUFACTURER(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + MODBUS_BADRATE_485(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RTC_YEAR_MONTH_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RTC_DAY_HOUR_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RTC_MINUTE_SECOND_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + SERIAL_NUMBER_2(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DEVICE_TYPE_2(Doc.of(OpenemsType.STRING) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RESUME_FACTORY_SETTING(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + CLEAR_DATA(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + START(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + STOP(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + RESET(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + RESET_SPS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + PV_E_TOTAL_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + PV_E_DAY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_TOTAL_SELL_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + H_TOTAL_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HOUR).accessMode(AccessMode.READ_WRITE)), // + E_DAY_SELL_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_TOTAL_BUY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_DAY_BUY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_TOTAL_LOAD_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_LOAD_DAY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_BATTERY_CHARGE_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_CHARGE_DAY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_BATTERY_DISCHARGE_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + E_DISCHARGE_DAY_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.KILOWATT_HOURS).accessMode(AccessMode.READ_WRITE)), // + LANGUAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + SAFETY_COUNTRY_CODE(Doc.of(SafetyCountry.values())), // + ISO(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + LVRT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + ISLANDING(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BURN_IN_RESET_TIME(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.MINUTE).accessMode(AccessMode.READ_WRITE)), // + PV_START_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + ENABLE_MPPT_4SHADOW(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BACK_UP_ENABLE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + AUTO_START_BACKUP(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + GRID_WAVE_CHECK_LEVEL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + REPAID_CUT_OFF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BACKUP_START_DLY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + UPS_STD_VOLT_TYPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + UNDER_ATS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BURN_IN_MODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BACKUP_OVERLOAD_DELAY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + UPSPHASE_TYPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DERATE_RATE_VDE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + LEAD_BAT_CAPACITY(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATTERY_STRINGS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_CHARGE_VOLT_MAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_CHARGE_CURR_MAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_VOLT_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_DISCHARGE_CURR_MAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_SOC_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_OFF_LINE_VOLT_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_OFFLINE_SOC_UNDER_MIN(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + CLEAR_BATTERY_SETTING(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + + // CosPhi curve + ENABLE_CURVE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + POINT_A_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + POINT_A_PF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + POINT_B_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + POINT_B_PF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + POINT_C_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + POINT_C_PF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + LOCK_IN_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + LOCK_OUT_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + LOCK_OUT_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + + // Power and frequency curve + STATE_70(Doc.of(Level.INFO).text("ON/OFF")), // + STATE_71(Doc.of(Level.INFO).text("response mode")), // + + FFROZEN_DCH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + FFROZEN_CH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + FSTOP_DCH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + FSTOP_CH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + RECOVERY_WAITING_TIME(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.SECONDS).accessMode(AccessMode.READ_WRITE)), // + RECOVERY_FREQURNCY1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + RECOVERY_FREQUENCY2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + RECOVERY_SLOPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + FFROZEN_DCH_SLOPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + FFROZEN_CH_SLOPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HERTZ).accessMode(AccessMode.READ_WRITE)), // + DOWN_SLOPE_POWER_REFERENCE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DOWN_SLOP(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + + // QU curve + ENABLE_CURVE_QU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + LOCK_IN_POWER_QU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + LOCK_OUT_POWER_QU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + V1_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V1_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + V2_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V2_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + V3_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V3_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + V4_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V4_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + K_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + TIME_CONSTANT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + MISCELLANEA(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RATED_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + RESPONSE_TIME(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + + // PU curve + PU_CURVE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + POWER_CHANGE_RATE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + V1_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V1_VALUE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + V2_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V2_VALUE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + V3_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V3_VALUE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + V4_VOLTAGE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + V4_VALUE_PU(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + FIXED_POWER_FACTOR(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + FIXED_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + FIXED_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + GRID_LIMIT_BY_VOLT_START_VOL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + GRID_LIMIT_BY_VOLT_START_PER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + GRID_LIMIT_BY_VOLT_SLOPE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.WRITE_ONLY)), // + AUTO_TEST_ENABLE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + AUTO_TEST_STEP(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + UW_ITALY_FREQ_MODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + + // Meter Control ARM + APP_MODE_INDEX(Doc.of(AppModeIndex.values())), // + METER_CHECK_VALUE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + WMETER_CONNECT_CHECK_FLAG(Doc.of(MeterConnectCheckFlag.values())), // + SIMULATE_METER_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BREEZE_ON_OFF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + LOG_DATA_ENABLE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DATA_SEND_INTERVAL(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.SECONDS).accessMode(AccessMode.READ_WRITE)), // + + // Battery Control Data ARM + STOP_SOC_PROTECT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATTERY_FLOAT_VOLT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + BATTERY_FLOAT_CURRENT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // + BATTERY_FLOAT_TIME(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.MINUTE).accessMode(AccessMode.READ_WRITE)), // + BATTERY_TYPE_INDEX_ARM(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + MANUFACTURE_CODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + DC_VOLT_OUTPUT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_AVG_CHG_VOLT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + BAT_AVG_CHG_HOURS(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.HOUR).accessMode(AccessMode.READ_WRITE)), // + FEED_POWER_ENABLE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + FEED_POWER_PARA(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT).accessMode(AccessMode.READ_WRITE)), // + EMS_POWER_MODE(Doc.of(PowerModeEms.values()) // + .accessMode(AccessMode.READ_WRITE)), // + EMS_POWER_SET(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_BMS_CURR_LMT_COFF(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATTERY_PROTOCOL_ARM(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + START_TIME_1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + END_TIME_1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_POWER_PERCENT_1(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + + STATE_72(Doc.of(Level.INFO).text("SUNDAY")), // + STATE_73(Doc.of(Level.WARNING).text("MONDAY")), // + STATE_74(Doc.of(Level.WARNING).text("TUESDAY")), // + STATE_75(Doc.of(Level.WARNING).text("Wednesday")), // + STATE_76(Doc.of(Level.WARNING).text("Thursday")), // + STATE_77(Doc.of(Level.WARNING).text("Friday")), // + STATE_78(Doc.of(Level.WARNING).text("Saturday")), // + + START_TIME_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + END_TIME_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_POWER_PERCENT_2(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + START_TIME_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + END_TIME_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_POWER_PERCENT_3(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + START_TIME_4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + END_TIME_4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BAT_POWER_PERCENT_4(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + SOC_START_TO_FORCE_CHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + SOC_STOP_TO_FORCE_CHARGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + CLEAR_ALL_ECONOMIC_MODE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.WRITE_ONLY)), // + + // BMS for RS485 + BMS_VERSION(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + BATT_STRINGS_RS485(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.NONE).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_CHARGE_VMAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_CHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_DISCHARGE_VMIN(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_DISCHARGE_IMAX(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_VOLTAGE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.VOLT).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_CURRENT(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.AMPERE).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_SOC(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_SOH(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.PERCENT).accessMode(AccessMode.READ_WRITE)), // + WBMS_BAT_TEMPERATURE(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.DEGREE_CELSIUS).accessMode(AccessMode.READ_WRITE)), // + + // BMS_STATUS(), // + STATE_79(Doc.of(Level.INFO).text("force to charge")), // + STATE_80(Doc.of(Level.INFO).text("Stop charging")), // TODO can be removed? + STATE_81(Doc.of(Level.INFO).text("Stop discharging")); + + private final Doc doc; + + private ChannelId(Doc doc) { + this.doc = doc; + } + + @Override + public Doc doc() { + return this.doc; + } + } + + /** + * Gets the Channel for {@link ChannelId#GOODWE_TYPE}. + * + * @return the Channel + */ + public default Channel getGoodweTypeChannel() { + return this.channel(GoodWeEss.ChannelId.GOODWE_TYPE); + } + + /** + * Gets the Device Type. See {@link ChannelId#GOODWE_TYPE}. + * + * @return the Channel {@link Value} + */ + public default GoodweType getGoodweType() { + return this.getGoodweTypeChannel().value().asEnum(); + } + +} diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java similarity index 57% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java index 96babc0bb76..b74718e2824 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImpl.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java @@ -38,7 +38,6 @@ import io.openems.edge.common.channel.EnumReadChannel; import io.openems.edge.common.channel.EnumWriteChannel; import io.openems.edge.common.channel.IntegerWriteChannel; -import io.openems.edge.common.channel.value.Value; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.event.EdgeEventConstants; import io.openems.edge.common.sum.GridMode; @@ -55,6 +54,8 @@ import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; import io.openems.edge.goodwe.et.ess.applypower.Context; +import io.openems.edge.goodwe.et.ess.enums.BatteryMode; +import io.openems.edge.goodwe.et.ess.enums.GoodweType; import io.openems.edge.timedata.api.Timedata; import io.openems.edge.timedata.api.TimedataProvider; import io.openems.edge.timedata.api.utils.CalculateEnergyFromPower; @@ -66,10 +67,10 @@ configurationPolicy = ConfigurationPolicy.REQUIRE, // property = EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_BEFORE_PROCESS_IMAGE // ) // -public class GoodWeEtBatteryInverterImpl extends AbstractOpenemsModbusComponent implements GoodWeEtBatteryInverter, - HybridEss, ManagedSymmetricEss, SymmetricEss, OpenemsComponent, TimedataProvider, EventHandler { +public class GoodWeEssImpl extends AbstractOpenemsModbusComponent implements GoodWeEss, HybridEss, ManagedSymmetricEss, + SymmetricEss, OpenemsComponent, TimedataProvider, EventHandler { - private final Logger log = LoggerFactory.getLogger(GoodWeEtBatteryInverterImpl.class); + private final Logger log = LoggerFactory.getLogger(GoodWeEssImpl.class); private Config config; @@ -110,13 +111,13 @@ protected void deactivate() { super.deactivate(); } - public GoodWeEtBatteryInverterImpl() throws OpenemsNamedException { + public GoodWeEssImpl() throws OpenemsNamedException { super(// OpenemsComponent.ChannelId.values(), // SymmetricEss.ChannelId.values(), // ManagedSymmetricEss.ChannelId.values(), // HybridEss.ChannelId.values(), // - EssChannelId.values() // + GoodWeEss.ChannelId.values() // ); } @@ -131,8 +132,8 @@ protected ModbusProtocol defineModbusProtocol() { new FC3ReadRegistersTask(35001, Priority.ONCE, // m(SymmetricEss.ChannelId.MAX_APPARENT_POWER, new UnsignedWordElement(35001)), // new DummyRegisterElement(35002), // - m(EssChannelId.SERIAL_NUMBER, new StringWordElement(35003, 8)), // - m(EssChannelId.GOODWE_TYPE, new StringWordElement(35011, 5), + m(GoodWeEss.ChannelId.SERIAL_NUMBER, new StringWordElement(35003, 8)), // + m(GoodWeEss.ChannelId.GOODWE_TYPE, new StringWordElement(35011, 5), new ElementToChannelConverter((value) -> { String stringValue = TypeUtils.getAsType(OpenemsType.STRING, value); switch (stringValue) { @@ -149,17 +150,17 @@ protected ModbusProtocol defineModbusProtocol() { }))), // new FC3ReadRegistersTask(35111, Priority.LOW, // - m(EssChannelId.V_PV3, new UnsignedWordElement(35111), + m(GoodWeEss.ChannelId.V_PV3, new UnsignedWordElement(35111), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.I_PV3, new UnsignedWordElement(35112), + m(GoodWeEss.ChannelId.I_PV3, new UnsignedWordElement(35112), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // new DummyRegisterElement(35113, 35114), // - m(EssChannelId.V_PV4, new UnsignedWordElement(35115), + m(GoodWeEss.ChannelId.V_PV4, new UnsignedWordElement(35115), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.I_PV4, new UnsignedWordElement(35116), + m(GoodWeEss.ChannelId.I_PV4, new UnsignedWordElement(35116), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // new DummyRegisterElement(35117, 35118), // - m(EssChannelId.PV_MODE, new UnsignedDoublewordElement(35119))), // + m(GoodWeEss.ChannelId.PV_MODE, new UnsignedDoublewordElement(35119))), // new FC3ReadRegistersTask(35136, Priority.HIGH, // m(SymmetricEss.ChannelId.GRID_MODE, new UnsignedWordElement(35136), // @@ -178,70 +179,70 @@ protected ModbusProtocol defineModbusProtocol() { return GridMode.UNDEFINED; }))), // new FC3ReadRegistersTask(35138, Priority.LOW, // - m(EssChannelId.TOTAL_INV_POWER, new SignedWordElement(35138)), // + m(GoodWeEss.ChannelId.TOTAL_INV_POWER, new SignedWordElement(35138)), // new DummyRegisterElement(35139), // - m(EssChannelId.AC_ACTIVE_POWER, new SignedWordElement(35140), // + m(GoodWeEss.ChannelId.AC_ACTIVE_POWER, new SignedWordElement(35140), // ElementToChannelConverter.INVERT), // new DummyRegisterElement(35141), // - m(EssChannelId.AC_REACTIVE_POWER, new SignedWordElement(35142), // + m(GoodWeEss.ChannelId.AC_REACTIVE_POWER, new SignedWordElement(35142), // ElementToChannelConverter.INVERT), // new DummyRegisterElement(35143), // - m(EssChannelId.AC_APPARENT_POWER, new SignedWordElement(35144), // + m(GoodWeEss.ChannelId.AC_APPARENT_POWER, new SignedWordElement(35144), // ElementToChannelConverter.INVERT), // - m(EssChannelId.BACK_UP_V_LOAD_R, new UnsignedWordElement(35145), // + m(GoodWeEss.ChannelId.BACK_UP_V_LOAD_R, new UnsignedWordElement(35145), // ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_I_LOAD_R, new UnsignedWordElement(35146), + m(GoodWeEss.ChannelId.BACK_UP_I_LOAD_R, new UnsignedWordElement(35146), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_F_LOAD_R, new UnsignedWordElement(35147), + m(GoodWeEss.ChannelId.BACK_UP_F_LOAD_R, new UnsignedWordElement(35147), ElementToChannelConverter.SCALE_FACTOR_MINUS_2), // - m(EssChannelId.LOAD_MODE_R, new UnsignedWordElement(35148)), // + m(GoodWeEss.ChannelId.LOAD_MODE_R, new UnsignedWordElement(35148)), // new DummyRegisterElement(35149), // - m(EssChannelId.BACK_UP_P_LOAD_R, new SignedWordElement(35150)), // - m(EssChannelId.BACK_UP_V_LOAD_S, new UnsignedWordElement(35151), + m(GoodWeEss.ChannelId.BACK_UP_P_LOAD_R, new SignedWordElement(35150)), // + m(GoodWeEss.ChannelId.BACK_UP_V_LOAD_S, new UnsignedWordElement(35151), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_I_LOAD_S, new UnsignedWordElement(35152), + m(GoodWeEss.ChannelId.BACK_UP_I_LOAD_S, new UnsignedWordElement(35152), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_F_LOAD_S, new UnsignedWordElement(35153), + m(GoodWeEss.ChannelId.BACK_UP_F_LOAD_S, new UnsignedWordElement(35153), ElementToChannelConverter.SCALE_FACTOR_MINUS_2), // - m(EssChannelId.LOAD_MODE_S, new UnsignedWordElement(35154)), // + m(GoodWeEss.ChannelId.LOAD_MODE_S, new UnsignedWordElement(35154)), // new DummyRegisterElement(35155), // - m(EssChannelId.BACK_UP_P_LOAD_S, new SignedWordElement(35156)), // - m(EssChannelId.BACK_UP_V_LOAD_T, new UnsignedWordElement(35157), + m(GoodWeEss.ChannelId.BACK_UP_P_LOAD_S, new SignedWordElement(35156)), // + m(GoodWeEss.ChannelId.BACK_UP_V_LOAD_T, new UnsignedWordElement(35157), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_I_LOAD_T, new UnsignedWordElement(35158), + m(GoodWeEss.ChannelId.BACK_UP_I_LOAD_T, new UnsignedWordElement(35158), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BACK_UP_F_LOAD_T, new UnsignedWordElement(35159), + m(GoodWeEss.ChannelId.BACK_UP_F_LOAD_T, new UnsignedWordElement(35159), ElementToChannelConverter.SCALE_FACTOR_MINUS_2), // - m(EssChannelId.LOAD_MODE_T, new UnsignedWordElement(35160)), // + m(GoodWeEss.ChannelId.LOAD_MODE_T, new UnsignedWordElement(35160)), // new DummyRegisterElement(35161), // - m(EssChannelId.BACK_UP_P_LOAD_T, new SignedWordElement(35162)), // + m(GoodWeEss.ChannelId.BACK_UP_P_LOAD_T, new SignedWordElement(35162)), // new DummyRegisterElement(35163), // - m(EssChannelId.P_LOAD_R, new SignedWordElement(35164)), // + m(GoodWeEss.ChannelId.P_LOAD_R, new SignedWordElement(35164)), // new DummyRegisterElement(35165), // - m(EssChannelId.P_LOAD_S, new SignedWordElement(35166)), // + m(GoodWeEss.ChannelId.P_LOAD_S, new SignedWordElement(35166)), // new DummyRegisterElement(35167), // - m(EssChannelId.P_LOAD_T, new SignedWordElement(35168)), // + m(GoodWeEss.ChannelId.P_LOAD_T, new SignedWordElement(35168)), // new DummyRegisterElement(35169), // - m(EssChannelId.TOTAL_BACK_UP_LOAD, new SignedWordElement(35170)), // + m(GoodWeEss.ChannelId.TOTAL_BACK_UP_LOAD, new SignedWordElement(35170)), // new DummyRegisterElement(35171), // - m(EssChannelId.TOTAL_LOAD_POWER, new SignedWordElement(35172)), // - m(EssChannelId.UPS_LOAD_PERCENT, new UnsignedWordElement(35173), + m(GoodWeEss.ChannelId.TOTAL_LOAD_POWER, new SignedWordElement(35172)), // + m(GoodWeEss.ChannelId.UPS_LOAD_PERCENT, new UnsignedWordElement(35173), ElementToChannelConverter.SCALE_FACTOR_MINUS_2)), // new FC3ReadRegistersTask(35180, Priority.HIGH, // - m(EssChannelId.V_BATTERY1, new UnsignedWordElement(35180), + m(GoodWeEss.ChannelId.V_BATTERY1, new UnsignedWordElement(35180), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.I_BATTERY1, new SignedWordElement(35181), + m(GoodWeEss.ChannelId.I_BATTERY1, new SignedWordElement(35181), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // new DummyRegisterElement(35182), // - m(EssChannelId.P_BATTERY1, new SignedWordElement(35183)), // - m(EssChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // + m(GoodWeEss.ChannelId.P_BATTERY1, new SignedWordElement(35183)), // + m(GoodWeEss.ChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // new FC3ReadRegistersTask(35185, Priority.LOW, // - m(EssChannelId.WARNING_CODE, new UnsignedWordElement(35185)), // - m(EssChannelId.SAFETY_COUNTRY, new UnsignedWordElement(35186)), // - m(EssChannelId.WORK_MODE, new UnsignedWordElement(35187)), // - m(EssChannelId.OPERATION_MODE, new UnsignedDoublewordElement(35188))), // + m(GoodWeEss.ChannelId.WARNING_CODE, new UnsignedWordElement(35185)), // + m(GoodWeEss.ChannelId.SAFETY_COUNTRY, new UnsignedWordElement(35186)), // + m(GoodWeEss.ChannelId.WORK_MODE, new UnsignedWordElement(35187)), // + m(GoodWeEss.ChannelId.OPERATION_MODE, new UnsignedDoublewordElement(35188))), // new FC3ReadRegistersTask(35206, Priority.LOW, // m(HybridEss.ChannelId.DC_CHARGE_ENERGY, new UnsignedDoublewordElement(35206), // @@ -251,23 +252,23 @@ protected ModbusProtocol defineModbusProtocol() { ElementToChannelConverter.SCALE_FACTOR_2)), // new FC3ReadRegistersTask(36003, Priority.LOW, // - m(EssChannelId.B_METER_COMMUNICATE_STATUS, new UnsignedWordElement(36003)), // - m(EssChannelId.METER_COMMUNICATE_STATUS, new UnsignedWordElement(36004))), // + m(GoodWeEss.ChannelId.B_METER_COMMUNICATE_STATUS, new UnsignedWordElement(36003)), // + m(GoodWeEss.ChannelId.METER_COMMUNICATE_STATUS, new UnsignedWordElement(36004))), // new FC3ReadRegistersTask(37001, Priority.LOW, - m(EssChannelId.BATTERY_TYPE_INDEX, new UnsignedWordElement(37001)), // - m(EssChannelId.BMS_STATUS, new UnsignedWordElement(37002)), // - m(EssChannelId.BMS_PACK_TEMPERATURE, new UnsignedWordElement(37003), + m(GoodWeEss.ChannelId.BATTERY_TYPE_INDEX, new UnsignedWordElement(37001)), // + m(GoodWeEss.ChannelId.BMS_STATUS, new UnsignedWordElement(37002)), // + m(GoodWeEss.ChannelId.BMS_PACK_TEMPERATURE, new UnsignedWordElement(37003), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // - m(EssChannelId.BMS_CHARGE_IMAX, new UnsignedWordElement(37004)), // - m(EssChannelId.BMS_DISCHARGE_IMAX, new UnsignedWordElement(37005))), // + m(GoodWeEss.ChannelId.BMS_CHARGE_IMAX, new UnsignedWordElement(37004)), // + m(GoodWeEss.ChannelId.BMS_DISCHARGE_IMAX, new UnsignedWordElement(37005))), // new FC3ReadRegistersTask(37007, Priority.HIGH, // m(SymmetricEss.ChannelId.SOC, new UnsignedWordElement(37007), new ElementToChannelConverter( // element -> channel value -> { // Set SoC to undefined if there is No Battery - EnumReadChannel batteryModeChannel = this.channel(EssChannelId.BATTERY_MODE); + EnumReadChannel batteryModeChannel = this.channel(GoodWeEss.ChannelId.BATTERY_MODE); BatteryMode batteryMode = batteryModeChannel.value().asEnum(); if (batteryMode == BatteryMode.NO_BATTERY || batteryMode == BatteryMode.UNDEFINED) { return null; @@ -278,152 +279,152 @@ protected ModbusProtocol defineModbusProtocol() { // channel -> element value -> value))), // new FC3ReadRegistersTask(37008, Priority.LOW, // - m(EssChannelId.BMS_SOH, new UnsignedWordElement(37008)), // - m(EssChannelId.BMS_BATTERY_STRINGS, new UnsignedWordElement(37009))), // + m(GoodWeEss.ChannelId.BMS_SOH, new UnsignedWordElement(37008)), // + m(GoodWeEss.ChannelId.BMS_BATTERY_STRINGS, new UnsignedWordElement(37009))), // new FC16WriteRegistersTask(47000, // - m(EssChannelId.APP_MODE_INDEX, new UnsignedWordElement(47000)), // - m(EssChannelId.METER_CHECK_VALUE, new UnsignedWordElement(47001)), // - m(EssChannelId.WMETER_CONNECT_CHECK_FLAG, new UnsignedWordElement(47002))), // + m(GoodWeEss.ChannelId.APP_MODE_INDEX, new UnsignedWordElement(47000)), // + m(GoodWeEss.ChannelId.METER_CHECK_VALUE, new UnsignedWordElement(47001)), // + m(GoodWeEss.ChannelId.WMETER_CONNECT_CHECK_FLAG, new UnsignedWordElement(47002))), // new FC3ReadRegistersTask(47000, Priority.LOW, // - m(EssChannelId.APP_MODE_INDEX, new UnsignedWordElement(47000)), // - m(EssChannelId.METER_CHECK_VALUE, new UnsignedWordElement(47001)), // - m(EssChannelId.WMETER_CONNECT_CHECK_FLAG, new UnsignedWordElement(47002))), // + m(GoodWeEss.ChannelId.APP_MODE_INDEX, new UnsignedWordElement(47000)), // + m(GoodWeEss.ChannelId.METER_CHECK_VALUE, new UnsignedWordElement(47001)), // + m(GoodWeEss.ChannelId.WMETER_CONNECT_CHECK_FLAG, new UnsignedWordElement(47002))), // new FC16WriteRegistersTask(47500, // - m(EssChannelId.STOP_SOC_PROTECT, new UnsignedWordElement(47500)), // + m(GoodWeEss.ChannelId.STOP_SOC_PROTECT, new UnsignedWordElement(47500)), // new DummyRegisterElement(47501, 47508), // - m(EssChannelId.FEED_POWER_ENABLE, new UnsignedWordElement(47509)), // - m(EssChannelId.FEED_POWER_PARA, new UnsignedWordElement(47510)), // - m(EssChannelId.EMS_POWER_MODE, new UnsignedWordElement(47511)), // - m(EssChannelId.EMS_POWER_SET, new UnsignedWordElement(47512))), // + m(GoodWeEss.ChannelId.FEED_POWER_ENABLE, new UnsignedWordElement(47509)), // + m(GoodWeEss.ChannelId.FEED_POWER_PARA, new UnsignedWordElement(47510)), // + m(GoodWeEss.ChannelId.EMS_POWER_MODE, new UnsignedWordElement(47511)), // + m(GoodWeEss.ChannelId.EMS_POWER_SET, new UnsignedWordElement(47512))), // new FC16WriteRegistersTask(47531, // - m(EssChannelId.SOC_START_TO_FORCE_CHARGE, new UnsignedWordElement(47531)), // - m(EssChannelId.SOC_STOP_TO_FORCE_CHARGE, new UnsignedWordElement(47532)), // - m(EssChannelId.CLEAR_ALL_ECONOMIC_MODE, new UnsignedWordElement(47533))), // + m(GoodWeEss.ChannelId.SOC_START_TO_FORCE_CHARGE, new UnsignedWordElement(47531)), // + m(GoodWeEss.ChannelId.SOC_STOP_TO_FORCE_CHARGE, new UnsignedWordElement(47532)), // + m(GoodWeEss.ChannelId.CLEAR_ALL_ECONOMIC_MODE, new UnsignedWordElement(47533))), // new FC3ReadRegistersTask(47500, Priority.LOW, - m(EssChannelId.STOP_SOC_PROTECT, new UnsignedWordElement(47500)), // + m(GoodWeEss.ChannelId.STOP_SOC_PROTECT, new UnsignedWordElement(47500)), // new DummyRegisterElement(47501, 47508), // - m(EssChannelId.FEED_POWER_ENABLE, new UnsignedWordElement(47509)), // - m(EssChannelId.FEED_POWER_PARA, new UnsignedWordElement(47510))), // + m(GoodWeEss.ChannelId.FEED_POWER_ENABLE, new UnsignedWordElement(47509)), // + m(GoodWeEss.ChannelId.FEED_POWER_PARA, new UnsignedWordElement(47510))), // new FC3ReadRegistersTask(47511, Priority.HIGH, - m(EssChannelId.EMS_POWER_MODE, new UnsignedWordElement(47511)), // - m(EssChannelId.EMS_POWER_SET, new UnsignedWordElement(47512))), // + m(GoodWeEss.ChannelId.EMS_POWER_MODE, new UnsignedWordElement(47511)), // + m(GoodWeEss.ChannelId.EMS_POWER_SET, new UnsignedWordElement(47512))), // new FC3ReadRegistersTask(47531, Priority.LOW, - m(EssChannelId.SOC_START_TO_FORCE_CHARGE, new UnsignedWordElement(47531)), // - m(EssChannelId.SOC_STOP_TO_FORCE_CHARGE, new UnsignedWordElement(47532))), // + m(GoodWeEss.ChannelId.SOC_START_TO_FORCE_CHARGE, new UnsignedWordElement(47531)), // + m(GoodWeEss.ChannelId.SOC_STOP_TO_FORCE_CHARGE, new UnsignedWordElement(47532))), // new FC16WriteRegistersTask(47900, // - m(EssChannelId.BMS_VERSION, new UnsignedWordElement(47900)), // - m(EssChannelId.BATT_STRINGS_RS485, new UnsignedWordElement(47901)), // - m(EssChannelId.WBMS_BAT_CHARGE_VMAX, new UnsignedWordElement(47902)), // - m(EssChannelId.WBMS_BAT_CHARGE_IMAX, new UnsignedWordElement(47903)), // - m(EssChannelId.WBMS_BAT_DISCHARGE_VMIN, new UnsignedWordElement(47904)), // - m(EssChannelId.WBMS_BAT_DISCHARGE_IMAX, new UnsignedWordElement(47905)), // - m(EssChannelId.WBMS_BAT_VOLTAGE, new UnsignedWordElement(47906)), // - m(EssChannelId.WBMS_BAT_CURRENT, new UnsignedWordElement(47907)), // - m(EssChannelId.WBMS_BAT_SOC, new UnsignedWordElement(47908)), // - m(EssChannelId.WBMS_BAT_SOH, new UnsignedWordElement(47909)), // - m(EssChannelId.WBMS_BAT_TEMPERATURE, new UnsignedWordElement(47910)), // + m(GoodWeEss.ChannelId.BMS_VERSION, new UnsignedWordElement(47900)), // + m(GoodWeEss.ChannelId.BATT_STRINGS_RS485, new UnsignedWordElement(47901)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CHARGE_VMAX, new UnsignedWordElement(47902)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CHARGE_IMAX, new UnsignedWordElement(47903)), // + m(GoodWeEss.ChannelId.WBMS_BAT_DISCHARGE_VMIN, new UnsignedWordElement(47904)), // + m(GoodWeEss.ChannelId.WBMS_BAT_DISCHARGE_IMAX, new UnsignedWordElement(47905)), // + m(GoodWeEss.ChannelId.WBMS_BAT_VOLTAGE, new UnsignedWordElement(47906)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CURRENT, new UnsignedWordElement(47907)), // + m(GoodWeEss.ChannelId.WBMS_BAT_SOC, new UnsignedWordElement(47908)), // + m(GoodWeEss.ChannelId.WBMS_BAT_SOH, new UnsignedWordElement(47909)), // + m(GoodWeEss.ChannelId.WBMS_BAT_TEMPERATURE, new UnsignedWordElement(47910)), // m(new BitsWordElement(47911, this) // - .bit(0, EssChannelId.STATE_58) // - .bit(1, EssChannelId.STATE_59) // - .bit(2, EssChannelId.STATE_60) // - .bit(3, EssChannelId.STATE_61) // - .bit(4, EssChannelId.STATE_62) // - .bit(5, EssChannelId.STATE_63) // - .bit(6, EssChannelId.STATE_64) // - .bit(7, EssChannelId.STATE_65) // - .bit(8, EssChannelId.STATE_66) // - .bit(9, EssChannelId.STATE_67) // - .bit(10, EssChannelId.STATE_68) // - .bit(11, EssChannelId.STATE_69)), // + .bit(0, GoodWeEss.ChannelId.STATE_58) // + .bit(1, GoodWeEss.ChannelId.STATE_59) // + .bit(2, GoodWeEss.ChannelId.STATE_60) // + .bit(3, GoodWeEss.ChannelId.STATE_61) // + .bit(4, GoodWeEss.ChannelId.STATE_62) // + .bit(5, GoodWeEss.ChannelId.STATE_63) // + .bit(6, GoodWeEss.ChannelId.STATE_64) // + .bit(7, GoodWeEss.ChannelId.STATE_65) // + .bit(8, GoodWeEss.ChannelId.STATE_66) // + .bit(9, GoodWeEss.ChannelId.STATE_67) // + .bit(10, GoodWeEss.ChannelId.STATE_68) // + .bit(11, GoodWeEss.ChannelId.STATE_69)), // new DummyRegisterElement(47912), // m(new BitsWordElement(47913, this) // - .bit(0, EssChannelId.STATE_42) // - .bit(1, EssChannelId.STATE_43) // - .bit(2, EssChannelId.STATE_44) // - .bit(3, EssChannelId.STATE_45) // - .bit(4, EssChannelId.STATE_46) // - .bit(5, EssChannelId.STATE_47) // - .bit(6, EssChannelId.STATE_48) // - .bit(7, EssChannelId.STATE_49) // - .bit(8, EssChannelId.STATE_50) // - .bit(9, EssChannelId.STATE_51) // - .bit(10, EssChannelId.STATE_52) // - .bit(11, EssChannelId.STATE_53) // - .bit(12, EssChannelId.STATE_54) // - .bit(13, EssChannelId.STATE_55) // - .bit(14, EssChannelId.STATE_56) // - .bit(15, EssChannelId.STATE_57)), // + .bit(0, GoodWeEss.ChannelId.STATE_42) // + .bit(1, GoodWeEss.ChannelId.STATE_43) // + .bit(2, GoodWeEss.ChannelId.STATE_44) // + .bit(3, GoodWeEss.ChannelId.STATE_45) // + .bit(4, GoodWeEss.ChannelId.STATE_46) // + .bit(5, GoodWeEss.ChannelId.STATE_47) // + .bit(6, GoodWeEss.ChannelId.STATE_48) // + .bit(7, GoodWeEss.ChannelId.STATE_49) // + .bit(8, GoodWeEss.ChannelId.STATE_50) // + .bit(9, GoodWeEss.ChannelId.STATE_51) // + .bit(10, GoodWeEss.ChannelId.STATE_52) // + .bit(11, GoodWeEss.ChannelId.STATE_53) // + .bit(12, GoodWeEss.ChannelId.STATE_54) // + .bit(13, GoodWeEss.ChannelId.STATE_55) // + .bit(14, GoodWeEss.ChannelId.STATE_56) // + .bit(15, GoodWeEss.ChannelId.STATE_57)), // new DummyRegisterElement(47914), // m(new BitsWordElement(47915, this) // - .bit(0, EssChannelId.STATE_79) // - .bit(1, EssChannelId.STATE_80) // - .bit(2, EssChannelId.STATE_81))), // + .bit(0, GoodWeEss.ChannelId.STATE_79) // + .bit(1, GoodWeEss.ChannelId.STATE_80) // + .bit(2, GoodWeEss.ChannelId.STATE_81))), // new FC3ReadRegistersTask(47902, Priority.LOW, // - m(EssChannelId.WBMS_BAT_CHARGE_VMAX, new UnsignedWordElement(47902)), // - m(EssChannelId.WBMS_BAT_CHARGE_IMAX, new UnsignedWordElement(47903)), // - m(EssChannelId.WBMS_BAT_DISCHARGE_VMIN, new UnsignedWordElement(47904)), // - m(EssChannelId.WBMS_BAT_DISCHARGE_IMAX, new UnsignedWordElement(47905)), // - m(EssChannelId.WBMS_BAT_VOLTAGE, new UnsignedWordElement(47906)), // - m(EssChannelId.WBMS_BAT_CURRENT, new UnsignedWordElement(47907)), // - m(EssChannelId.WBMS_BAT_SOC, new UnsignedWordElement(47908)), // - m(EssChannelId.WBMS_BAT_SOH, new UnsignedWordElement(47909)), // - m(EssChannelId.WBMS_BAT_TEMPERATURE, new UnsignedWordElement(47910)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CHARGE_VMAX, new UnsignedWordElement(47902)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CHARGE_IMAX, new UnsignedWordElement(47903)), // + m(GoodWeEss.ChannelId.WBMS_BAT_DISCHARGE_VMIN, new UnsignedWordElement(47904)), // + m(GoodWeEss.ChannelId.WBMS_BAT_DISCHARGE_IMAX, new UnsignedWordElement(47905)), // + m(GoodWeEss.ChannelId.WBMS_BAT_VOLTAGE, new UnsignedWordElement(47906)), // + m(GoodWeEss.ChannelId.WBMS_BAT_CURRENT, new UnsignedWordElement(47907)), // + m(GoodWeEss.ChannelId.WBMS_BAT_SOC, new UnsignedWordElement(47908)), // + m(GoodWeEss.ChannelId.WBMS_BAT_SOH, new UnsignedWordElement(47909)), // + m(GoodWeEss.ChannelId.WBMS_BAT_TEMPERATURE, new UnsignedWordElement(47910)), // m(new BitsWordElement(47911, this) // - .bit(0, EssChannelId.STATE_58) // - .bit(1, EssChannelId.STATE_59) // - .bit(2, EssChannelId.STATE_60) // - .bit(3, EssChannelId.STATE_61) // - .bit(4, EssChannelId.STATE_62) // - .bit(5, EssChannelId.STATE_63) // - .bit(6, EssChannelId.STATE_64) // - .bit(7, EssChannelId.STATE_65) // - .bit(8, EssChannelId.STATE_66) // - .bit(9, EssChannelId.STATE_67) // - .bit(10, EssChannelId.STATE_68) // - .bit(11, EssChannelId.STATE_69)), // + .bit(0, GoodWeEss.ChannelId.STATE_58) // + .bit(1, GoodWeEss.ChannelId.STATE_59) // + .bit(2, GoodWeEss.ChannelId.STATE_60) // + .bit(3, GoodWeEss.ChannelId.STATE_61) // + .bit(4, GoodWeEss.ChannelId.STATE_62) // + .bit(5, GoodWeEss.ChannelId.STATE_63) // + .bit(6, GoodWeEss.ChannelId.STATE_64) // + .bit(7, GoodWeEss.ChannelId.STATE_65) // + .bit(8, GoodWeEss.ChannelId.STATE_66) // + .bit(9, GoodWeEss.ChannelId.STATE_67) // + .bit(10, GoodWeEss.ChannelId.STATE_68) // + .bit(11, GoodWeEss.ChannelId.STATE_69)), // new DummyRegisterElement(47912), // m(new BitsWordElement(47913, this) // - .bit(0, EssChannelId.STATE_42) // - .bit(1, EssChannelId.STATE_43) // - .bit(2, EssChannelId.STATE_44) // - .bit(3, EssChannelId.STATE_45) // - .bit(4, EssChannelId.STATE_46) // - .bit(5, EssChannelId.STATE_47) // - .bit(6, EssChannelId.STATE_48) // - .bit(7, EssChannelId.STATE_49) // - .bit(8, EssChannelId.STATE_50) // - .bit(9, EssChannelId.STATE_51) // - .bit(10, EssChannelId.STATE_52) // - .bit(11, EssChannelId.STATE_53) // - .bit(12, EssChannelId.STATE_54) // - .bit(13, EssChannelId.STATE_55) // - .bit(14, EssChannelId.STATE_56) // - .bit(15, EssChannelId.STATE_57)), // + .bit(0, GoodWeEss.ChannelId.STATE_42) // + .bit(1, GoodWeEss.ChannelId.STATE_43) // + .bit(2, GoodWeEss.ChannelId.STATE_44) // + .bit(3, GoodWeEss.ChannelId.STATE_45) // + .bit(4, GoodWeEss.ChannelId.STATE_46) // + .bit(5, GoodWeEss.ChannelId.STATE_47) // + .bit(6, GoodWeEss.ChannelId.STATE_48) // + .bit(7, GoodWeEss.ChannelId.STATE_49) // + .bit(8, GoodWeEss.ChannelId.STATE_50) // + .bit(9, GoodWeEss.ChannelId.STATE_51) // + .bit(10, GoodWeEss.ChannelId.STATE_52) // + .bit(11, GoodWeEss.ChannelId.STATE_53) // + .bit(12, GoodWeEss.ChannelId.STATE_54) // + .bit(13, GoodWeEss.ChannelId.STATE_55) // + .bit(14, GoodWeEss.ChannelId.STATE_56) // + .bit(15, GoodWeEss.ChannelId.STATE_57)), // new DummyRegisterElement(47914), // m(new BitsWordElement(47915, this) // - .bit(0, EssChannelId.STATE_79) // - .bit(1, EssChannelId.STATE_80) // - .bit(2, EssChannelId.STATE_81)))); + .bit(0, GoodWeEss.ChannelId.STATE_79) // + .bit(1, GoodWeEss.ChannelId.STATE_80) // + .bit(2, GoodWeEss.ChannelId.STATE_81)))); } @Override public void applyPower(int activePower, int reactivePower) throws OpenemsNamedException { int pvProduction = getPvProduction(); int soc = this.getSoc().orElse(0); - ApplyPowerStateMachine.State state = ApplyPowerStateMachine.evaluateState(this.getDeviceType(), + ApplyPowerStateMachine.State state = ApplyPowerStateMachine.evaluateState(this.getGoodweType(), config.readOnlyMode(), pvProduction, soc, activePower); // Store the current State - this.channel(EssChannelId.APPLY_POWER_STATE_MACHINE).setNextValue(state); + this.channel(GoodWeEss.ChannelId.APPLY_POWER_STATE_MACHINE).setNextValue(state); // Prepare Context Context context = new Context(this, pvProduction, activePower); @@ -432,10 +433,10 @@ public void applyPower(int activePower, int reactivePower) throws OpenemsNamedEx this.applyPowerStateMachine.run(context); // apply the force next state this.applyPowerStateMachine.run(context); // execute correct handler - IntegerWriteChannel emsPowerSetChannel = this.channel(EssChannelId.EMS_POWER_SET); + IntegerWriteChannel emsPowerSetChannel = this.channel(GoodWeEss.ChannelId.EMS_POWER_SET); emsPowerSetChannel.setNextWriteValue(context.getEssPowerSet()); - EnumWriteChannel emsPowerModeChannel = this.channel(EssChannelId.EMS_POWER_MODE); + EnumWriteChannel emsPowerModeChannel = this.channel(GoodWeEss.ChannelId.EMS_POWER_MODE); emsPowerModeChannel.setNextWriteValue(context.getNextPowerMode()); } @@ -475,7 +476,7 @@ private void updatechannels() { /* * Update ActivePower from P_BATTERY1 and chargers ACTUAL_POWER */ - final Channel batteryPower = this.channel(EssChannelId.P_BATTERY1); + final Channel batteryPower = this.channel(GoodWeEss.ChannelId.P_BATTERY1); Integer activePower = batteryPower.getNextValue().get(); Integer productionPower = null; for (AbstractGoodWeEtCharger charger : this.chargers) { @@ -606,22 +607,4 @@ private int getPvProduction() { return productionPower; } - /** - * Gets the Channel for {@link EssChannelId#GOODWE_TYPE}. - * - * @return the Channel - */ - private Channel getDeviceTypeChannel() { - return this.channel(EssChannelId.GOODWE_TYPE); - } - - /** - * Gets the Device Type. See {@link EssChannelId#GOODWE_TYPE}. - * - * @return the Channel {@link Value} - */ - private GoodweType getDeviceType() { - return this.getDeviceTypeChannel().value().asEnum(); - } - } diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java deleted file mode 100644 index df85b15cecc..00000000000 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverter.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.openems.edge.goodwe.et.ess; - -import io.openems.edge.common.component.OpenemsComponent; -import io.openems.edge.ess.api.SymmetricEss; -import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; - -public interface GoodWeEtBatteryInverter extends SymmetricEss, OpenemsComponent { - - public Integer getUnitId(); - - public String getModbusBridgeId(); - - public void addCharger(AbstractGoodWeEtCharger charger); - - public void removeCharger(AbstractGoodWeEtCharger charger); - -} diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java deleted file mode 100644 index 5dbe73f552e..00000000000 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GridMode.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.openems.edge.goodwe.et.ess; - -import io.openems.common.types.OptionsEnum; - -public enum GridMode implements OptionsEnum { - UNDEFINED(-1, "Undefined"), // - OFF_GRID(0, "Loss, inverter disconnects to Grid"), // - ON_GRID(1, "OK, inverter connects to Grid"), // - FAULT(2, "Fault,something is wrong"); // - - private final int value; - private final String option; - - private GridMode(int value, String option) { - this.value = value; - this.option = option; - } - - @Override - public int getValue() { - return this.value; - } - - @Override - public String getName() { - return this.option; - } - - @Override - public OptionsEnum getUndefined() { - return UNDEFINED; - } -} \ No newline at end of file diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java index 3a6a21095df..d6c2e0da269 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java @@ -3,7 +3,7 @@ import io.openems.common.types.OptionsEnum; import io.openems.edge.common.statemachine.AbstractStateMachine; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.GoodweType; +import io.openems.edge.goodwe.et.ess.enums.GoodweType; public class ApplyPowerStateMachine extends AbstractStateMachine { @@ -106,14 +106,14 @@ public StateHandler getStateHandler(State state) { * @param activePowerSetPoint * @return */ - public static State evaluateState(GoodweType deviceType, boolean readOnlyMode, int pvProduction, int soc, + public static State evaluateState(GoodweType goodweType, boolean readOnlyMode, int pvProduction, int soc, int activePowerSetPoint) { if (readOnlyMode) { // Read-Only-Mode: fall-back to internal self-consumption optimization return State.READ_ONLY; } else { - switch (deviceType) { + switch (goodweType) { case GOODWE_10K_BT: if (activePowerSetPoint > 0) { // Set-Point is positive diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java index 0e804ccb871..f9be97568a8 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class BtChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java index 71769ebc2f2..235815c5056 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class BtDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java index ecd575ecbcf..45e01518225 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java @@ -1,18 +1,18 @@ package io.openems.edge.goodwe.et.ess.applypower; -import io.openems.edge.goodwe.et.ess.GoodWeEtBatteryInverterImpl; -import io.openems.edge.goodwe.et.ess.PowerModeEms; +import io.openems.edge.goodwe.et.ess.GoodWeEssImpl; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class Context { - protected final GoodWeEtBatteryInverterImpl component; + protected final GoodWeEssImpl component; protected final int pvProduction; protected final int activePowerSetPoint; private PowerModeEms nextPowerMode; private int essPowerSet; - public Context(GoodWeEtBatteryInverterImpl component, int pvProduction, int activePowerSetPoint) { + public Context(GoodWeEssImpl component, int pvProduction, int activePowerSetPoint) { super(); this.component = component; this.pvProduction = pvProduction; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java index b28f2633e34..eb9ecb62180 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtEmptyNegativeChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java index 166285a2f4b..1894f9d55ad 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtEmptyPositivePvHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java index e64a9fe015b..5f341736421 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtFullNegativeCurtailHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java index c7dcc8986e9..c36c812352f 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtFullPositiveCurtailHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java index 88a642ef042..4acaaba7b7e 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtFullPositiveDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java index 69090b2b7d8..6a868c634f6 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtInbetweenNegativeChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java index ce0ac9164ba..84b540d426e 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtInbetweenPositiveChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java index cc8d8bd7e64..0472850a8b5 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class EtInbetweenPositiveDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java index 3ef25e9252f..5afa7b5297d 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class ReadOnlyHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java index d38d27ade48..129e1ca31c3 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java @@ -1,8 +1,8 @@ package io.openems.edge.goodwe.et.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.PowerModeEms; import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class UndefinedHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java similarity index 93% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java index 8f8a87bcfce..bcac26770c6 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/AppModeIndex.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/BatteryMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/BatteryMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java index 4e546e5c8c5..1e48bf7108a 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/BatteryMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodweType.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodweType.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java index 646d87d0efe..c4326298599 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodweType.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/LoadMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/LoadMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java index 17b32883bae..01a9cf87065 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/LoadMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java index b71e17079b7..6f33d4d6092 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterCommunicateStatus.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java index ce4668f4c4a..458704c356a 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectCheckFlag.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java index 1ce05dd4902..6c7b2c16d80 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/MeterConnectStatus.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OperationMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OperationMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java index 2e7875e3ba3..2cf7705558b 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OperationMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java similarity index 93% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java index 5d18e356d9c..1a09fbef466 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/OutputTypeAC.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java similarity index 96% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java index 8836e8229d7..34c21fbd1d3 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/PowerModeEms.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java similarity index 98% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java index c34d240bc01..a6de86f8191 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/SafetyCountry.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/WorkMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/WorkMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java index f67f291ef68..590ba65cd09 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/WorkMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.et.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java index e40cdeb7e0c..d812d2ecec7 100644 --- a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java +++ b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java @@ -11,6 +11,8 @@ import io.openems.edge.ess.test.ManagedSymmetricEssTest; import io.openems.edge.goodwe.et.GoodWeConstants; import io.openems.edge.goodwe.et.charger.GoodWeChargerPv1; +import io.openems.edge.goodwe.et.ess.enums.GoodweType; +import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; public class GoodWeEtBatteryInverterImplTest { @@ -40,7 +42,7 @@ public void testEt() throws Exception { .setUnitId(GoodWeConstants.DEFAULT_UNIT_ID) // .build()); - GoodWeEtBatteryInverterImpl ess = new GoodWeEtBatteryInverterImpl(); + GoodWeEssImpl ess = new GoodWeEssImpl(); ess.addCharger(charger); new ManagedSymmetricEssTest(ess) // .addReference("power", new DummyPower()) // @@ -102,7 +104,7 @@ public void testEt() throws Exception { @Test public void testBt() throws Exception { - GoodWeEtBatteryInverterImpl ess = new GoodWeEtBatteryInverterImpl(); + GoodWeEssImpl ess = new GoodWeEssImpl(); new ManagedSymmetricEssTest(ess) // .addReference("power", new DummyPower()) // .addReference("cm", new DummyConfigurationAdmin()) // From 6b6110d9d62a73c47d3be8b853989e3422ec89b4 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Wed, 28 Oct 2020 12:13:18 +0100 Subject: [PATCH 18/23] Rename java package; remove "et" from name --- .../edge/goodwe/{et => }/GoodWeConstants.java | 2 +- .../charger/AbstractGoodWeEtCharger.java | 2 +- .../goodwe/{et => }/charger/ConfigPV1.java | 4 +-- .../goodwe/{et => }/charger/ConfigPV2.java | 4 +-- .../{et => }/charger/GoodWeChargerPv1.java | 4 +-- .../{et => }/charger/GoodWeChargerPv2.java | 4 +-- .../goodwe/{et => }/charger/PvChannelId.java | 2 +- .../edge/goodwe/{et => }/ess/Config.java | 4 +-- .../edge/goodwe/{et => }/ess/GoodWeEss.java | 30 +++++++++---------- .../goodwe/{et => }/ess/GoodWeEssImpl.java | 12 ++++---- .../applypower/ApplyPowerStateMachine.java | 4 +-- .../ess/applypower/BtChargeHandler.java | 6 ++-- .../ess/applypower/BtDischargeHandler.java | 6 ++-- .../{et => }/ess/applypower/Context.java | 6 ++-- .../EtEmptyNegativeChargeHandler.java | 6 ++-- .../applypower/EtEmptyPositivePvHandler.java | 6 ++-- .../EtFullNegativeCurtailHandler.java | 6 ++-- .../EtFullPositiveCurtailHandler.java | 6 ++-- .../EtFullPositiveDischargeHandler.java | 6 ++-- .../EtInbetweenNegativeChargeHandler.java | 6 ++-- .../EtInbetweenPositiveChargeHandler.java | 6 ++-- .../EtInbetweenPositiveDischargeHandler.java | 6 ++-- .../ess/applypower/ReadOnlyHandler.java | 6 ++-- .../ess/applypower/UndefinedHandler.java | 6 ++-- .../{et => }/ess/enums/AppModeIndex.java | 2 +- .../{et => }/ess/enums/BatteryMode.java | 2 +- .../goodwe/{et => }/ess/enums/GoodweType.java | 2 +- .../goodwe/{et => }/ess/enums/LoadMode.java | 2 +- .../ess/enums/MeterCommunicateStatus.java | 2 +- .../ess/enums/MeterConnectCheckFlag.java | 2 +- .../ess/enums/MeterConnectStatus.java | 2 +- .../{et => }/ess/enums/OperationMode.java | 2 +- .../{et => }/ess/enums/OutputTypeAC.java | 2 +- .../{et => }/ess/enums/PowerModeEms.java | 2 +- .../{et => }/ess/enums/SafetyCountry.java | 2 +- .../goodwe/{et => }/ess/enums/WorkMode.java | 2 +- .../goodwe/{et => }/gridmeter/Config.java | 2 +- .../{et => }/gridmeter/GoodWeGridMeter.java | 2 +- .../gridmeter/GridMeterChannelId.java | 2 +- .../goodwe/{et => }/charger/MyConfig.java | 3 +- .../ess/GoodWeEtBatteryInverterImplTest.java | 12 ++++---- .../edge/goodwe/{et => }/ess/MyConfig.java | 3 +- 42 files changed, 100 insertions(+), 98 deletions(-) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/GoodWeConstants.java (73%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/AbstractGoodWeEtCharger.java (97%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/ConfigPV1.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/ConfigPV2.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/GoodWeChargerPv1.java (97%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/GoodWeChargerPv2.java (96%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/charger/PvChannelId.java (93%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/Config.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/GoodWeEss.java (97%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/GoodWeEssImpl.java (98%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/ApplyPowerStateMachine.java (97%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/BtChargeHandler.java (62%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/BtDischargeHandler.java (62%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/Context.java (81%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtEmptyNegativeChargeHandler.java (65%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtEmptyPositivePvHandler.java (64%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtFullNegativeCurtailHandler.java (61%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtFullPositiveCurtailHandler.java (63%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtFullPositiveDischargeHandler.java (65%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtInbetweenNegativeChargeHandler.java (65%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtInbetweenPositiveChargeHandler.java (65%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/EtInbetweenPositiveDischargeHandler.java (66%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/ReadOnlyHandler.java (58%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/applypower/UndefinedHandler.java (58%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/AppModeIndex.java (93%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/BatteryMode.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/GoodweType.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/LoadMode.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/MeterCommunicateStatus.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/MeterConnectCheckFlag.java (92%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/MeterConnectStatus.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/OperationMode.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/OutputTypeAC.java (93%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/PowerModeEms.java (96%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/SafetyCountry.java (98%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/ess/enums/WorkMode.java (94%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/gridmeter/Config.java (96%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/gridmeter/GoodWeGridMeter.java (99%) rename io.openems.edge.goodwe/src/io/openems/edge/goodwe/{et => }/gridmeter/GridMeterChannelId.java (94%) rename io.openems.edge.goodwe/test/io/openems/edge/goodwe/{et => }/charger/MyConfig.java (94%) rename io.openems.edge.goodwe/test/io/openems/edge/goodwe/{et => }/ess/GoodWeEtBatteryInverterImplTest.java (94%) rename io.openems.edge.goodwe/test/io/openems/edge/goodwe/{et => }/ess/MyConfig.java (96%) diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/GoodWeConstants.java similarity index 73% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/GoodWeConstants.java index 8bf8d5accfe..88eda3aa8f4 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/GoodWeConstants.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/GoodWeConstants.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et; +package io.openems.edge.goodwe; public class GoodWeConstants { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java similarity index 97% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java index a97efc55d61..3248e536ab3 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/AbstractGoodWeEtCharger.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent; import io.openems.edge.bridge.modbus.api.ElementToChannelConverter; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java index 75ef5344a96..0719d758e4d 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java @@ -1,9 +1,9 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeConstants; +import io.openems.edge.goodwe.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Charger PV1", // diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java index afa2e748ada..6399d7606f6 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/ConfigPV2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java @@ -1,9 +1,9 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeConstants; +import io.openems.edge.goodwe.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Charger PV2", // diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java similarity index 97% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java index 92897fb1784..290404583fd 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import org.osgi.service.cm.ConfigurationAdmin; import org.osgi.service.component.ComponentContext; @@ -20,7 +20,7 @@ import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.common.taskmanager.Priority; import io.openems.edge.ess.dccharger.api.EssDcCharger; -import io.openems.edge.goodwe.et.ess.GoodWeEss; +import io.openems.edge.goodwe.ess.GoodWeEss; @Designate(ocd = ConfigPV1.class, factory = true) @Component(// diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java similarity index 96% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java index e9cd102ca38..055be3b875e 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/GoodWeChargerPv2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import org.osgi.service.cm.ConfigurationAdmin; import org.osgi.service.component.ComponentContext; @@ -15,7 +15,7 @@ import io.openems.edge.bridge.modbus.api.BridgeModbus; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.ess.dccharger.api.EssDcCharger; -import io.openems.edge.goodwe.et.ess.GoodWeEss; +import io.openems.edge.goodwe.ess.GoodWeEss; @Designate(ocd = ConfigPV2.class, factory = true) @Component(// diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/PvChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/PvChannelId.java similarity index 93% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/PvChannelId.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/PvChannelId.java index a0001c98277..a036d2419ac 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/charger/PvChannelId.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/PvChannelId.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import io.openems.common.channel.AccessMode; import io.openems.common.channel.Unit; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java index a03ff10a7cc..7b98f04df25 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/Config.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java @@ -1,9 +1,9 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.ess; import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; -import io.openems.edge.goodwe.et.GoodWeConstants; +import io.openems.edge.goodwe.GoodWeConstants; @ObjectClassDefinition(// name = "GoodWe ET Battery-Inverter", // diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEss.java similarity index 97% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEss.java index 072272b4ea7..562b0e14b07 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEss.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEss.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.ess; import io.openems.common.channel.AccessMode; import io.openems.common.channel.Level; @@ -9,20 +9,20 @@ import io.openems.edge.common.channel.value.Value; import io.openems.edge.common.component.OpenemsComponent; import io.openems.edge.ess.api.SymmetricEss; -import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; -import io.openems.edge.goodwe.et.ess.enums.AppModeIndex; -import io.openems.edge.goodwe.et.ess.enums.BatteryMode; -import io.openems.edge.goodwe.et.ess.enums.GoodweType; -import io.openems.edge.goodwe.et.ess.enums.LoadMode; -import io.openems.edge.goodwe.et.ess.enums.MeterCommunicateStatus; -import io.openems.edge.goodwe.et.ess.enums.MeterConnectCheckFlag; -import io.openems.edge.goodwe.et.ess.enums.MeterConnectStatus; -import io.openems.edge.goodwe.et.ess.enums.OperationMode; -import io.openems.edge.goodwe.et.ess.enums.OutputTypeAC; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; -import io.openems.edge.goodwe.et.ess.enums.SafetyCountry; -import io.openems.edge.goodwe.et.ess.enums.WorkMode; +import io.openems.edge.goodwe.charger.AbstractGoodWeEtCharger; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine; +import io.openems.edge.goodwe.ess.enums.AppModeIndex; +import io.openems.edge.goodwe.ess.enums.BatteryMode; +import io.openems.edge.goodwe.ess.enums.GoodweType; +import io.openems.edge.goodwe.ess.enums.LoadMode; +import io.openems.edge.goodwe.ess.enums.MeterCommunicateStatus; +import io.openems.edge.goodwe.ess.enums.MeterConnectCheckFlag; +import io.openems.edge.goodwe.ess.enums.MeterConnectStatus; +import io.openems.edge.goodwe.ess.enums.OperationMode; +import io.openems.edge.goodwe.ess.enums.OutputTypeAC; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.enums.SafetyCountry; +import io.openems.edge.goodwe.ess.enums.WorkMode; public interface GoodWeEss extends SymmetricEss, OpenemsComponent { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java similarity index 98% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java index b74718e2824..3f462ec1e2c 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/GoodWeEssImpl.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.ess; import java.util.HashSet; import java.util.Set; @@ -51,11 +51,11 @@ import io.openems.edge.ess.power.api.Power; import io.openems.edge.ess.power.api.Pwr; import io.openems.edge.ess.power.api.Relationship; -import io.openems.edge.goodwe.et.charger.AbstractGoodWeEtCharger; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine; -import io.openems.edge.goodwe.et.ess.applypower.Context; -import io.openems.edge.goodwe.et.ess.enums.BatteryMode; -import io.openems.edge.goodwe.et.ess.enums.GoodweType; +import io.openems.edge.goodwe.charger.AbstractGoodWeEtCharger; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine; +import io.openems.edge.goodwe.ess.applypower.Context; +import io.openems.edge.goodwe.ess.enums.BatteryMode; +import io.openems.edge.goodwe.ess.enums.GoodweType; import io.openems.edge.timedata.api.Timedata; import io.openems.edge.timedata.api.TimedataProvider; import io.openems.edge.timedata.api.utils.CalculateEnergyFromPower; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ApplyPowerStateMachine.java similarity index 97% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ApplyPowerStateMachine.java index d6c2e0da269..544a0646e89 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ApplyPowerStateMachine.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ApplyPowerStateMachine.java @@ -1,9 +1,9 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.common.types.OptionsEnum; import io.openems.edge.common.statemachine.AbstractStateMachine; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.enums.GoodweType; +import io.openems.edge.goodwe.ess.enums.GoodweType; public class ApplyPowerStateMachine extends AbstractStateMachine { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtChargeHandler.java similarity index 62% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtChargeHandler.java index f9be97568a8..ce00c57bfd7 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtChargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class BtChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtDischargeHandler.java similarity index 62% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtDischargeHandler.java index 235815c5056..e3698e6e6a9 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/BtDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/BtDischargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class BtDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/Context.java similarity index 81% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/Context.java index 45e01518225..dea9add5d9e 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/Context.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/Context.java @@ -1,7 +1,7 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; -import io.openems.edge.goodwe.et.ess.GoodWeEssImpl; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.GoodWeEssImpl; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class Context { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyNegativeChargeHandler.java similarity index 65% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyNegativeChargeHandler.java index eb9ecb62180..f9715dab111 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyNegativeChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyNegativeChargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtEmptyNegativeChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyPositivePvHandler.java similarity index 64% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyPositivePvHandler.java index 1894f9d55ad..1637f64757f 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtEmptyPositivePvHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtEmptyPositivePvHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtEmptyPositivePvHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullNegativeCurtailHandler.java similarity index 61% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullNegativeCurtailHandler.java index 5f341736421..f7231e7cb24 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullNegativeCurtailHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullNegativeCurtailHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtFullNegativeCurtailHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveCurtailHandler.java similarity index 63% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveCurtailHandler.java index c36c812352f..045709a0bee 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveCurtailHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveCurtailHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtFullPositiveCurtailHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveDischargeHandler.java similarity index 65% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveDischargeHandler.java index 4acaaba7b7e..08c8eeb54d7 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtFullPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtFullPositiveDischargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtFullPositiveDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenNegativeChargeHandler.java similarity index 65% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenNegativeChargeHandler.java index 6a868c634f6..7902440f3a2 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenNegativeChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenNegativeChargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtInbetweenNegativeChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveChargeHandler.java similarity index 65% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveChargeHandler.java index 84b540d426e..6fb043faf95 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveChargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveChargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtInbetweenPositiveChargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveDischargeHandler.java similarity index 66% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveDischargeHandler.java index 0472850a8b5..144ec6e9a40 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/EtInbetweenPositiveDischargeHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/EtInbetweenPositiveDischargeHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class EtInbetweenPositiveDischargeHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ReadOnlyHandler.java similarity index 58% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ReadOnlyHandler.java index 5afa7b5297d..0a0917b5cc4 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/ReadOnlyHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/ReadOnlyHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class ReadOnlyHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/UndefinedHandler.java similarity index 58% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/UndefinedHandler.java index 129e1ca31c3..d6d91d0c2ea 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/applypower/UndefinedHandler.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/applypower/UndefinedHandler.java @@ -1,8 +1,8 @@ -package io.openems.edge.goodwe.et.ess.applypower; +package io.openems.edge.goodwe.ess.applypower; import io.openems.edge.common.statemachine.StateHandler; -import io.openems.edge.goodwe.et.ess.applypower.ApplyPowerStateMachine.State; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.ess.applypower.ApplyPowerStateMachine.State; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class UndefinedHandler extends StateHandler { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/AppModeIndex.java similarity index 93% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/AppModeIndex.java index bcac26770c6..eb04b2314c9 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/AppModeIndex.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/AppModeIndex.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/BatteryMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/BatteryMode.java index 1e48bf7108a..8bf0b628c03 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/BatteryMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/BatteryMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/GoodweType.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/GoodweType.java index c4326298599..c3368bfcf3f 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/GoodweType.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/GoodweType.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/LoadMode.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/LoadMode.java index 01a9cf87065..e60143a3181 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/LoadMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/LoadMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterCommunicateStatus.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterCommunicateStatus.java index 6f33d4d6092..79d97754608 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterCommunicateStatus.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterCommunicateStatus.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectCheckFlag.java similarity index 92% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectCheckFlag.java index 458704c356a..52f33f53663 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectCheckFlag.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectCheckFlag.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectStatus.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectStatus.java index 6c7b2c16d80..80480cae2bb 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/MeterConnectStatus.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/MeterConnectStatus.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OperationMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OperationMode.java index 2cf7705558b..e779fd073a7 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OperationMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OperationMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OutputTypeAC.java similarity index 93% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OutputTypeAC.java index 1a09fbef466..53e712651d9 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/OutputTypeAC.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/OutputTypeAC.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/PowerModeEms.java similarity index 96% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/PowerModeEms.java index 34c21fbd1d3..5e120c788a2 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/PowerModeEms.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/PowerModeEms.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/SafetyCountry.java similarity index 98% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/SafetyCountry.java index a6de86f8191..3c0216fad16 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/SafetyCountry.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/SafetyCountry.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/WorkMode.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/WorkMode.java index 590ba65cd09..e4636680054 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/ess/enums/WorkMode.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/enums/WorkMode.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess.enums; +package io.openems.edge.goodwe.ess.enums; import io.openems.common.types.OptionsEnum; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/Config.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/Config.java similarity index 96% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/Config.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/Config.java index 5d85153e1b0..104bc944786 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/Config.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/Config.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.gridmeter; +package io.openems.edge.goodwe.gridmeter; import org.osgi.service.metatype.annotations.AttributeDefinition; import org.osgi.service.metatype.annotations.ObjectClassDefinition; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GoodWeGridMeter.java similarity index 99% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GoodWeGridMeter.java index 9c2812b2bbb..a68d347929f 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GoodWeGridMeter.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GoodWeGridMeter.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.gridmeter; +package io.openems.edge.goodwe.gridmeter; import org.osgi.service.cm.ConfigurationAdmin; import org.osgi.service.component.ComponentContext; diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GridMeterChannelId.java similarity index 94% rename from io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java rename to io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GridMeterChannelId.java index aaba6597a49..3658978dd34 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/et/gridmeter/GridMeterChannelId.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/gridmeter/GridMeterChannelId.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.gridmeter; +package io.openems.edge.goodwe.gridmeter; import io.openems.common.channel.AccessMode; import io.openems.common.channel.Unit; diff --git a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/charger/MyConfig.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/charger/MyConfig.java similarity index 94% rename from io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/charger/MyConfig.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/charger/MyConfig.java index aa7cada7d92..bb32889fb6b 100644 --- a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/charger/MyConfig.java +++ b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/charger/MyConfig.java @@ -1,7 +1,8 @@ -package io.openems.edge.goodwe.et.charger; +package io.openems.edge.goodwe.charger; import io.openems.common.utils.ConfigUtils; import io.openems.edge.common.test.AbstractComponentConfig; +import io.openems.edge.goodwe.charger.ConfigPV1; @SuppressWarnings("all") public class MyConfig extends AbstractComponentConfig implements ConfigPV1 { diff --git a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/GoodWeEtBatteryInverterImplTest.java similarity index 94% rename from io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/GoodWeEtBatteryInverterImplTest.java index d812d2ecec7..142aa489c9e 100644 --- a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/GoodWeEtBatteryInverterImplTest.java +++ b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/GoodWeEtBatteryInverterImplTest.java @@ -1,4 +1,4 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.ess; import org.junit.Test; @@ -9,10 +9,10 @@ import io.openems.edge.common.test.DummyConfigurationAdmin; import io.openems.edge.ess.test.DummyPower; import io.openems.edge.ess.test.ManagedSymmetricEssTest; -import io.openems.edge.goodwe.et.GoodWeConstants; -import io.openems.edge.goodwe.et.charger.GoodWeChargerPv1; -import io.openems.edge.goodwe.et.ess.enums.GoodweType; -import io.openems.edge.goodwe.et.ess.enums.PowerModeEms; +import io.openems.edge.goodwe.GoodWeConstants; +import io.openems.edge.goodwe.charger.GoodWeChargerPv1; +import io.openems.edge.goodwe.ess.enums.GoodweType; +import io.openems.edge.goodwe.ess.enums.PowerModeEms; public class GoodWeEtBatteryInverterImplTest { @@ -35,7 +35,7 @@ public void testEt() throws Exception { new ComponentTest(charger) // .addReference("cm", new DummyConfigurationAdmin()) // .addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // - .activate(io.openems.edge.goodwe.et.charger.MyConfig.create() // + .activate(io.openems.edge.goodwe.charger.MyConfig.create() // .setId(CHARGER_ID) // .setEssId(ESS_ID) // .setModbusId(MODBUS_ID) // diff --git a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/MyConfig.java b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/MyConfig.java similarity index 96% rename from io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/MyConfig.java rename to io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/MyConfig.java index 7de5cc6d14e..e40242a5608 100644 --- a/io.openems.edge.goodwe/test/io/openems/edge/goodwe/et/ess/MyConfig.java +++ b/io.openems.edge.goodwe/test/io/openems/edge/goodwe/ess/MyConfig.java @@ -1,7 +1,8 @@ -package io.openems.edge.goodwe.et.ess; +package io.openems.edge.goodwe.ess; import io.openems.common.utils.ConfigUtils; import io.openems.edge.common.test.AbstractComponentConfig; +import io.openems.edge.goodwe.ess.Config; @SuppressWarnings("all") public class MyConfig extends AbstractComponentConfig implements Config { From 19195fe0202a869f469ac8c18c97dc48025c07e2 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Sun, 1 Nov 2020 19:31:44 +0100 Subject: [PATCH 19/23] Reset to develop --- .../src/io/openems/edge/common/test/AbstractComponentTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java b/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java index 42e6351b36f..59cf6ed3f6a 100644 --- a/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java +++ b/io.openems.edge.common/src/io/openems/edge/common/test/AbstractComponentTest.java @@ -182,9 +182,6 @@ protected void validateOutputs(Map components) throws Integer intGot = TypeUtils.getAsType(OpenemsType.INTEGER, got); got = enumDoc.getOption(intGot); } - if (got instanceof OptionsEnum) { - gotText = ((OptionsEnum) got).getName(); - } if (!Objects.equals(expected, got)) { throw new Exception("On TestCase [" + this.description + "]: " // + "expected [" + output.value + "] " // From c45c9ed71707b7f86f4fb4c4a04f24646e718483 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Sun, 1 Nov 2020 20:41:06 +0100 Subject: [PATCH 20/23] Update ESS names --- .../src/io/openems/edge/goodwe/charger/ConfigPV1.java | 4 ++-- .../src/io/openems/edge/goodwe/charger/ConfigPV2.java | 4 ++-- .../src/io/openems/edge/goodwe/ess/Config.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java index 0719d758e4d..901c92bdcc0 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV1.java @@ -19,10 +19,10 @@ @AttributeDefinition(name = "Is enabled?", description = "Is this Component enabled?") boolean enabled() default true; - @AttributeDefinition(name = "GoodWe ET Battery-Inverter", description = "ID of GoodWe ET Battery-Inverter device.") + @AttributeDefinition(name = "GoodWe ET ESS", description = "ID of GoodWe ET Energy Storage System.") String ess_id() default "ess0"; - @AttributeDefinition(name = "GoodWe ET Battery-Inverter target filter", description = "This is auto-generated by 'GoodWe ET Battery-Inverter-ID'.") + @AttributeDefinition(name = "GoodWe ET ESS target filter", description = "This is auto-generated by 'GoodWe ET ESS'.") String Ess_target() default ""; @AttributeDefinition(name = "Modbus Unit-id", description = "Unit-id") diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java index 6399d7606f6..04d9e26bef8 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/ConfigPV2.java @@ -19,10 +19,10 @@ @AttributeDefinition(name = "Is enabled?", description = "Is this Component enabled?") boolean enabled() default true; - @AttributeDefinition(name = "GoodWe ET Battery-Inverter", description = "ID of GoodWe ET Battery-Inverter device.") + @AttributeDefinition(name = "GoodWe ET ESS", description = "ID of GoodWe ET Energy Storage System.") String ess_id() default "ess0"; - @AttributeDefinition(name = "GoodWe ET Battery-Inverter target filter", description = "This is auto-generated by 'GoodWe ET Battery-Inverter-ID'.") + @AttributeDefinition(name = "GoodWe ET ESS target filter", description = "This is auto-generated by 'GoodWe ET ESS'.") String Ess_target() default ""; @AttributeDefinition(name = "Modbus Unit-id", description = "Unit-id") diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java index 4193cbdfaf1..4ca80396c26 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/Config.java @@ -6,8 +6,8 @@ import io.openems.edge.goodwe.GoodWeConstants; @ObjectClassDefinition(// - name = "GoodWe ET Battery-Inverter", // - description = "Implements the GoodWe ET-Series battery inverter.") + name = "GoodWe ET ESS", // + description = "Implements the GoodWe ET Energy Storage System.") @interface Config { @AttributeDefinition(name = "Component-ID", description = "Unique ID of this Component") @@ -37,5 +37,5 @@ @AttributeDefinition(name = "Modbus target filter", description = "This is auto-generated by 'Modbus-ID'.") String Modbus_target() default ""; - String webconsole_configurationFactory_nameHint() default "GoodWe ET Battery-Inverter [{id}]"; + String webconsole_configurationFactory_nameHint() default "GoodWe ET ESS [{id}]"; } From 807cac958c02205ef8c41dfd404814e9c50c7d7a Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 10 Nov 2020 16:24:27 +0100 Subject: [PATCH 21/23] Fix Eclipse working set --- cnf/build.bnd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cnf/build.bnd b/cnf/build.bnd index 56e785b3827..cd02958c8e5 100644 --- a/cnf/build.bnd +++ b/cnf/build.bnd @@ -85,7 +85,7 @@ testpath: \ Edge_Controller_PVinverter;member=${filter;${p};io\.openems\.edge\.controller\.pvinverter\..*},\ Edge_Ess;member=${filter;${p};io\.openems\.edge\.ess\..*},\ Edge_Evcs;member=${filter;${p};io\.openems\.edge\.evcs\..*|io\.openems\.wrapper\.eu\.chargetime\.ocpp},\ - Edge_Multiple;member=${filter;${p};io\.openems\.edge\.fenecon\..*|io\.openems\.edge\.goodwe\..et|io\.openems\.edge\.kostal\.piko|io\.openems\.edge\.tesla\.*|io\.openems\.edge\.solaredge},\ + Edge_Multiple;member=${filter;${p};io\.openems\.edge\.fenecon\..*|io\.openems\.edge\.goodwe|io\.openems\.edge\.kostal\.piko|io\.openems\.edge\.tesla\.*|io\.openems\.edge\.solaredge},\ Edge_IO;member=${filter;${p};io\.openems\.edge\.io\..*|io\.openems\.edge\.controller\.channelthreshold|io\.openems\.edge\.controller\.chp\..*|io\.openems\.edge\.controller\.highloadtimeslot},\ Edge_Meter;member=${filter;${p};io\.openems\.edge\.meter\..*},\ Edge_Predictor;member=${filter;${p};io\.openems\.edge\.predictor\..*},\ From 70bd2171cc84bc254d8cffc20fa230c307aea579 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 10 Nov 2020 16:27:33 +0100 Subject: [PATCH 22/23] Update readme --- io.openems.edge.goodwe/readme.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/io.openems.edge.goodwe/readme.adoc b/io.openems.edge.goodwe/readme.adoc index 9ecf14a9f96..2019464189d 100644 --- a/io.openems.edge.goodwe/readme.adoc +++ b/io.openems.edge.goodwe/readme.adoc @@ -1,10 +1,10 @@ -= GoodWe ET-Series += GoodWe ET and BT-Series Hybrid Inverters -Battery-Inverter: +Ess: - SymmetricEss -Charger: +Charger: (ET only) - EssDcCharger @@ -13,4 +13,4 @@ Grid-Meter: - SymmetricMeter - AsymmetricMeter -https://github.com/OpenEMS/openems/tree/develop/io.openems.edge.goodwe.et[Source Code icon:github[]] \ No newline at end of file +https://github.com/OpenEMS/openems/tree/develop/io.openems.edge.goodwe[Source Code icon:github[]] \ No newline at end of file From c1a93857a5937214c9ddc883d12382053c3ec1b8 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Tue, 10 Nov 2020 20:10:42 +0100 Subject: [PATCH 23/23] Fix calculate Energy + improve modbus register priorities --- .../goodwe/charger/AbstractGoodWeEtCharger.java | 16 +++++----------- .../edge/goodwe/charger/GoodWeChargerPv1.java | 3 +-- .../edge/goodwe/charger/GoodWeChargerPv2.java | 3 +-- .../openems/edge/goodwe/ess/GoodWeEssImpl.java | 15 ++++++--------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java index eae8f4bea9a..ba74ffbc1f2 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/AbstractGoodWeEtCharger.java @@ -35,7 +35,7 @@ protected AbstractGoodWeEtCharger() { protected ModbusProtocol defineModbusProtocol() throws OpenemsException { int startAddress = this.getStartAddress(); return new ModbusProtocol(this, // - new FC3ReadRegistersTask(startAddress, Priority.HIGH, // + new FC3ReadRegistersTask(startAddress, Priority.LOW, // m(PvChannelId.V, new UnsignedWordElement(startAddress), // ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // m(PvChannelId.I, new UnsignedWordElement(startAddress + 1), @@ -57,20 +57,14 @@ public void handleEvent(Event event) { * Calculate the Energy values from ActivePower. */ private void calculateEnergy() { - // Calculate Energy - Integer activePower = this.getActualPower().get(); - if (activePower == null) { + Integer actualPower = this.getActualPower().get(); + if (actualPower == null) { // Not available this.calculateActualEnergy.update(null); - this.calculateActualEnergy.update(null); - } else if (activePower > 0) { - // Buy-From-Grid - this.calculateActualEnergy.update(activePower); - this.calculateActualEnergy.update(0); + } else if (actualPower > 0) { + this.calculateActualEnergy.update(actualPower); } else { - // Sell-To-Grid this.calculateActualEnergy.update(0); - this.calculateActualEnergy.update(activePower * -1); } } diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java index 9c8680345e5..ea12527cf61 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv1.java @@ -29,8 +29,7 @@ immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE, // property = { // - EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_AFTER_PROCESS_IMAGE, // - "type=GRID" // + EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_AFTER_PROCESS_IMAGE // }) public class GoodWeChargerPv1 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent, EventHandler, TimedataProvider { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java index c4c52b5772c..7f78a42e8ee 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/charger/GoodWeChargerPv2.java @@ -29,8 +29,7 @@ immediate = true, // configurationPolicy = ConfigurationPolicy.REQUIRE, // property = { // - EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_AFTER_PROCESS_IMAGE, // - "type=GRID" // + EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_AFTER_PROCESS_IMAGE // }) public class GoodWeChargerPv2 extends AbstractGoodWeEtCharger implements EssDcCharger, OpenemsComponent, EventHandler, TimedataProvider { diff --git a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java index d550921b8dc..f037d4b3bfb 100644 --- a/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java +++ b/io.openems.edge.goodwe/src/io/openems/edge/goodwe/ess/GoodWeEssImpl.java @@ -163,7 +163,7 @@ protected ModbusProtocol defineModbusProtocol() throws OpenemsException { new DummyRegisterElement(35117, 35118), // m(GoodWeEss.ChannelId.PV_MODE, new UnsignedDoublewordElement(35119))), // - new FC3ReadRegistersTask(35136, Priority.HIGH, // + new FC3ReadRegistersTask(35136, Priority.LOW, // m(SymmetricEss.ChannelId.GRID_MODE, new UnsignedWordElement(35136), // new ElementToChannelConverter((value) -> { Integer intValue = TypeUtils.getAsType(OpenemsType.INTEGER, value); @@ -236,7 +236,7 @@ protected ModbusProtocol defineModbusProtocol() throws OpenemsException { m(GoodWeEss.ChannelId.I_BATTERY1, new SignedWordElement(35181), ElementToChannelConverter.SCALE_FACTOR_MINUS_1), // new DummyRegisterElement(35182), // - m(GoodWeEss.ChannelId.P_BATTERY1, new SignedWordElement(35183)), // + m(GoodWeEss.ChannelId.P_BATTERY1, new SignedWordElement(35183)), // required for ActivePower m(GoodWeEss.ChannelId.BATTERY_MODE, new UnsignedWordElement(35184))), // new FC3ReadRegistersTask(35185, Priority.LOW, // @@ -264,7 +264,7 @@ protected ModbusProtocol defineModbusProtocol() throws OpenemsException { m(GoodWeEss.ChannelId.BMS_CHARGE_IMAX, new UnsignedWordElement(37004)), // m(GoodWeEss.ChannelId.BMS_DISCHARGE_IMAX, new UnsignedWordElement(37005))), // - new FC3ReadRegistersTask(37007, Priority.HIGH, // + new FC3ReadRegistersTask(37007, Priority.LOW, // m(SymmetricEss.ChannelId.SOC, new UnsignedWordElement(37007), new ElementToChannelConverter( // element -> channel value -> { @@ -279,6 +279,7 @@ protected ModbusProtocol defineModbusProtocol() throws OpenemsException { }, // channel -> element value -> value))), // + new FC3ReadRegistersTask(37008, Priority.LOW, // m(GoodWeEss.ChannelId.BMS_SOH, new UnsignedWordElement(37008)), // m(GoodWeEss.ChannelId.BMS_BATTERY_STRINGS, new UnsignedWordElement(37009))), // @@ -312,7 +313,7 @@ protected ModbusProtocol defineModbusProtocol() throws OpenemsException { m(GoodWeEss.ChannelId.FEED_POWER_ENABLE, new UnsignedWordElement(47509)), // m(GoodWeEss.ChannelId.FEED_POWER_PARA, new UnsignedWordElement(47510))), // - new FC3ReadRegistersTask(47511, Priority.HIGH, + new FC3ReadRegistersTask(47511, Priority.LOW, m(GoodWeEss.ChannelId.EMS_POWER_MODE, new UnsignedWordElement(47511)), // m(GoodWeEss.ChannelId.EMS_POWER_SET, new UnsignedWordElement(47512))), // @@ -478,12 +479,11 @@ private void updatechannels() { * Update ActivePower from P_BATTERY1 and chargers ACTUAL_POWER */ final Channel batteryPower = this.channel(GoodWeEss.ChannelId.P_BATTERY1); - Integer activePower = batteryPower.getNextValue().get(); Integer productionPower = null; for (AbstractGoodWeEtCharger charger : this.chargers) { productionPower = TypeUtils.sum(productionPower, charger.getActualPower().get()); - activePower = TypeUtils.sum(activePower, charger.getActualPowerChannel().getNextValue().get()); } + Integer activePower = TypeUtils.sum(productionPower, batteryPower.value().get()); this._setActivePower(activePower); /* @@ -507,9 +507,6 @@ private void updatechannels() { * Update Allowed charge and Allowed discharge */ -// System.out.println( -// "Allowed Charge power: " + allowedChargePower + " Allowed Discharge Power: " + allowedDischargePower); - Integer soc = this.getSoc().get(); Integer maxBatteryPower = this.config.maxBatteryPower();