Class EssFeneconCommercial40Impl
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
-
- io.openems.edge.ess.fenecon.commercial40.EssFeneconCommercial40Impl
-
- All Implemented Interfaces:
ModbusComponent
,OpenemsComponent
,ModbusSlave
,HybridEss
,ManagedSymmetricEss
,SymmetricEss
,EssFeneconCommercial40
,TimedataProvider
,org.osgi.service.event.EventHandler
public class EssFeneconCommercial40Impl extends AbstractOpenemsModbusComponent implements EssFeneconCommercial40, ManagedSymmetricEss, SymmetricEss, HybridEss, ModbusComponent, OpenemsComponent, org.osgi.service.event.EventHandler, ModbusSlave, TimedataProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
AbstractOpenemsModbusComponent.BitConverter, AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>>
-
Nested classes/interfaces inherited from interface io.openems.edge.ess.fenecon.commercial40.EssFeneconCommercial40
EssFeneconCommercial40.ChannelId, EssFeneconCommercial40.InsufficientGridParametersChannelId, EssFeneconCommercial40.PowerDecreaseCausedByOvertemperatureChannelId, EssFeneconCommercial40.SystemErrorChannelId
-
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.bridge.modbus.api.ModbusComponent
ModbusComponent.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 org.osgi.service.cm.ConfigurationAdmin
cm
protected ComponentManager
componentManager
protected static int
MAX_APPARENT_POWER
protected static int
NET_CAPACITY
-
Constructor Summary
Constructors Constructor Description EssFeneconCommercial40Impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCharger(EssDcChargerFeneconCommercial40 charger)
Registers a Charger with this ESS.void
applyPower(int activePower, int reactivePower)
Apply the calculated Power.protected void
deactivate()
Handles @Deactivate of implementations.java.lang.String
debugLog()
Gets some output that is suitable for a continuous Debug log.protected ModbusProtocol
defineModbusProtocol()
Defines the Modbus protocol.java.lang.String
getModbusBridgeId()
Gets the Modbus-Bridge Component-ID, i.e.ModbusSlaveTable
getModbusSlaveTable(AccessMode accessMode)
Gets the Modbus-Slave-Table for this OpenEMS-Component.Power
getPower()
Gets an instance of the 'Power' class, which allows to set limitations to Active and Reactive Power.int
getPowerPrecision()
Gets the smallest positive power that can be set (in W, VA or var).Constraint[]
getStaticConstraints()
Gets static Constraints for this Ess.java.lang.Integer
getSurplusPower()
Gets the Surplus Power of theEssDcCharger
s of thisHybridEss
.Timedata
getTimedata()
Gets theTimedata
service.void
handleEvent(org.osgi.service.event.Event event)
boolean
isManaged()
Gets a boolean if the ess is managed or not.protected void
logInfo(org.slf4j.Logger log, java.lang.String message)
Log an info message including the Component ID.void
removeCharger(EssDcChargerFeneconCommercial40 charger)
Unregisters a Charger from this ESS.protected void
setModbus(BridgeModbus modbus)
Set the Modbus bridge.-
Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
activate, activate, activate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, m, m, modified, modified, unsetModbus
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logWarn, 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.fenecon.commercial40.EssFeneconCommercial40
getUnitId
-
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, getSetActivePowerEqualsChannel, getSetActivePowerEqualsWithPidChannel, getSetActivePowerGreaterOrEqualsChannel, getSetActivePowerLessOrEqualsChannel, getSetReactivePowerEqualsChannel, getSetReactivePowerGreaterOrEqualsChannel, getSetReactivePowerLessOrEqualsChannel, setActivePowerEquals, setActivePowerEqualsWithPid, setActivePowerGreaterOrEquals, setActivePowerLessOrEquals, setReactivePowerEquals, setReactivePowerGreaterOrEquals, setReactivePowerLessOrEquals
-
Methods inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
_setModbusCommunicationFailed, getModbusCommunicationFailed, getModbusCommunicationFailedChannel
-
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_APPARENT_POWER
protected static final int MAX_APPARENT_POWER
- See Also:
- Constant Field Values
-
NET_CAPACITY
protected static final int NET_CAPACITY
- See Also:
- Constant Field Values
-
componentManager
protected ComponentManager componentManager
-
cm
protected org.osgi.service.cm.ConfigurationAdmin cm
-
-
Method Detail
-
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
-
setModbus
protected void setModbus(BridgeModbus modbus)
Description copied from class:AbstractOpenemsModbusComponent
Set the Modbus bridge. Should be called by @Reference- Overrides:
setModbus
in classAbstractOpenemsModbusComponent
- Parameters:
modbus
- the BridgeModbus Reference
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsModbusComponent
-
getModbusBridgeId
public java.lang.String getModbusBridgeId()
Description copied from interface:EssFeneconCommercial40
Gets the Modbus-Bridge Component-ID, i.e. "modbus0".- Specified by:
getModbusBridgeId
in interfaceEssFeneconCommercial40
- Returns:
- the Component-ID
-
defineModbusProtocol
protected ModbusProtocol defineModbusProtocol() throws OpenemsException
Description copied from class:AbstractOpenemsModbusComponent
Defines the Modbus protocol.- Specified by:
defineModbusProtocol
in classAbstractOpenemsModbusComponent
- Returns:
- the ModbusProtocol
- Throws:
OpenemsException
- on error
-
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
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
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
-
isManaged
public boolean isManaged()
Description copied from interface:ManagedSymmetricEss
Gets a boolean if the ess is managed or not.Returns false if the ess itself is not managed or in a read only mode.
- Specified by:
isManaged
in interfaceManagedSymmetricEss
- Returns:
- is managed or not
-
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
-
getStaticConstraints
public Constraint[] getStaticConstraints() throws OpenemsError.OpenemsNamedException
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 errorOpenemsError.OpenemsNamedException
-
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
-
addCharger
public void addCharger(EssDcChargerFeneconCommercial40 charger)
Description copied from interface:EssFeneconCommercial40
Registers a Charger with this ESS.- Specified by:
addCharger
in interfaceEssFeneconCommercial40
- Parameters:
charger
- the Charger
-
removeCharger
public void removeCharger(EssDcChargerFeneconCommercial40 charger)
Description copied from interface:EssFeneconCommercial40
Unregisters a Charger from this ESS.- Specified by:
removeCharger
in interfaceEssFeneconCommercial40
- Parameters:
charger
- the Charger
-
logInfo
protected void logInfo(org.slf4j.Logger log, java.lang.String message)
Description copied from class:AbstractOpenemsComponent
Log an info message including the Component ID.- Overrides:
logInfo
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
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
-
getTimedata
public Timedata getTimedata()
Description copied from interface:TimedataProvider
Gets theTimedata
service.- Specified by:
getTimedata
in interfaceTimedataProvider
- Returns:
- the service or null if it is not (yet) available.
-
-