component
frequenz.sdk.microgrid.component
¤
Microgrid component abstractions.
This package provides classes to operate con microgrid components.
Classes¤
frequenz.sdk.microgrid.component.BatteryData
dataclass
¤
Bases: ComponentData
A wrapper class for holding battery data.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
Attributes¤
capacity: float
instance-attribute
¤
The capacity of the battery in Wh (Watt-hour).
power_exclusion_lower_bound: float
instance-attribute
¤
Lower exclusion bound for battery power in watts.
This is the lower limit of the range within which power requests are not allowed for the battery.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
power_exclusion_upper_bound: float
instance-attribute
¤
Upper exclusion bound for battery power in watts.
This is the upper limit of the range within which power requests are not allowed for the battery.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
power_inclusion_lower_bound: float
instance-attribute
¤
Lower inclusion bound for battery power in watts.
This is the lower limit of the range within which power requests are allowed for the battery.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
power_inclusion_upper_bound: float
instance-attribute
¤
Upper inclusion bound for battery power in watts.
This is the upper limit of the range within which power requests are allowed for the battery.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
soc: float
instance-attribute
¤
Battery's overall SoC in percent (%).
soc_lower_bound: float
instance-attribute
¤
The SoC below which discharge commands will be blocked by the system, in percent (%).
soc_upper_bound: float
instance-attribute
¤
The SoC above which charge commands will be blocked by the system, in percent (%).
temperature: float
instance-attribute
¤
The (average) temperature reported by the battery, in Celcius (°C).
Functions¤
from_proto(raw)
classmethod
¤
Create BatteryData from a protobuf message.
PARAMETER | DESCRIPTION |
---|---|
raw |
raw component data as decoded from the wire.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
BatteryData
|
Instance of BatteryData created from the protobuf message. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
frequenz.sdk.microgrid.component.Component
dataclass
¤
Metadata for a single microgrid component.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component.py
Functions¤
is_valid()
¤
Check if this instance contains valid data.
RETURNS | DESCRIPTION |
---|---|
bool
|
|
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component.py
frequenz.sdk.microgrid.component.ComponentCategory
¤
Bases: Enum
Possible types of microgrid component.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component.py
frequenz.sdk.microgrid.component.ComponentData
dataclass
¤
Bases: ABC
A private base class for strongly typed component data classes.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
Attributes¤
component_id: int
instance-attribute
¤
The ID identifying this component in the microgrid.
raw: Optional[microgrid_pb.ComponentData] = field(default=None, init=False)
class-attribute
instance-attribute
¤
Raw component data as decoded from the wire.
timestamp: datetime
instance-attribute
¤
The timestamp of when the data was measured.
Functions¤
from_proto(raw)
abstractmethod
classmethod
¤
Create ComponentData from a protobuf message.
PARAMETER | DESCRIPTION |
---|---|
raw |
raw component data as decoded from the wire.
TYPE:
|
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
frequenz.sdk.microgrid.component.ComponentMetricId
¤
Bases: Enum
An enum representing the various metrics available in the microgrid.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component.py
frequenz.sdk.microgrid.component.EVChargerCableState
¤
Bases: Enum
Cable states of an EV Charger.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_states.py
Functions¤
from_pb(evc_state)
classmethod
¤
Convert a protobuf CableState value to EVChargerCableState enum.
PARAMETER | DESCRIPTION |
---|---|
evc_state |
protobuf cable state to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
EVChargerCableState
|
Enum value corresponding to the protobuf message. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_states.py
frequenz.sdk.microgrid.component.EVChargerComponentState
¤
Bases: Enum
Component State of an EV Charger.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_states.py
Functions¤
from_pb(evc_state)
classmethod
¤
Convert a protobuf ComponentState value to EVChargerComponentState enum.
PARAMETER | DESCRIPTION |
---|---|
evc_state |
protobuf component state to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
EVChargerComponentState
|
Enum value corresponding to the protobuf message. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_states.py
frequenz.sdk.microgrid.component.EVChargerData
dataclass
¤
Bases: ComponentData
A wrapper class for holding ev_charger data.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
Attributes¤
active_power: float
instance-attribute
¤
The 3-phase active power, in Watts, represented in the passive sign convention. +ve current means consumption, away from the grid. -ve current means supply into the grid.
cable_state: EVChargerCableState
instance-attribute
¤
The state of the ev charger's cable.
component_state: EVChargerComponentState
instance-attribute
¤
The state of the ev charger.
current_per_phase: Tuple[float, float, float]
instance-attribute
¤
AC current in Amperes (A) for phase/line 1,2 and 3 respectively. +ve current means consumption, away from the grid. -ve current means supply into the grid.
voltage_per_phase: Tuple[float, float, float]
instance-attribute
¤
The AC voltage in Volts (V) between the line and the neutral wire for phase/line 1,2 and 3 respectively.
Functions¤
from_proto(raw)
classmethod
¤
Create EVChargerData from a protobuf message.
PARAMETER | DESCRIPTION |
---|---|
raw |
raw component data as decoded from the wire.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
EVChargerData
|
Instance of EVChargerData created from the protobuf message. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
frequenz.sdk.microgrid.component.InverterData
dataclass
¤
Bases: ComponentData
A wrapper class for holding inverter data.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
Attributes¤
active_power: float
instance-attribute
¤
The 3-phase active power, in Watts, represented in the passive sign convention. +ve current means consumption, away from the grid. -ve current means supply into the grid.
active_power_exclusion_lower_bound: float
instance-attribute
¤
Lower exclusion bound for inverter power in watts.
This is the lower limit of the range within which power requests are not allowed for the inverter.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
active_power_exclusion_upper_bound: float
instance-attribute
¤
Upper exclusion bound for inverter power in watts.
This is the upper limit of the range within which power requests are not allowed for the inverter.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
active_power_inclusion_lower_bound: float
instance-attribute
¤
Lower inclusion bound for inverter power in watts.
This is the lower limit of the range within which power requests are allowed for the inverter.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
active_power_inclusion_upper_bound: float
instance-attribute
¤
Upper inclusion bound for inverter power in watts.
This is the upper limit of the range within which power requests are allowed for the inverter.
See frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds
and
frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds
for more
details.
Functions¤
from_proto(raw)
classmethod
¤
Create InverterData from a protobuf message.
PARAMETER | DESCRIPTION |
---|---|
raw |
raw component data as decoded from the wire.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
InverterData
|
Instance of InverterData created from the protobuf message. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
frequenz.sdk.microgrid.component.InverterType
¤
Bases: ComponentType
Enum representing inverter types.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component.py
frequenz.sdk.microgrid.component.MeterData
dataclass
¤
Bases: ComponentData
A wrapper class for holding meter data.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/component/_component_data.py
Attributes¤
active_power: float
instance-attribute
¤
The 3-phase active power, in Watts, represented in the passive sign convention. +ve current means consumption, away from the grid. -ve current means supply into the grid.
current_per_phase: Tuple[float, float, float]
instance-attribute
¤
AC current in Amperes (A) for phase/line 1,2 and 3 respectively. +ve current means consumption, away from the grid. -ve current means supply into the grid.
frequency: float
instance-attribute
¤
The AC power frequency in Hertz (Hz).
voltage_per_phase: Tuple[float, float, float]
instance-attribute
¤
The ac voltage in volts (v) between the line and the neutral wire for phase/line 1,2 and 3 respectively.
Functions¤
from_proto(raw)
classmethod
¤
Create MeterData from a protobuf message.
PARAMETER | DESCRIPTION |
---|---|
raw |
raw component data as decoded from the wire.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
MeterData
|
Instance of MeterData created from the protobuf message. |