Package io.openems.edge.ess.test
Class DummyManagedSymmetricEss
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.ess.test.DummyManagedSymmetricEss
-
- All Implemented Interfaces:
OpenemsComponent
,ManagedSymmetricEss
,SymmetricEss
- Direct Known Subclasses:
DummyManagedAsymmetricEss
public class DummyManagedSymmetricEss extends AbstractOpenemsComponent implements ManagedSymmetricEss, SymmetricEss, OpenemsComponent
Provides a simple, simulated ManagedSymmetricEss component that can be used together with the OpenEMS Component test framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DummyManagedSymmetricEss.SymmetricApplyPowerRecord
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.api.ManagedSymmetricEss
ManagedSymmetricEss.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.api.SymmetricEss
SymmetricEss.ChannelId
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_APPARENT_POWER
-
Constructor Summary
Constructors Modifier Constructor Description DummyManagedSymmetricEss(java.lang.String id)
DummyManagedSymmetricEss(java.lang.String id, int maxApparentPower)
DummyManagedSymmetricEss(java.lang.String id, Power power)
protected
DummyManagedSymmetricEss(java.lang.String id, Power power, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
-
Method Summary
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, deactivate, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.ess.api.ManagedSymmetricEss
_setAllowedChargePower, _setAllowedChargePower, _setAllowedDischargePower, _setAllowedDischargePower, _setApplyPowerFailed, _setDebugSetActivePower, _setDebugSetActivePower, _setDebugSetReactivePower, _setDebugSetReactivePower, addPowerConstraint, addPowerConstraintAndValidate, createPowerConstraint, getAllowedChargePower, getAllowedChargePowerChannel, getAllowedDischargePower, getAllowedDischargePowerChannel, getApplyPowerFailed, getApplyPowerFailedChannel, getDebugSetActivePower, getDebugSetActivePowerChannel, getDebugSetReactivePower, getDebugSetReactivePowerChannel, getSetActivePowerEqualsChannel, getSetActivePowerEqualsWithPidChannel, getSetActivePowerGreaterOrEqualsChannel, getSetActivePowerLessOrEqualsChannel, getSetReactivePowerEqualsChannel, getSetReactivePowerGreaterOrEqualsChannel, getSetReactivePowerLessOrEqualsChannel, getStaticConstraints, isManaged, setActivePowerEquals, setActivePowerEqualsWithPid, setActivePowerGreaterOrEquals, setActivePowerLessOrEquals, setReactivePowerEquals, setReactivePowerGreaterOrEquals, setReactivePowerLessOrEquals
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Methods inherited from interface io.openems.edge.ess.api.SymmetricEss
_setActiveChargeEnergy, _setActiveChargeEnergy, _setActiveDischargeEnergy, _setActiveDischargeEnergy, _setActivePower, _setActivePower, _setCapacity, _setCapacity, _setGridMode, _setMaxApparentPower, _setMaxApparentPower, _setMaxCellTemperature, _setMaxCellTemperature, _setMaxCellVoltage, _setMaxCellVoltage, _setMinCellTemperature, _setMinCellTemperature, _setMinCellVoltage, _setMinCellVoltage, _setReactivePower, _setReactivePower, _setSoc, _setSoc, getActiveChargeEnergy, getActiveChargeEnergyChannel, getActiveDischargeEnergy, getActiveDischargeEnergyChannel, getActivePower, getActivePowerChannel, getCapacity, getCapacityChannel, getGridMode, getGridModeChannel, getMaxApparentPower, getMaxApparentPowerChannel, getMaxCellTemperature, getMaxCellTemperatureChannel, getMaxCellVoltage, getMaxCellVoltageChannel, getMinCellTemperature, getMinCellTemperatureChannel, getMinCellVoltage, getMinCellVoltageChannel, getReactivePower, getReactivePowerChannel, getSoc, getSocChannel
-
-
-
-
Field Detail
-
MAX_APPARENT_POWER
public static final int MAX_APPARENT_POWER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DummyManagedSymmetricEss
protected DummyManagedSymmetricEss(java.lang.String id, Power power, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
-
DummyManagedSymmetricEss
public DummyManagedSymmetricEss(java.lang.String id, Power power)
-
DummyManagedSymmetricEss
public DummyManagedSymmetricEss(java.lang.String id)
-
DummyManagedSymmetricEss
public DummyManagedSymmetricEss(java.lang.String id, int maxApparentPower)
-
-
Method Detail
-
setMaxApparentPower
public DummyManagedSymmetricEss setMaxApparentPower(java.lang.Integer value)
-
setGridMode
public DummyManagedSymmetricEss setGridMode(GridMode gridMode)
-
setSoc
public DummyManagedSymmetricEss setSoc(int soc)
-
getPower
public Power getPower()
Description copied from interface:ManagedSymmetricEss
Gets an instance of the 'Power' class, which allows to set limitations to Active and Reactive Power.- Specified by:
getPower
in interfaceManagedSymmetricEss
- Returns:
- the Power instance
-
getPowerPrecision
public int getPowerPrecision()
Description copied from interface:ManagedSymmetricEss
Gets the smallest positive power that can be set (in W, VA or var). Example:- FENECON Commercial 40 allows setting of power in 100 W steps. It should return 100.
- KACO blueplanet gridsave 50 allows setting of power in 0.1 % of 52 VA. It should return 52 (= 52000 * 0.001)
- Specified by:
getPowerPrecision
in interfaceManagedSymmetricEss
- Returns:
- the power precision
-
withSoc
public DummyManagedSymmetricEss withSoc(int value)
SetSymmetricEss.ChannelId.SOC
of thisDummyManagedSymmetricEss
.- Parameters:
value
- the state-of-charge- Returns:
- myself
-
withCapacity
public DummyManagedSymmetricEss withCapacity(int value)
SetSymmetricEss.ChannelId.CAPACITY
of thisDummyManagedSymmetricEss
. *- Parameters:
value
- the capacity- Returns:
- myself
-
withGridMode
public DummyManagedSymmetricEss withGridMode(GridMode value)
SetSymmetricEss.ChannelId.GRID_MODE
of thisDummyManagedSymmetricEss
. *- Parameters:
value
- theGridMode
- Returns:
- myself
-
withMaxApparentPower
public DummyManagedSymmetricEss withMaxApparentPower(int value)
- Parameters:
value
- the max apparent power- Returns:
- myself
-
withAllowedChargePower
public DummyManagedSymmetricEss withAllowedChargePower(int value)
- Parameters:
value
- the allowed charge power- Returns:
- myself
-
withAllowedDischargePower
public DummyManagedSymmetricEss withAllowedDischargePower(int value)
- Parameters:
value
- the allowed discharge power- Returns:
- myself
-
withPowerPrecision
public DummyManagedSymmetricEss withPowerPrecision(int value)
Set Power Precision of thisDummyManagedSymmetricEss
.- Parameters:
value
- the power precision- Returns:
- myself
-
withSymmetricApplyPowerCallback
public DummyManagedSymmetricEss withSymmetricApplyPowerCallback(java.util.function.Consumer<DummyManagedSymmetricEss.SymmetricApplyPowerRecord> callback)
Set callback for applyPower() of thisDummyManagedSymmetricEss
.- Parameters:
callback
- the callback- Returns:
- myself
-
applyPower
public void applyPower(int activePower, int reactivePower)
Description copied from interface:ManagedSymmetricEss
Apply the calculated Power.Careful: do not adjust activePower and reactivePower in this method, e.g. setting it to zero on error. The purpose of this method is solely to apply the calculated power to the ESS. If you need to constrain the allowed power, add Constraints using the
ManagedSymmetricEss.getStaticConstraints()
method.- Specified by:
applyPower
in interfaceManagedSymmetricEss
- Parameters:
activePower
- the active power in [W]reactivePower
- the reactive power in [var]
-
-