Package io.openems.edge.ess.mr.gridcon
Class EssGridcon
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.ess.mr.gridcon.EssGridcon
-
- All Implemented Interfaces:
OpenemsComponent
,ModbusSlave
,ManagedSymmetricEss
,SymmetricEss
,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
EssGridconOnGrid
,EssGridconOnOffGrid
public abstract class EssGridcon extends AbstractOpenemsComponent implements OpenemsComponent, ManagedSymmetricEss, SymmetricEss, ModbusSlave, org.osgi.service.event.EventHandler
-
-
Nested Class Summary
-
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 protected GridconStateObject
gridconStateObject
protected StateObject
mainStateObject
static int
MAX_CURRENT_PER_STRING
protected StateController
stateController
-
Constructor Summary
Constructors Constructor Description EssGridcon(ChannelId[] otherChannelIds)
-
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, java.lang.String gridconId, java.lang.String bmsA, java.lang.String bmsB, java.lang.String bmsC, float offsetCurrent)
void
applyPower(int activePower, int reactivePower)
Apply the calculated Power.protected void
calculateActiveAndReactivePower()
protected void
calculateAllowedPower()
Handles Battery data, i.e.protected void
calculateCapacity()
protected abstract void
calculateGridMode()
protected void
calculateSoc()
Calculates the StateObject-of-charge of all Batteries; if all batteries are available.protected void
deactivate()
Handles @Deactivate of implementations.java.lang.String
debugLog()
Gets some output that is suitable for a continuous Debug log.protected java.util.Collection<Battery>
getBatteries()
Gets all Batteries.protected abstract ComponentManager
getComponentManager()
protected abstract StateObject
getFirstGeneralStateObjectUndefined()
ModbusSlaveTable
getModbusSlaveTable(AccessMode accessMode)
Gets the Modbus-Slave-Table for this OpenEMS-Component.int
getPowerPrecision()
Gets the smallest positive power that can be set (in W, VA or var).Constraint[]
getStaticConstraints()
Gets static Constraints for this Ess.void
handleEvent(org.osgi.service.event.Event event)
protected abstract void
initializeStateController(java.lang.String gridconPcs, java.lang.String b1, java.lang.String b2, java.lang.String b3)
protected abstract void
writeStateMachineToChannel()
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, 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.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, 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_CURRENT_PER_STRING
public static final int MAX_CURRENT_PER_STRING
- See Also:
- Constant Field Values
-
mainStateObject
protected StateObject mainStateObject
-
gridconStateObject
protected GridconStateObject gridconStateObject
-
stateController
protected final StateController stateController
-
-
Constructor Detail
-
EssGridcon
public EssGridcon(ChannelId[] otherChannelIds)
-
-
Method Detail
-
getComponentManager
protected abstract ComponentManager getComponentManager()
-
activate
protected void activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, java.lang.String gridconId, java.lang.String bmsA, java.lang.String bmsB, java.lang.String bmsC, float offsetCurrent) throws OpenemsError.OpenemsNamedException
-
getFirstGeneralStateObjectUndefined
protected abstract StateObject getFirstGeneralStateObjectUndefined()
-
initializeStateController
protected abstract void initializeStateController(java.lang.String gridconPcs, java.lang.String b1, java.lang.String b2, java.lang.String b3)
-
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
-
writeStateMachineToChannel
protected abstract void writeStateMachineToChannel()
-
calculateActiveAndReactivePower
protected void calculateActiveAndReactivePower()
-
getStaticConstraints
public Constraint[] getStaticConstraints() throws OpenemsException
Description copied from interface:ManagedSymmetricEss
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 error
-
applyPower
public void applyPower(int activePower, int reactivePower) throws OpenemsError.OpenemsNamedException
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]- Throws:
OpenemsError.OpenemsNamedException
- on error; causes activation of APPLY_POWER_FAILED StateChannel
-
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
-
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
-
calculateAllowedPower
protected void calculateAllowedPower()
Handles Battery data, i.e. setting allowed charge/discharge power.
-
calculateGridMode
protected abstract void calculateGridMode() throws java.lang.IllegalArgumentException, OpenemsError.OpenemsNamedException
- Throws:
java.lang.IllegalArgumentException
OpenemsError.OpenemsNamedException
-
calculateSoc
protected void calculateSoc()
Calculates the StateObject-of-charge of all Batteries; if all batteries are available. Otherwise sets UNDEFINED.
-
calculateCapacity
protected void calculateCapacity()
-
debugLog
public java.lang.String debugLog()
Description copied from interface:OpenemsComponent
Gets some output that is suitable for a continuous Debug log. Returns 'null' by default which causes no output.- Specified by:
debugLog
in interfaceOpenemsComponent
- Returns:
- the debug log output
-
getBatteries
protected java.util.Collection<Battery> getBatteries()
Gets all Batteries.- Returns:
- a collection of Batteries; guaranteed to be not-null.
-
-