Class AbstractGenericManagedEss<ESS extends SymmetricEss,BATTERY extends Battery,BATTERY_INVERTER extends ManagedSymmetricBatteryInverter>
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.ess.generic.common.AbstractGenericManagedEss<ESS,BATTERY,BATTERY_INVERTER>
-
- All Implemented Interfaces:
OpenemsComponent
,ModbusSlave
,StartStoppable
,HybridEss
,ManagedSymmetricEss
,SymmetricEss
,GenericManagedEss
,OffGridEss
,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
GenericManagedSymmetricEssImpl
,GenericOffGridEssImpl
public abstract class AbstractGenericManagedEss<ESS extends SymmetricEss,BATTERY extends Battery,BATTERY_INVERTER extends ManagedSymmetricBatteryInverter> extends AbstractOpenemsComponent implements GenericManagedEss, ManagedSymmetricEss, HybridEss, SymmetricEss, OffGridEss, OpenemsComponent, org.osgi.service.event.EventHandler, StartStoppable, ModbusSlave
Parent class for different implementations of Managed Energy Storage Systems, consisting of a Battery-Inverter component and a Battery component.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.generic.common.GenericManagedEss
GenericManagedEss.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.api.HybridEss
HybridEss.ChannelId
-
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.common.startstop.StartStoppable
StartStoppable.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.api.SymmetricEss
SymmetricEss.ChannelId
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicReference<StartStop>
startStopTarget
-
Fields inherited from interface io.openems.edge.ess.generic.common.GenericManagedEss
EFFICIENCY_FACTOR, RETRY_COMMAND_MAX_ATTEMPTS, RETRY_COMMAND_SECONDS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractGenericManagedEss(ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled)
Handles @Activate of implementations.protected void
activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String batteryInverterId, java.lang.String batteryId, StartStopConfig startStop)
void
applyPower(int activePower, int reactivePower)
Forwards the power request to theSymmetricBatteryInverter
.protected void
deactivate()
Handles @Deactivate of implementations.protected java.lang.StringBuilder
genericDebugLog()
protected abstract BATTERY
getBattery()
protected abstract BATTERY_INVERTER
getBatteryInverter()
protected abstract AbstractChannelManager<ESS,BATTERY,BATTERY_INVERTER>
getChannelManager()
Helper wrapping class to handle everything related to Channels.protected abstract ComponentManager
getComponentManager()
ModbusSlaveTable
getModbusSlaveTable(AccessMode accessMode)
Gets the Modbus-Slave-Table for this OpenEMS-Component.int
getPowerPrecision()
Retrieves PowerPrecision fromSymmetricBatteryInverter
.StartStop
getStartStopTarget()
Gets the target Start/Stop mode from config or StartStop-Channel.Constraint[]
getStaticConstraints()
Retrieves StaticConstraints fromSymmetricBatteryInverter
.java.lang.Integer
getSurplusPower()
Gets the Surplus Power of theEssDcCharger
s of thisHybridEss
.void
handleEvent(org.osgi.service.event.Event event)
protected abstract void
handleStateMachine()
Handles the State-Machine.boolean
isOffGridPossible()
Gets a boolean if the ess is able to build a micro-grid in off-grid.-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, addChannel, addChannels, addChannels, alias, channels, 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.generic.common.GenericManagedEss
_setMaxBatteryInverterStartAttemptsFault, _setMaxBatteryInverterStopAttemptsFault, _setMaxBatteryStartAttemptsFault, _setMaxBatteryStopAttemptsFault, getMaxBatteryInverterStartAttemptsFault, getMaxBatteryInverterStartAttemptsFaultChannel, getMaxBatteryInverterStopAttemptsFault, getMaxBatteryInverterStopAttemptsFaultChannel, getMaxBatteryStartAttemptsFault, getMaxBatteryStartAttemptsFaultChannel, getMaxBatteryStopAttemptsFault, getMaxBatteryStopAttemptsFaultChannel
-
Methods inherited from interface io.openems.edge.ess.api.HybridEss
_setDcChargeEnergy, _setDcChargeEnergy, _setDcDischargeEnergy, _setDcDischargeEnergy, _setDcDischargePower, getDcChargeEnergy, getDcChargeEnergyChannel, getDcDischargeEnergy, getDcDischargeEnergyChannel, getDcDischargePower, getDcDischargePowerChannel
-
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, getPower, getSetActivePowerEqualsChannel, getSetActivePowerEqualsWithPidChannel, getSetActivePowerGreaterOrEqualsChannel, getSetActivePowerLessOrEqualsChannel, getSetReactivePowerEqualsChannel, getSetReactivePowerGreaterOrEqualsChannel, getSetReactivePowerLessOrEqualsChannel, 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.common.startstop.StartStoppable
_setStartStop, getStartStop, getStartStopChannel, isStarted, isStopped, setStartStop, start, stop
-
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
-
startStopTarget
protected final java.util.concurrent.atomic.AtomicReference<StartStop> startStopTarget
-
-
Method Detail
-
getChannelManager
protected abstract AbstractChannelManager<ESS,BATTERY,BATTERY_INVERTER> getChannelManager()
Helper wrapping class to handle everything related to Channels.- Returns:
- the
ChannelManager
-
getComponentManager
protected abstract ComponentManager getComponentManager()
-
getBattery
protected abstract BATTERY getBattery()
-
getBatteryInverter
protected abstract BATTERY_INVERTER getBatteryInverter()
-
activate
protected void activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled)
Description copied from class:AbstractOpenemsComponent
Handles @Activate of implementations. Prints log output.- Overrides:
activate
in classAbstractOpenemsComponent
- Parameters:
context
- the OSGi ComponentContextid
- the unique OpenEMS Component IDalias
- Human-readable name of this Component. Typically 'config.alias()'. Defaults to 'id' if emptyenabled
- is the Component enabled?
-
activate
protected void activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String batteryInverterId, java.lang.String batteryId, StartStopConfig startStop)
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
handleStateMachine
protected abstract void handleStateMachine()
Handles the State-Machine.
-
genericDebugLog
protected java.lang.StringBuilder genericDebugLog()
-
applyPower
public void applyPower(int activePower, int reactivePower) throws OpenemsError.OpenemsNamedException
Forwards the power request to theSymmetricBatteryInverter
. 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]- Throws:
OpenemsError.OpenemsNamedException
- on error; causes activation of APPLY_POWER_FAILED StateChannel
-
getPowerPrecision
public int getPowerPrecision()
Retrieves PowerPrecision fromSymmetricBatteryInverter
. 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
-
getStaticConstraints
public Constraint[] getStaticConstraints() throws OpenemsError.OpenemsNamedException
Retrieves StaticConstraints fromSymmetricBatteryInverter
. Gets static Constraints for this Ess. Override this method to provide specific Constraints for this Ess on every Cycle.- Specified by:
getStaticConstraints
in interfaceManagedSymmetricEss
- Returns:
- the Constraints
- Throws:
OpenemsException
- on errorOpenemsError.OpenemsNamedException
-
getSurplusPower
public java.lang.Integer getSurplusPower()
Description copied from interface:HybridEss
Gets the Surplus Power of theEssDcCharger
s of thisHybridEss
.This value is usually calculated from the
EssDcCharger.getActualPower()
when the battery is full. It is used by the Ess.Hybrid.Surplus-Feed-To-Grid Controller to feed the surplus power to grid.- Specified by:
getSurplusPower
in interfaceHybridEss
- Returns:
- the surplus power, or 'null' if there is no surplus power
-
getModbusSlaveTable
public ModbusSlaveTable getModbusSlaveTable(AccessMode accessMode)
Description copied from interface:ModbusSlave
Gets the Modbus-Slave-Table for this OpenEMS-Component.- Specified by:
getModbusSlaveTable
in interfaceModbusSlave
- Parameters:
accessMode
- filters the Modbus-Records that should be shown- Returns:
- the Modbus-Slave-Table
-
isOffGridPossible
public boolean isOffGridPossible()
Description copied from interface:OffGridEss
Gets a boolean if the ess is able to build a micro-grid in off-grid.Returns false if the ess is not able to build a micro-grid.
- Specified by:
isOffGridPossible
in interfaceOffGridEss
- Returns:
- is managed or not
-
getStartStopTarget
public StartStop getStartStopTarget()
Description copied from interface:GenericManagedEss
Gets the target Start/Stop mode from config or StartStop-Channel.- Specified by:
getStartStopTarget
in interfaceGenericManagedEss
- Returns:
StartStop
-
-