Class DelayCharge
java.lang.Object
io.openems.edge.controller.ess.gridoptimizedcharge.DelayCharge
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Integer
_getCalculatedPowerLimit
(int remainingCapacity, int remainingTime) Deprecated.protected void
applyCalculatedLimit
(int rawDelayChargeMaxChargePower, int delayChargeMaxChargePower) Apply the calculated power limit as constraint.protected static int
calculateAvailEnergy
(Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, Clock clock, int targetMinute) Calculate the available Energy.protected static int
calculateRemainingTime
(Clock clock, int targetMinute) Calculates the number of seconds left to the target hour.calculateTargetMinute
(Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, ZonedDateTime predictionStartQuarterHour) Calculates the target minute from quarter-hourly production and consumption predictions.protected static ZonedDateTime
getAsZonedDateTime
(int minuteOfDay, Clock clock) protected static Integer
getCalculatedPowerLimit
(int remainingCapacity, int remainingTime, Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, Clock clock, DelayChargeRiskLevel riskLevel, int maxApparentPower, int targetMinute, double minimumChargePower, GridOptimizedChargeImpl parent) Calculates the charging power limit.protected Integer
Get the maximum active power limit depending the configured target time.protected static Long
getPredictedChargeStart
(int targetTime, int capacity, int soc, Clock clock) Gets the predicted charge start time as epoch seconds.protected Integer
Get the maximum active power limit depending on the prediction values.protected void
setDelayChargeStateAndLimit
(DelayChargeState state, Integer limit) Update the StateMachine and ChargePowerLimit channels.
-
Field Details
-
DEFAULT_TARGET_TIME
-
-
Constructor Details
-
DelayCharge
-
-
Method Details
-
getPredictiveDelayChargeMaxCharge
Get the maximum active power limit depending on the prediction values.Calculates the target minute, when the state of charge should reach 100 percent depending on the predicted production and consumption and limits the charge value of the ESS, to get full at this calculated target minute including a configured buffer.
- Returns:
- Maximum charge power
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getManualDelayChargeMaxCharge
Get the maximum active power limit depending the configured target time.Limits the charge value of the ESS, to get full at the given target minute.
- Returns:
- Maximum charge power
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
applyCalculatedLimit
protected void applyCalculatedLimit(int rawDelayChargeMaxChargePower, int delayChargeMaxChargePower) Apply the calculated power limit as constraint.- Parameters:
rawDelayChargeMaxChargePower
- raw maximum charge power (Not adapted to DC)delayChargeMaxChargePower
- maximum power that should be charged by the ESS- Throws:
OpenemsException
- on error
-
getCalculatedPowerLimit
protected static Integer getCalculatedPowerLimit(int remainingCapacity, int remainingTime, Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, Clock clock, DelayChargeRiskLevel riskLevel, int maxApparentPower, int targetMinute, double minimumChargePower, GridOptimizedChargeImpl parent) Calculates the charging power limit.- Parameters:
remainingCapacity
- remaining capacity of the essremainingTime
- remaining time till target minute in secondsquarterHourlyProduction
- predicted productionquarterHourlyConsumption
- predicted consumptionclock
- clockriskLevel
- risk levelmaxApparentPower
- maximum apparent power of the esstargetMinute
- target as minute of the dayminimumChargePower
- minimumChargePower configured by the userparent
-GridOptimizedChargeImpl
to set debug channels- Returns:
- the calculated charging power limit or null if no limit should be applied
-
_getCalculatedPowerLimit
@Deprecated protected static Integer _getCalculatedPowerLimit(int remainingCapacity, int remainingTime) Deprecated.Get calculated power limit.Deprecated method, ignoring efficient charge power and predicted energy.
- Parameters:
remainingCapacity
- remaining capacity of the essremainingTime
- remaining time till target minute in seconds- Returns:
- the calculated charging power limit or null if no limit should be applied
-
calculateRemainingTime
Calculates the number of seconds left to the target hour.- Parameters:
clock
- clocktargetMinute
- target as minute of the day- Returns:
- the remaining time
-
calculateTargetMinute
protected static Optional<Integer> calculateTargetMinute(Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, ZonedDateTime predictionStartQuarterHour) Calculates the target minute from quarter-hourly production and consumption predictions.Returning the last valid target minute if it is present and the new calculated target minute would be null.
- Parameters:
quarterHourlyProduction
- the production predictionquarterHourlyConsumption
- the consumption predictionpredictionStartQuarterHour
- the prediction start quarterHour- Returns:
- the target minute
-
calculateAvailEnergy
protected static int calculateAvailEnergy(Integer[] quarterHourlyProduction, Integer[] quarterHourlyConsumption, Clock clock, int targetMinute) Calculate the available Energy.- Parameters:
quarterHourlyProduction
- predicted productionquarterHourlyConsumption
- predicted consumptionclock
- clocktargetMinute
- target as minute of the day- Returns:
- available energy in Wh
-
setDelayChargeStateAndLimit
Update the StateMachine and ChargePowerLimit channels.- Parameters:
state
- theDelayChargeState
limit
- the ChargePowerLimit
-
getAsZonedDateTime
-
getPredictedChargeStart
protected static Long getPredictedChargeStart(int targetTime, int capacity, int soc, Clock clock) throws OpenemsException Gets the predicted charge start time as epoch seconds.- Parameters:
targetTime
- target timecapacity
- capacity of the esssoc
- state of chargeclock
- clock- Returns:
- start of charging the battery as epoch seconds
- Throws:
OpenemsException
- on error
-