From 3d74e0ce0693df74814562d7ae428aac11e1dbd7 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Sun, 15 Dec 2024 20:52:38 +0100 Subject: [PATCH 1/3] Sum: add power and energy distribution --- .../io/openems/edge/common/sum/DummySum.java | 55 ++++++ .../src/io/openems/edge/common/sum/Sum.java | 162 ++++++++++++++++++ .../edge/core/sum/PowerDistribution.java | 101 +++++++++++ .../src/io/openems/edge/core/sum/SumImpl.java | 23 ++- .../edge/core/sum/PowerDistributionTest.java | 47 +++++ .../io/openems/edge/core/sum/SumImplTest.java | 16 +- 6 files changed, 402 insertions(+), 2 deletions(-) create mode 100644 io.openems.edge.core/src/io/openems/edge/core/sum/PowerDistribution.java create mode 100644 io.openems.edge.core/test/io/openems/edge/core/sum/PowerDistributionTest.java diff --git a/io.openems.edge.common/src/io/openems/edge/common/sum/DummySum.java b/io.openems.edge.common/src/io/openems/edge/common/sum/DummySum.java index 2a2b9bd7568..64d093c8511 100644 --- a/io.openems.edge.common/src/io/openems/edge/common/sum/DummySum.java +++ b/io.openems.edge.common/src/io/openems/edge/common/sum/DummySum.java @@ -93,4 +93,59 @@ public DummySum withEssMaxDischargePower(int value) { return this.self(); } + /** + * Set {@link Sum.ChannelId#GRID_BUY_ACTIVE_ENERGY}. + * + * @param value the value + * @return myself + */ + public DummySum withGridBuyActiveEnergy(long value) { + withValue(this, Sum.ChannelId.GRID_BUY_ACTIVE_ENERGY, value); + return this.self(); + } + + /** + * Set {@link Sum.ChannelId#GRID_SELL_ACTIVE_ENERGY}. + * + * @param value the value + * @return myself + */ + public DummySum withGridSellActiveEnergy(long value) { + withValue(this, Sum.ChannelId.GRID_SELL_ACTIVE_ENERGY, value); + return this.self(); + } + + /** + * Set {@link Sum.ChannelId#ESS_ACTIVE_CHARGE_ENERGY}. + * + * @param value the value + * @return myself + */ + public DummySum withEssActiveChargeEnergy(long value) { + withValue(this, Sum.ChannelId.ESS_ACTIVE_CHARGE_ENERGY, value); + return this.self(); + } + + /** + * Set {@link Sum.ChannelId#ESS_ACTIVE_DISCHARGE_ENERGY}. + * + * @param value the value + * @return myself + */ + public DummySum withEssActiveDischargeEnergy(long value) { + withValue(this, Sum.ChannelId.ESS_ACTIVE_DISCHARGE_ENERGY, value); + return this.self(); + } + + /** + * Set {@link Sum.ChannelId#CONSUMPTION_ACTIVE_ENERGY}. + * + * @param value the value + * @return myself + */ + public DummySum withConsumptionActiveEnergy(long value) { + withValue(this, Sum.ChannelId.CONSUMPTION_ACTIVE_ENERGY, value); + return this.self(); + } + } diff --git a/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java b/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java index b065cb50c18..16f568b501b 100644 --- a/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java +++ b/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java @@ -629,6 +629,168 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { CONSUMPTION_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // .unit(Unit.CUMULATED_WATT_HOURS) // .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to Consumption: Power. + * + * + */ + PRODUCTION_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to Consumption: Energy. + * + * + */ + PRODUCTION_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to Grid: Power. + * + * + */ + PRODUCTION_TO_GRID_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to Grid: Energy. + * + * + */ + PRODUCTION_TO_GRID_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to ESS: Power. + * + * + */ + PRODUCTION_TO_ESS_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Production to ESS: Energy. + * + * + */ + PRODUCTION_TO_ESS_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Grid to Consumption: Power. + * + * + */ + GRID_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Grid to Consumption: Energy. + * + * + */ + GRID_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * ESS to Consumption: Power. + * + * + */ + ESS_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * ESS to Consumption: Energy. + * + * + */ + ESS_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Grid to ESS: Power. + * + * + */ + GRID_TO_ESS_POWER(Doc.of(OpenemsType.INTEGER) // + .unit(Unit.WATT) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * Grid to ESS: Energy. + * + * + */ + GRID_TO_ESS_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // + /** + * ESS to Grid: Energy. + * + * + */ + ESS_TO_GRID_ENERGY(Doc.of(OpenemsType.LONG) // + .unit(Unit.CUMULATED_WATT_HOURS) // + .persistencePriority(PersistencePriority.VERY_HIGH)), // /** * Is there any Component Info/Warning/Fault that is getting ignored/hidden diff --git a/io.openems.edge.core/src/io/openems/edge/core/sum/PowerDistribution.java b/io.openems.edge.core/src/io/openems/edge/core/sum/PowerDistribution.java new file mode 100644 index 00000000000..54eb8407b1a --- /dev/null +++ b/io.openems.edge.core/src/io/openems/edge/core/sum/PowerDistribution.java @@ -0,0 +1,101 @@ +package io.openems.edge.core.sum; + +import static java.lang.Math.max; +import static java.lang.Math.min; + +import io.openems.edge.common.sum.Sum; + +/** + * Calculates power distribution. + */ +public record PowerDistribution(// + Integer productionToConsumption, /* positive */ + Integer productionToGrid, /* positive */ + Integer productionToEss, /* positive */ + Integer gridToConsumption, /* positive */ + Integer essToConsumption, /* positive */ + Integer gridToEss /* discharge-to-grid negative, charge-from-grid positive */ +) { + + public static final PowerDistribution EMPTY = new PowerDistribution(null, null, null, null, null, null); + + /** + * Creates a {@link PowerDistribution}. + * + * @param grid the gridActivePower; possibly null + * @param production the productionActivePower; possibly null + * @param ess the essActivePower; possibly null + * @return a {@link PowerDistribution}; possibly {@link PowerDistribution#EMPTY} + */ + public static PowerDistribution of(Integer grid, Integer production, Integer ess) { + final PowerDistribution result; + if (grid != null && production != null && ess != null) { + result = of(grid.intValue(), production.intValue(), ess.intValue()); + + } else if (grid != null) { + if (production == null && ess == null) { + result = of(grid.intValue()); + } else { + result = of(grid.intValue(), production != null ? production : 0, ess != null ? ess : 0); + } + + } else { + result = EMPTY; + } + return result; + } + + private static PowerDistribution of(int grid, int production, int ess) { + if (production < 0) { // invalid data + return EMPTY; + } + var consumption = ess + grid + production; + var essToConsumption = ess > 0 // + ? /* discharge */ min(ess, consumption) // + : /* charge */ 0; + var productionToEss = ess > 0 // + ? /* discharge */ 0 // + : /* charge */ min(-ess, production); + var productionToConsumption = min(production - productionToEss, consumption - essToConsumption); + var productionToGrid = max(0, production - productionToConsumption - productionToEss); + var gridToConsumption = max(0, consumption - essToConsumption - productionToConsumption); + var gridToEss = grid - gridToConsumption + productionToGrid; + return new PowerDistribution(productionToConsumption, productionToGrid, productionToEss, gridToConsumption, + essToConsumption, gridToEss); + } + + private static PowerDistribution of(int grid) { + if (grid < 0) { // invalid data + return EMPTY; + } + // Grid Buy to Consumption + return new PowerDistribution(null, null, null, grid, null, null); + } + + protected void updateChannels(SumImpl sum) { + // Power + sum.channel(Sum.ChannelId.PRODUCTION_TO_CONSUMPTION_POWER).setNextValue(this.productionToConsumption); + sum.channel(Sum.ChannelId.PRODUCTION_TO_GRID_POWER).setNextValue(this.productionToGrid); + sum.channel(Sum.ChannelId.PRODUCTION_TO_ESS_POWER).setNextValue(this.productionToEss); + sum.channel(Sum.ChannelId.GRID_TO_CONSUMPTION_POWER).setNextValue(this.gridToConsumption); + sum.channel(Sum.ChannelId.ESS_TO_CONSUMPTION_POWER).setNextValue(this.essToConsumption); + sum.channel(Sum.ChannelId.GRID_TO_ESS_POWER).setNextValue(this.gridToEss); + + // Energy + sum.calculateProductionToConsumptionEnergy.update(this.productionToConsumption); + sum.calculateProductionToGridEnergy.update(this.productionToGrid); + sum.calculateProductionToEssEnergy.update(this.productionToEss); + sum.calculateGridToConsumptionEnergy.update(this.gridToConsumption); + sum.calculateEssToConsumptionEnergy.update(this.essToConsumption); + if (this.gridToEss == null) { + sum.calculateGridToEssEnergy.update(null); + sum.calculateEssToGridEnergy.update(null); + } else if (this.gridToEss > 0) { + sum.calculateGridToEssEnergy.update(this.gridToEss); + sum.calculateEssToGridEnergy.update(0); + } else { + sum.calculateGridToEssEnergy.update(0); + sum.calculateEssToGridEnergy.update(-this.gridToEss); + } + } +} diff --git a/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java b/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java index 4910b1f965e..385a1d3a1d0 100644 --- a/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java +++ b/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java @@ -45,6 +45,7 @@ import io.openems.edge.timedata.api.Timedata; import io.openems.edge.timedata.api.TimedataProvider; import io.openems.edge.timedata.api.utils.CalculateActiveTime; +import io.openems.edge.timedata.api.utils.CalculateEnergyFromPower; import io.openems.edge.timeofusetariff.api.TimeOfUseTariff; @Designate(ocd = Config.class, factory = false) @@ -65,6 +66,21 @@ public class SumImpl extends AbstractOpenemsComponent implements Sum, OpenemsCom @Reference private ComponentManager componentManager; + protected final CalculateEnergyFromPower calculateProductionToConsumptionEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.PRODUCTION_TO_CONSUMPTION_ENERGY); + protected final CalculateEnergyFromPower calculateProductionToGridEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.PRODUCTION_TO_GRID_ENERGY); + protected final CalculateEnergyFromPower calculateProductionToEssEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.PRODUCTION_TO_ESS_ENERGY); + protected final CalculateEnergyFromPower calculateGridToConsumptionEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.GRID_TO_CONSUMPTION_ENERGY); + protected final CalculateEnergyFromPower calculateEssToConsumptionEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.ESS_TO_CONSUMPTION_ENERGY); + protected final CalculateEnergyFromPower calculateGridToEssEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.GRID_TO_ESS_ENERGY); + protected final CalculateEnergyFromPower calculateEssToGridEnergy = new CalculateEnergyFromPower(this, + Sum.ChannelId.ESS_TO_GRID_ENERGY); + private final EnergyValuesHandler energyValuesHandler; private final Set ignoreStateComponents = new HashSet<>(); @@ -386,7 +402,8 @@ private void calculateChannelValues() { this._setProductionAcActivePowerL3(productionAcActivePowerL3Sum); var productionDcActualPowerSum = productionDcActualPower.calculate(); this._setProductionDcActualPower(productionDcActualPowerSum); - this._setProductionActivePower(TypeUtils.sum(productionAcActivePowerSum, productionDcActualPowerSum)); + var productionActivePower = TypeUtils.sum(productionAcActivePowerSum, productionDcActualPowerSum); + this._setProductionActivePower(productionActivePower); var productionAcActiveEnergySum = productionAcActiveEnergy.calculate(); productionAcActiveEnergySum = this.energyValuesHandler.setValue(Sum.ChannelId.PRODUCTION_AC_ACTIVE_ENERGY, @@ -423,6 +440,10 @@ private void calculateChannelValues() { this.getEssDischargePowerChannel().setNextValue(essDischargePowerSum); this.updateExtremeEverValues(); + + // Power & Energy distribution + PowerDistribution.of(gridActivePowerSum, productionActivePower, essActivePowerSum) // + .updateChannels(this); } /** diff --git a/io.openems.edge.core/test/io/openems/edge/core/sum/PowerDistributionTest.java b/io.openems.edge.core/test/io/openems/edge/core/sum/PowerDistributionTest.java new file mode 100644 index 00000000000..65c8bc9a26b --- /dev/null +++ b/io.openems.edge.core/test/io/openems/edge/core/sum/PowerDistributionTest.java @@ -0,0 +1,47 @@ +package io.openems.edge.core.sum; + +import static io.openems.edge.core.sum.PowerDistribution.EMPTY; +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class PowerDistributionTest { + + @Test + public void test() { + assertEquals(EMPTY, PowerDistribution.of(null, null, null)); + assertEquals(EMPTY, PowerDistribution.of(-1, null, null)); + assertEquals(EMPTY, PowerDistribution.of(0, -1, 0)); + { + var sut = PowerDistribution.of(1000, null, null); + assertEquals(1000, sut.gridToConsumption().intValue()); + } + { + var sut = PowerDistribution.of(-1000, 2000, 500); + assertEquals(1000, sut.productionToConsumption().intValue()); + assertEquals(1000, sut.productionToGrid().intValue()); + assertEquals(0, sut.productionToEss().intValue()); + assertEquals(0, sut.gridToConsumption().intValue()); + assertEquals(500, sut.essToConsumption().intValue()); + assertEquals(0, sut.gridToEss().intValue()); + } + { + var sut = PowerDistribution.of(1000, 2000, 500); + assertEquals(2000, sut.productionToConsumption().intValue()); + assertEquals(0, sut.productionToGrid().intValue()); + assertEquals(0, sut.productionToEss().intValue()); + assertEquals(1000, sut.gridToConsumption().intValue()); + assertEquals(500, sut.essToConsumption().intValue()); + assertEquals(0, sut.gridToEss().intValue()); + } + { + var sut = PowerDistribution.of(1000, 2000, -500); + assertEquals(1500, sut.productionToConsumption().intValue()); + assertEquals(0, sut.productionToGrid().intValue()); + assertEquals(500, sut.productionToEss().intValue()); + assertEquals(1000, sut.gridToConsumption().intValue()); + assertEquals(0, sut.essToConsumption().intValue()); + assertEquals(0, sut.gridToEss().intValue()); + } + } +} diff --git a/io.openems.edge.core/test/io/openems/edge/core/sum/SumImplTest.java b/io.openems.edge.core/test/io/openems/edge/core/sum/SumImplTest.java index 2ef7670b28d..3174341534c 100644 --- a/io.openems.edge.core/test/io/openems/edge/core/sum/SumImplTest.java +++ b/io.openems.edge.core/test/io/openems/edge/core/sum/SumImplTest.java @@ -5,11 +5,17 @@ import static io.openems.edge.common.sum.Sum.ChannelId.CONSUMPTION_MAX_ACTIVE_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.ESS_ACTIVE_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.ESS_DISCHARGE_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.ESS_TO_CONSUMPTION_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.GRID_ACTIVE_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.GRID_MAX_ACTIVE_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.GRID_MIN_ACTIVE_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.GRID_TO_CONSUMPTION_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.GRID_TO_ESS_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.PRODUCTION_ACTIVE_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.PRODUCTION_MAX_ACTIVE_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.PRODUCTION_TO_CONSUMPTION_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.PRODUCTION_TO_ESS_POWER; +import static io.openems.edge.common.sum.Sum.ChannelId.PRODUCTION_TO_GRID_POWER; import static io.openems.edge.common.sum.Sum.ChannelId.UNMANAGED_CONSUMPTION_ACTIVE_POWER; import org.junit.Test; @@ -93,6 +99,14 @@ public void test() throws OpenemsException, Exception { .output(GRID_MIN_ACTIVE_POWER, -2000) // .output(GRID_MAX_ACTIVE_POWER, 3000) // .output(PRODUCTION_MAX_ACTIVE_POWER, 6666) // - .output(CONSUMPTION_MAX_ACTIVE_POWER, 9666)); + .output(CONSUMPTION_MAX_ACTIVE_POWER, 9666) // + + .output(PRODUCTION_TO_CONSUMPTION_POWER, 6666) // + .output(PRODUCTION_TO_GRID_POWER, 0) // + .output(PRODUCTION_TO_ESS_POWER, 0) // + .output(GRID_TO_CONSUMPTION_POWER, 3000) // + .output(ESS_TO_CONSUMPTION_POWER, 0) // + .output(GRID_TO_ESS_POWER, 0) // + ); } } From 5b658f0996edf282ed37ea176552df9e908a1efc Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Sun, 15 Dec 2024 20:59:08 +0100 Subject: [PATCH 2/3] Fix build --- .../core/predictormanager/PredictorManagerImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/io.openems.edge.core/src/io/openems/edge/core/predictormanager/PredictorManagerImpl.java b/io.openems.edge.core/src/io/openems/edge/core/predictormanager/PredictorManagerImpl.java index a674023dd02..f63319c01f7 100644 --- a/io.openems.edge.core/src/io/openems/edge/core/predictormanager/PredictorManagerImpl.java +++ b/io.openems.edge.core/src/io/openems/edge/core/predictormanager/PredictorManagerImpl.java @@ -119,8 +119,8 @@ public Prediction getPrediction(ChannelAddress channelAddress) { private Prediction getPredictionSum(Sum.ChannelId channelId) { return switch (channelId) { case CONSUMPTION_ACTIVE_ENERGY, // - CONSUMPTION_ACTIVE_POWER_L1, CONSUMPTION_ACTIVE_POWER_L2, CONSUMPTION_ACTIVE_POWER_L3, - CONSUMPTION_MAX_ACTIVE_POWER, // + CONSUMPTION_ACTIVE_POWER, CONSUMPTION_ACTIVE_POWER_L1, CONSUMPTION_ACTIVE_POWER_L2, + CONSUMPTION_ACTIVE_POWER_L3, CONSUMPTION_MAX_ACTIVE_POWER, // ESS_ACTIVE_CHARGE_ENERGY, ESS_ACTIVE_DISCHARGE_ENERGY, ESS_ACTIVE_POWER, ESS_ACTIVE_POWER_L1, ESS_ACTIVE_POWER_L2, ESS_ACTIVE_POWER_L3, ESS_CAPACITY, ESS_DC_CHARGE_ENERGY, ESS_DC_DISCHARGE_ENERGY, @@ -135,6 +135,11 @@ private Prediction getPredictionSum(Sum.ChannelId channelId) { PRODUCTION_AC_ACTIVE_POWER_L2, PRODUCTION_AC_ACTIVE_POWER_L3, PRODUCTION_DC_ACTIVE_ENERGY, PRODUCTION_MAX_ACTIVE_POWER, // + ESS_TO_CONSUMPTION_POWER, ESS_TO_CONSUMPTION_ENERGY, GRID_TO_CONSUMPTION_POWER, + GRID_TO_CONSUMPTION_ENERGY, GRID_TO_ESS_POWER, GRID_TO_ESS_ENERGY, ESS_TO_GRID_ENERGY, + PRODUCTION_TO_CONSUMPTION_POWER, PRODUCTION_TO_CONSUMPTION_ENERGY, PRODUCTION_TO_ESS_POWER, + PRODUCTION_TO_ESS_ENERGY, PRODUCTION_TO_GRID_POWER, PRODUCTION_TO_GRID_ENERGY, + HAS_IGNORED_COMPONENT_STATES -> EMPTY_PREDICTION; @@ -143,9 +148,6 @@ private Prediction getPredictionSum(Sum.ChannelId channelId) { // ConsumptionActivePower by default this.getPrediction(new ChannelAddress("_sum", "ConsumptionActivePower")); - // TODO - case CONSUMPTION_ACTIVE_POWER -> EMPTY_PREDICTION; - case PRODUCTION_DC_ACTUAL_POWER -> { // Sum up "ActualPower" prediction of all EssDcChargers List chargers = this.componentManager.getEnabledComponentsOfType(EssDcCharger.class); From 70059fd39975ab36a040ee9e1147422a2566b98b Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Thu, 6 Mar 2025 16:40:35 +0100 Subject: [PATCH 3/3] static imports --- .../src/io/openems/edge/common/sum/Sum.java | 352 +++++++++--------- 1 file changed, 181 insertions(+), 171 deletions(-) diff --git a/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java b/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java index 84fb815fb53..f7d2fb5d0a3 100644 --- a/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java +++ b/io.openems.edge.common/src/io/openems/edge/common/sum/Sum.java @@ -1,10 +1,20 @@ package io.openems.edge.common.sum; +import static io.openems.common.channel.Level.INFO; +import static io.openems.common.channel.PersistencePriority.VERY_HIGH; +import static io.openems.common.channel.Unit.CUMULATED_SECONDS; +import static io.openems.common.channel.Unit.CUMULATED_WATT_HOURS; +import static io.openems.common.channel.Unit.MONEY_PER_MEGAWATT_HOUR; +import static io.openems.common.channel.Unit.PERCENT; +import static io.openems.common.channel.Unit.VOLT_AMPERE; +import static io.openems.common.channel.Unit.VOLT_AMPERE_REACTIVE; +import static io.openems.common.channel.Unit.WATT; +import static io.openems.common.channel.Unit.WATT_HOURS; +import static io.openems.common.types.OpenemsType.DOUBLE; +import static io.openems.common.types.OpenemsType.INTEGER; +import static io.openems.common.types.OpenemsType.LONG; + import io.openems.common.channel.AccessMode; -import io.openems.common.channel.Level; -import io.openems.common.channel.PersistencePriority; -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.DoubleReadChannel; @@ -36,9 +46,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: 0..100 * */ - ESS_SOC(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.PERCENT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_SOC(Doc.of(INTEGER) // + .unit(PERCENT) // + .persistencePriority(VERY_HIGH) // .text("Range 0..100")), // /** * Ess: Active Power. @@ -50,9 +60,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values for Charge; positive for Discharge * */ - ESS_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text(""" AC-side power of Energy Storage System. \ Includes excess DC-PV production for hybrid inverters. \ @@ -66,9 +76,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: var * */ - ESS_REACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT_AMPERE_REACTIVE) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_REACTIVE_POWER(Doc.of(INTEGER) // + .unit(VOLT_AMPERE_REACTIVE) // + .persistencePriority(VERY_HIGH)), // /** * Ess: Active Power L1. * @@ -79,9 +89,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values for Charge; positive for Discharge * */ - ESS_ACTIVE_POWER_L1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_POWER_L1(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text(""" AC-side power of Energy Storage System on phase L1. \ Includes excess DC-PV production for hybrid inverters. \ @@ -96,9 +106,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values for Charge; positive for Discharge * */ - ESS_ACTIVE_POWER_L2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_POWER_L2(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text(""" AC-side power of Energy Storage System on phase L2. \ Includes excess DC-PV production for hybrid inverters. \ @@ -113,9 +123,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values for Charge; positive for Discharge * */ - ESS_ACTIVE_POWER_L3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_POWER_L3(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text(""" AC-side power of Energy Storage System on phase L3. \ Includes excess DC-PV production for hybrid inverters. \ @@ -135,9 +145,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * charged to or discharged from the battery. * */ - ESS_DISCHARGE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_DISCHARGE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Actual AC-side battery discharge power of Energy Storage System. " // + "Negative values for charge; positive for discharge")), /** @@ -151,9 +161,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values or '0' * */ - ESS_MIN_DISCHARGE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), + ESS_MIN_DISCHARGE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), /** * Ess: Maximum Ever Discharge Power. * @@ -164,9 +174,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: positive values or '0' * */ - ESS_MAX_DISCHARGE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), + ESS_MAX_DISCHARGE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), /** * Ess: Capacity. * @@ -177,9 +187,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - ESS_CAPACITY(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_CAPACITY(Doc.of(INTEGER) // + .unit(WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Grid: Active Power. @@ -193,9 +203,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * the system') * */ - GRID_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Grid exchange power. " // + "Negative values for sell-to-grid; positive for buy-from-grid")), /** @@ -210,9 +220,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * the system') * */ - GRID_ACTIVE_POWER_L1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_ACTIVE_POWER_L1(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Grid exchange power on phase L1. " // + "Negative values for sell-to-grid; positive for buy-from-grid")), /** @@ -227,9 +237,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * the system') * */ - GRID_ACTIVE_POWER_L2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_ACTIVE_POWER_L2(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Grid exchange power on phase L2. " // + "Negative values for sell-to-grid; positive for buy-from-grid")), /** @@ -244,9 +254,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * the system') * */ - GRID_ACTIVE_POWER_L3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_ACTIVE_POWER_L3(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Grid exchange power on phase L3. " // + "Negative values for sell-to-grid; positive for buy-from-grid")), /** @@ -259,9 +269,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: negative values or '0' * */ - GRID_MIN_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), + GRID_MIN_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), /** * Grid: Maximum Ever Active Power. * @@ -272,9 +282,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: positive values or '0' * */ - GRID_MAX_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), + GRID_MAX_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), /** * Grid: Price for Buy-from-Grid. * @@ -284,9 +294,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Currency (see {@link Meta.ChannelId#CURRENCY}) per MWh * */ - GRID_BUY_PRICE(Doc.of(OpenemsType.DOUBLE) // - .unit(Unit.MONEY_PER_MEGAWATT_HOUR) // - .persistencePriority(PersistencePriority.VERY_HIGH)), + GRID_BUY_PRICE(Doc.of(DOUBLE) // + .unit(MONEY_PER_MEGAWATT_HOUR) // + .persistencePriority(VERY_HIGH)), /** * Production: Active Power. * @@ -297,9 +307,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Total production; always positive")), /** * Production: AC Active Power. @@ -311,9 +321,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_AC_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_AC_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Production from AC source")), /** * Production: AC Active Power L1. @@ -325,9 +335,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_AC_ACTIVE_POWER_L1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_AC_ACTIVE_POWER_L1(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Production from AC source on phase L1")), /** * Production: AC Active Power L2. @@ -339,9 +349,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_AC_ACTIVE_POWER_L2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_AC_ACTIVE_POWER_L2(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Production from AC source on phase L2")), /** * Production: AC Active Power L3. @@ -353,9 +363,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_AC_ACTIVE_POWER_L3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_AC_ACTIVE_POWER_L3(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Production from AC source on phase L3")), /** * Production: DC Actual Power. @@ -367,9 +377,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: should be only positive * */ - PRODUCTION_DC_ACTUAL_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_DC_ACTUAL_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Production from DC source")), /** * Production: Maximum Ever Active Power. @@ -381,9 +391,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: positive values or '0' * */ - PRODUCTION_MAX_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_MAX_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Consumption: Active Power. * @@ -396,9 +406,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * Production-Meter and charge/discharge of battery. * */ - CONSUMPTION_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Active power of the electrical consumption")), // /** * Consumption: Active Power L1. @@ -412,9 +422,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * Production-Meter and charge/discharge of battery. * */ - CONSUMPTION_ACTIVE_POWER_L1(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_ACTIVE_POWER_L1(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Active power of the electrical consumption on phase L1")), // /** * Consumption: Active Power L2. @@ -428,9 +438,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * Production-Meter and charge/discharge of battery. * */ - CONSUMPTION_ACTIVE_POWER_L2(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_ACTIVE_POWER_L2(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Active power of the electrical consumption on phase L2")), // /** * Consumption: Active Power L3. @@ -444,9 +454,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * Production-Meter and charge/discharge of battery. * */ - CONSUMPTION_ACTIVE_POWER_L3(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_ACTIVE_POWER_L3(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Active power of the electrical consumption on phase L3")), // /** * Consumption: Maximum Ever Active Power. @@ -458,9 +468,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: positive values or '0' * */ - CONSUMPTION_MAX_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_MAX_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH) // .text("Maximum measured active power of the electrical consumpton")), // /** * Unmanaged Consumption: Active Power. @@ -477,9 +487,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * consumption. * */ - UNMANAGED_CONSUMPTION_ACTIVE_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + UNMANAGED_CONSUMPTION_ACTIVE_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Grid-Mode. * @@ -490,7 +500,7 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { * */ GRID_MODE(Doc.of(GridMode.values()) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + .persistencePriority(VERY_HIGH)), // /** * Cumulated Off-Grid time. * @@ -499,9 +509,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Type: Cumulated Seconds * */ - GRID_MODE_OFF_GRID_TIME(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_SECONDS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_MODE_OFF_GRID_TIME(Doc.of(LONG) // + .unit(CUMULATED_SECONDS) // + .persistencePriority(VERY_HIGH) // .text("Total Off-Grid time")), // /** * Ess: Max Apparent Power. @@ -512,9 +522,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: VA * */ - ESS_MAX_APPARENT_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.VOLT_AMPERE) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_MAX_APPARENT_POWER(Doc.of(INTEGER) // + .unit(VOLT_AMPERE) // + .persistencePriority(VERY_HIGH)), // /** * Ess: Active Charge Energy. * @@ -524,9 +534,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_ACTIVE_CHARGE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_CHARGE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of the AC-side storage charging incl. excess PV generation at the hybrid inverter")), // /** * Ess: Active Discharge Energy. @@ -537,9 +547,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_ACTIVE_DISCHARGE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_ACTIVE_DISCHARGE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of the AC-side storage discharge incl. excess PV generation at the hybrid inverter")), // /** * Ess: DC Discharge Energy. @@ -550,9 +560,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_DC_DISCHARGE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_DC_DISCHARGE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated DC electrical energy of the storage discharging")), // /** * Ess: DC Charge Energy. @@ -563,9 +573,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_DC_CHARGE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + ESS_DC_CHARGE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated DC electrical energy of the storage charging")), // /** * Grid: Buy-from-grid Energy ("Production"). @@ -576,9 +586,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - GRID_BUY_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_BUY_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of grid consumption")), // /** * Grid: Sell-to-grid Energy ("Consumption"). @@ -589,9 +599,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - GRID_SELL_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + GRID_SELL_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of grid feed-in")), // /** * Production: Energy. @@ -601,9 +611,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of DC- and AC-side generators, e.g. photovoltaics")), // /** * Production: AC Energy. @@ -614,9 +624,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_AC_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_AC_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of AC-side generators")), // /** * Production: DC Energy. @@ -627,9 +637,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_DC_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + PRODUCTION_DC_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy of DC-side generators")), // /** * Consumption: Energy. @@ -640,9 +650,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - CONSUMPTION_ACTIVE_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH) // + CONSUMPTION_ACTIVE_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH) // .text("Accumulated electrical energy consumption")), // /** * Production to Consumption: Power. @@ -654,9 +664,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: only positive * */ - PRODUCTION_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_CONSUMPTION_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Production to Consumption: Energy. * @@ -666,9 +676,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_CONSUMPTION_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Production to Grid: Power. * @@ -679,9 +689,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: only positive * */ - PRODUCTION_TO_GRID_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_GRID_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Production to Grid: Energy. * @@ -691,9 +701,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_TO_GRID_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_GRID_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Production to ESS: Power. * @@ -704,9 +714,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: only positive * */ - PRODUCTION_TO_ESS_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_ESS_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Production to ESS: Energy. * @@ -716,9 +726,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - PRODUCTION_TO_ESS_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + PRODUCTION_TO_ESS_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Grid to Consumption: Power. * @@ -729,9 +739,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: only positive * */ - GRID_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + GRID_TO_CONSUMPTION_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Grid to Consumption: Energy. * @@ -741,9 +751,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - GRID_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + GRID_TO_CONSUMPTION_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * ESS to Consumption: Power. * @@ -754,9 +764,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: only positive * */ - ESS_TO_CONSUMPTION_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_TO_CONSUMPTION_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * ESS to Consumption: Energy. * @@ -766,9 +776,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_TO_CONSUMPTION_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_TO_CONSUMPTION_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Grid to ESS: Power. * @@ -779,9 +789,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Range: discharge-to-grid negative, charge-from-grid positive * */ - GRID_TO_ESS_POWER(Doc.of(OpenemsType.INTEGER) // - .unit(Unit.WATT) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + GRID_TO_ESS_POWER(Doc.of(INTEGER) // + .unit(WATT) // + .persistencePriority(VERY_HIGH)), // /** * Grid to ESS: Energy. * @@ -791,9 +801,9 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - GRID_TO_ESS_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + GRID_TO_ESS_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * ESS to Grid: Energy. * @@ -803,15 +813,15 @@ public enum ChannelId implements io.openems.edge.common.channel.ChannelId { *
  • Unit: Wh_Σ * */ - ESS_TO_GRID_ENERGY(Doc.of(OpenemsType.LONG) // - .unit(Unit.CUMULATED_WATT_HOURS) // - .persistencePriority(PersistencePriority.VERY_HIGH)), // + ESS_TO_GRID_ENERGY(Doc.of(LONG) // + .unit(CUMULATED_WATT_HOURS) // + .persistencePriority(VERY_HIGH)), // /** * Is there any Component Info/Warning/Fault that is getting ignored/hidden * because of the 'ignoreStateComponents' configuration setting?. */ - HAS_IGNORED_COMPONENT_STATES(Doc.of(Level.INFO) // + HAS_IGNORED_COMPONENT_STATES(Doc.of(INFO) // .text("Component Warnings or Faults are being ignored")); private final Doc doc;