akkudoktoreos.devices.battery.Battery
- class akkudoktoreos.devices.battery.Battery(parameters: BaseBatteryParameters | None = None)
Bases:
DeviceBaseRepresents a battery device with methods to simulate energy charging and discharging.
- __init__(parameters: BaseBatteryParameters | None = None)
Methods
__init__([parameters])charge_energy(wh, hour[, relative_power])Charges energy into the battery.
Returns the current usable energy in the battery.
Calculates the current state of charge in percentage.
discharge_energy(wh, hour)Discharges energy from the battery.
reset()Resets the battery state to its initial values.
set_charge_allowed_for_hour(charge, hour)Sets the charge for a specific hour.
set_charge_per_hour(charge_array)Sets the charge values for each hour.
set_discharge_per_hour(discharge_array)Sets the discharge values for each hour.
setup(parameters)to_dict()Converts the object to a dictionary representation.
Attributes
Convenience method/ attribute to retrieve the EOS configuration data.
Convenience method/ attribute to retrieve the EOS devices simulation data.
Convenience method/ attribute to retrieve the EOS energy management system.
Compute the end datetime based on the start_datetime and hours.
Convenience method/ attribute to retrieve the EOS prediction data.
Compute the hours from start_datetime to end_datetime.
- __init__(parameters: BaseBatteryParameters | None = None)
- to_dict() dict[str, Any]
Converts the object to a dictionary representation.
- reset() None
Resets the battery state to its initial values.
- set_discharge_per_hour(discharge_array: ndarray) None
Sets the discharge values for each hour.
- set_charge_per_hour(charge_array: ndarray) None
Sets the charge values for each hour.
- set_charge_allowed_for_hour(charge: float, hour: int) None
Sets the charge for a specific hour.
- current_soc_percentage() float
Calculates the current state of charge in percentage.
- discharge_energy(wh: float, hour: int) tuple[float, float]
Discharges energy from the battery.
- charge_energy(wh: float | None, hour: int, relative_power: float = 0.0) tuple[float, float]
Charges energy into the battery.
- current_energy_content() float
Returns the current usable energy in the battery.
- property config: Any
Convenience method/ attribute to retrieve the EOS configuration data.
- Returns:
The configuration.
- Return type:
- property devices: Any
Convenience method/ attribute to retrieve the EOS devices simulation data.
- Returns:
The devices simulation.
- Return type:
- property ems: Any
Convenience method/ attribute to retrieve the EOS energy management system.
- Returns:
The energy management system.
- Return type:
EnergyManagementSystem
- property end_datetime: DateTime | None
Compute the end datetime based on the start_datetime and hours.
Ajusts the calculated end time if DST transitions occur within the prediction window.
- Returns:
The calculated end datetime, or None if inputs are missing.
- Return type:
Optional[DateTime]
- post_setup() None
- property prediction: Any
Convenience method/ attribute to retrieve the EOS prediction data.
- Returns:
The prediction.
- Return type:
- setup(parameters: DeviceParameters) None
- property total_hours: int | None
Compute the hours from start_datetime to end_datetime.
- Returns:
The duration hours, or None if either datetime is unavailable.
- Return type:
Optional[pendulum.period]