Skip to content

Wrong bounds when batteries have different bounds #1342

@llucax

Description

@llucax

Here's the bug:

# To satisfy the largest exclusion bounds in the set we need to
# provide the power defined by the largest bounds multiplied by the
# number of batteries in the set.
power_exclusion_upper_bound = Power.from_watts(
max(bounds.exclusion_upper for bounds in battery_metrics).as_watts()
* len(battery_metrics)
)
power_exclusion_lower_bound = Power.from_watts(
min(bounds.exclusion_lower for bounds in battery_metrics).as_watts()
* len(battery_metrics)
)

If one battery has exclusion bounds, it is applying those to all the batteries. So the total exclusion range becomes much bigger. For example, if only one battery had exclusion bounds, the rest of them should be usable normally.

Metadata

Metadata

Assignees

Labels

part:microgridAffects the interactions with the microgridtype:bugSomething isn't working

Type

No type

Projects

Status

To do

Relationships

None yet

Development

No branches or pull requests

Issue actions