java.lang.Object
io.openems.edge.controller.ess.timeofusetariff.Utils

public final class Utils extends Object
Utils for TimeOfUseTariffController.

All energy values are in [Wh] and positive, unless stated differently.

  • Field Details

    • ESS_MAX_SOC

      public static final float ESS_MAX_SOC
      Keep some buffer to avoid scheduling errors because of bad predictions.
      See Also:
    • ESS_LIMIT_14A_ENWG

      public static final int ESS_LIMIT_14A_ENWG
      Limit Charge Power for §14a EnWG.
      See Also:
    • ESS_CHARGE_C_RATE

      public static final float ESS_CHARGE_C_RATE
      C-Rate (capacity divided by time) during StateMachine.CHARGE_GRID. With a C-Rate of 0.5 the battery gets fully charged within 2 hours.
      See Also:
    • SUM_PRODUCTION

      public static final ChannelAddress SUM_PRODUCTION
    • SUM_CONSUMPTION

      public static final ChannelAddress SUM_CONSUMPTION
    • SUM_GRID

      public static final ChannelAddress SUM_GRID
    • SUM_UNMANAGED_CONSUMPTION

      public static final ChannelAddress SUM_UNMANAGED_CONSUMPTION
    • SUM_ESS_DISCHARGE_POWER

      public static final ChannelAddress SUM_ESS_DISCHARGE_POWER
    • SUM_ESS_SOC

      public static final ChannelAddress SUM_ESS_SOC
  • Method Details

    • getEssMinSocPercentage

      public static int getEssMinSocPercentage(List<ControllerEssLimitTotalDischarge> ctrlLimitTotalDischarges, List<ControllerEssEmergencyCapacityReserve> ctrlEmergencyCapacityReserves)
      Returns the configured minimum SoC, or zero.
      Parameters:
      ctrlLimitTotalDischarges - the list of ControllerEssLimitTotalDischarge
      ctrlEmergencyCapacityReserves - the list of ControllerEssEmergencyCapacityReserve
      Returns:
      the value in [%]
    • calculateAutomaticMode

      public static Utils.ApplyState calculateAutomaticMode(Sum sum, ManagedSymmetricEss ess, Integer essChargeInChargeGrid, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG, StateMachine targetState)
      Calculate Automatic Mode.
      Parameters:
      sum - the Sum
      ess - the ManagedSymmetricEss
      essChargeInChargeGrid - ESS Charge Energy in CHARGE_GRID State [Wh]
      maxChargePowerFromGrid - the configured max charge from grid power
      limitChargePowerFor14aEnWG - Limit Charge Power for §14a EnWG
      targetState - the scheduled target StateMachine
      Returns:
      Utils.ApplyState
    • postprocessRunState

      public static StateMachine postprocessRunState(StateMachine state, int pwrBalancing, int pwrDelayDischarge, int pwrChargeGrid)
      Post-Process a state during Controller.run(), i.e. replace with 'better' state if appropriate.

      NOTE: this can be useful, if live operation deviates from predicted operation, e.g. because predictions were wrong.

      Parameters:
      state - the initial state
      pwrBalancing - the power set-point as it would be in StateMachine.BALANCING
      pwrDelayDischarge - the power set-point as it would be in StateMachine.DELAY_DISCHARGE
      pwrChargeGrid - the power set-point as it would be in StateMachine.CHARGE_GRID
      Returns:
      the new state
    • calculateEssChargeInChargeGridPowerFromParams

      protected static int calculateEssChargeInChargeGridPowerFromParams(Integer essChargeInChargeGrid, ManagedSymmetricEss ess)
    • calculateChargeGridPower

      public static int calculateChargeGridPower(Integer essChargeInChargeGrid, ManagedSymmetricEss ess, int essActivePower, int gridActivePower, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG)
      Calculates the Max-ActivePower constraint for StateMachine.CHARGE_GRID.
      Parameters:
      essChargeInChargeGrid - ESS Charge Energy in CHARGE_GRID State [Wh]
      ess - the ManagedSymmetricEss
      essActivePower - the ESS ActivePower
      gridActivePower - the Grid ActivePower
      maxChargePowerFromGrid - the configured max charge from grid power
      limitChargePowerFor14aEnWG - Limit Charge Power for §14a EnWG
      Returns:
      the set-point or null
    • calculateMaxChargeProductionPower

      public static Integer calculateMaxChargeProductionPower(Sum sum)
      Calculates the Max-ActivePower constraint for
      invalid reference
      StateMachine#CHARGE_PRODUCTION
      .
      Parameters:
      sum - the Sum
      Returns:
      the set-point
    • calculateDelayDischargePower

      public static int calculateDelayDischargePower(ManagedSymmetricEss ess)
      Calculates the ActivePower constraint for StateMachine.DELAY_DISCHARGE.
      Parameters:
      ess - the ManagedSymmetricEss
      Returns:
      the set-point