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, org.osgi.service.event.EventHandler
Direct Known Subclasses:
EssGenericManagedSymmetricImpl, EssGenericOffGridImpl

public abstract class AbstractGenericManagedEss<ESS extends SymmetricEss,BATTERY extends Battery,BATTERY_INVERTER extends ManagedSymmetricBatteryInverter> extends AbstractOpenemsComponent implements GenericManagedEss, ManagedSymmetricEss, HybridEss, SymmetricEss, 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.
  • Field Details

  • Constructor Details

    • AbstractGenericManagedEss

      protected AbstractGenericManagedEss(ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
  • Method Details

    • 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, String id, String alias, boolean enabled)
      Description copied from class: AbstractOpenemsComponent
      Handles @Activate of implementations. Prints log output.
      Overrides:
      activate in class AbstractOpenemsComponent
      Parameters:
      context - the OSGi ComponentContext
      id - the unique OpenEMS Component ID
      alias - Human-readable name of this Component. Typically 'config.alias()'. Defaults to 'id' if empty
      enabled - is the Component enabled?
    • activate

      protected void activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, org.osgi.service.cm.ConfigurationAdmin cm, String batteryInverterId, String batteryId, StartStopConfig startStop)
    • deactivate

      protected void deactivate()
      Description copied from class: AbstractOpenemsComponent
      Handles @Deactivate of implementations. Prints log output.
      Overrides:
      deactivate in class AbstractOpenemsComponent
    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • handleStateMachine

      protected abstract void handleStateMachine()
      Handles the State-Machine.
    • genericDebugLog

      protected void genericDebugLog(StringBuilder sb)
    • applyPower

      public void applyPower(int activePower, int reactivePower) throws OpenemsError.OpenemsNamedException
      Forwards the power request to the SymmetricBatteryInverter. 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 interface ManagedSymmetricEss
      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 from SymmetricBatteryInverter. 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 interface ManagedSymmetricEss
      Returns:
      the power precision
    • getStaticConstraints

      public Constraint[] getStaticConstraints() throws OpenemsError.OpenemsNamedException
      Retrieves StaticConstraints from SymmetricBatteryInverter. Gets static Constraints for this Ess. Override this method to provide specific Constraints for this Ess on every Cycle.
      Specified by:
      getStaticConstraints in interface ManagedSymmetricEss
      Returns:
      the Constraints
      Throws:
      OpenemsError.OpenemsNamedException
    • getSurplusPower

      public Integer getSurplusPower()
      Description copied from interface: HybridEss
      Gets the Surplus Power of the EssDcChargers of this HybridEss.

      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 interface HybridEss
      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 interface ModbusSlave
      Parameters:
      accessMode - filters the Modbus-Records that should be shown
      Returns:
      the Modbus-Slave-Table
    • getStartStopTarget

      public StartStop getStartStopTarget()
      Description copied from interface: GenericManagedEss
      Gets the target Start/Stop mode from config or StartStop-Channel.
      Specified by:
      getStartStopTarget in interface GenericManagedEss
      Returns:
      StartStop