Class EssGridcon

All Implemented Interfaces:
OpenemsComponent, ModbusSlave, ManagedSymmetricEss, SymmetricEss, org.osgi.service.event.EventHandler
Direct Known Subclasses:
MrGridconOngridImpl, MrGridconOnOffgridImpl

public abstract class EssGridcon extends AbstractOpenemsComponent implements OpenemsComponent, ManagedSymmetricEss, SymmetricEss, ModbusSlave, org.osgi.service.event.EventHandler
  • Field Details

  • Constructor Details

    • EssGridcon

      public EssGridcon(ChannelId[] otherChannelIds)
  • Method Details

    • getComponentManager

      protected abstract ComponentManager getComponentManager()
    • activate

      protected void activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, String gridconId, String bmsA, String bmsB, String bmsC, float offsetCurrent) throws OpenemsError.OpenemsNamedException
      Throws:
      OpenemsError.OpenemsNamedException
    • getFirstGeneralStateObjectUndefined

      protected abstract StateObject getFirstGeneralStateObjectUndefined()
    • initializeStateController

      protected abstract void initializeStateController(String gridconPcs, String b1, String b2, String b3)
    • 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
    • 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 interface ManagedSymmetricEss
      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 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()
      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 interface ManagedSymmetricEss
      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 interface ModbusSlave
      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 IllegalArgumentException, OpenemsError.OpenemsNamedException
      Throws:
      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 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 interface OpenemsComponent
      Returns:
      the debug log output
    • getBatteries

      protected Collection<Battery> getBatteries()
      Gets all Batteries.
      Returns:
      a collection of Batteries; guaranteed to be not-null.