components
frequenz.client.common.microgrid.components ¤
Defines the components that can be used in a microgrid.
Classes¤
frequenz.client.common.microgrid.components.ComponentCategory ¤
Bases: Enum
Possible types of microgrid component.
Source code in frequenz/client/common/microgrid/components/__init__.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
Attributes¤
BATTERY
class-attribute
instance-attribute
¤
A storage system for electrical energy, used by inverters.
CHP
class-attribute
instance-attribute
¤
A heat and power combustion plant (CHP stands for combined heat and power).
CONVERTER
class-attribute
instance-attribute
¤
A DC-DC converter.
CRYPTO_MINER
class-attribute
instance-attribute
¤
A crypto miner.
ELECTROLYZER
class-attribute
instance-attribute
¤
An electrolyzer for converting water into hydrogen and oxygen.
EV_CHARGER
class-attribute
instance-attribute
¤
A station for charging electrical vehicles.
GRID
class-attribute
instance-attribute
¤
The point where the local microgrid is connected to the grid.
HVAC
class-attribute
instance-attribute
¤
A Heating, Ventilation, and Air Conditioning (HVAC) system.
INVERTER
class-attribute
instance-attribute
¤
An electricity generator, with batteries or solar energy.
METER
class-attribute
instance-attribute
¤
A meter, for measuring electrical metrics, e.g., current, voltage, etc.
PRECHARGER
class-attribute
instance-attribute
¤
A precharge module.
Precharging involves gradually ramping up the DC voltage to prevent any potential damage to sensitive electrical components like capacitors.
While many inverters and batteries come equipped with in-built precharging mechanisms, some may lack this feature. In such cases, we need to use external precharging modules.
RELAY
class-attribute
instance-attribute
¤
A relay.
Relays generally have two states: open (connected) and closed (disconnected). They are generally placed in front of a component, e.g., an inverter, to control whether the component is connected to the grid or not.
UNSPECIFIED
class-attribute
instance-attribute
¤
An unknown component category.
Useful for error handling, and marking unknown components in a list of components with otherwise known categories.
VOLTAGE_TRANSFORMER
class-attribute
instance-attribute
¤
A voltage transformer.
Voltage transformers are used to step up or step down the voltage, keeping the power somewhat constant by increasing or decreasing the current. If voltage is stepped up, current is stepped down, and vice versa.
Note
Voltage transformers have efficiency losses, so the output power is always less than the input power.
Functions¤
from_proto
classmethod
¤
from_proto(
component_category: ValueType,
) -> ComponentCategory
Convert a protobuf ComponentCategory message to ComponentCategory enum.
PARAMETER | DESCRIPTION |
---|---|
component_category
|
protobuf enum to convert
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ComponentCategory
|
Enum value corresponding to the protobuf message. |
Source code in frequenz/client/common/microgrid/components/__init__.py
to_proto ¤
Convert a ComponentCategory enum to protobuf ComponentCategory message.
RETURNS | DESCRIPTION |
---|---|
ValueType
|
Enum value corresponding to the protobuf message. |
Source code in frequenz/client/common/microgrid/components/__init__.py
frequenz.client.common.microgrid.components.ComponentErrorCode ¤
Bases: Enum
All possible errors that can occur across all microgrid component categories.
Source code in frequenz/client/common/microgrid/components/__init__.py
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 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
|
Attributes¤
BATTERY_BLOCK_ERROR
class-attribute
instance-attribute
¤
Error indicating a battery block error.
BATTERY_CALIBRATION_NEEDED
class-attribute
instance-attribute
¤
Error indicating that battery calibration is needed.
BATTERY_CONTROLLER_ERROR
class-attribute
instance-attribute
¤
Error indicating a battery controller error.
BATTERY_IMBALANCE
class-attribute
instance-attribute
¤
Error indicating a battery system imbalance.
BATTERY_LOW_SOH
class-attribute
instance-attribute
¤
Error indicating a low state of health (SOH) detected in the battery.
BATTERY_RELAY_ERROR
class-attribute
instance-attribute
¤
Error indicating a battery relay error.
CONFIG_ERROR
class-attribute
instance-attribute
¤
Error indicating a configuration error related to the component.
EV_CHARGING_CABLE_INVALID
class-attribute
instance-attribute
¤
Error indicating an invalid electric vehicle (EV) cable.
EV_CHARGING_CABLE_LOCK_FAILED
class-attribute
instance-attribute
¤
Error indicating electric vehicle (EV) cable lock failure.
EV_CHARGING_CABLE_UNPLUGGED_FROM_EV
class-attribute
instance-attribute
¤
Error indicating electric vehicle (EV) cable was abruptly unplugged from the vehicle.
EV_CHARGING_CABLE_UNPLUGGED_FROM_STATION
class-attribute
instance-attribute
¤
EV_CHARGING_CABLE_UNPLUGGED_FROM_STATION = COMPONENT_ERROR_CODE_EV_CHARGING_CABLE_UNPLUGGED_FROM_STATION
Error indicating electric vehicle (EV) cable was abruptly unplugged from the charging station.
EV_CONSUMER_INCOMPATIBLE
class-attribute
instance-attribute
¤
Error indicating an incompatible electric vehicle (EV) plug.
EV_UNEXPECTED_PILOT_FAILURE
class-attribute
instance-attribute
¤
Error indicating unexpected pilot failure in an electric vehicle (EV) component.
FAULT_CURRENT
class-attribute
instance-attribute
¤
Error indicating fault current detected in the component.
FUSE_ERROR
class-attribute
instance-attribute
¤
Error indicating that the component's fuse has blown.
HARDWARE_INACCESSIBLE
class-attribute
instance-attribute
¤
Error indicating that the hardware of the component is inaccessible.
HIGH_HUMIDITY
class-attribute
instance-attribute
¤
Error indicating that the component is exposed to high humidity levels over the maximum rated value.
ILLEGAL_COMPONENT_STATE_CODE_REQUESTED
class-attribute
instance-attribute
¤
ILLEGAL_COMPONENT_STATE_CODE_REQUESTED = COMPONENT_ERROR_CODE_ILLEGAL_COMPONENT_STATE_CODE_REQUESTED
Error indicating an illegal state requested for the component.
INTERNAL
class-attribute
instance-attribute
¤
Error indicating an internal error within the component.
OVERCURRENT
class-attribute
instance-attribute
¤
Error indicating that the component is drawing more current than the maximum rated value.
OVERCURRENT_CHARGING
class-attribute
instance-attribute
¤
Error indicating that the component's consumption current is over the maximum rated value during charging.
OVERCURRENT_DISCHARGING
class-attribute
instance-attribute
¤
Error indicating that the component's production current is over the maximum rated value during discharging.
OVERTEMPERATURE
class-attribute
instance-attribute
¤
Error indicating that the component is operating over the maximum rated temperature.
OVERVOLTAGE
class-attribute
instance-attribute
¤
Error indicating that the component is operating over the maximum rated voltage.
PLAUSIBILITY_ERROR
class-attribute
instance-attribute
¤
Error indicating plausibility issues within the system involving this component.
PRECHARGE_ERROR
class-attribute
instance-attribute
¤
Error indicating that the component's precharge unit has failed.
RELAY_CYCLE_LIMIT_REACHED
class-attribute
instance-attribute
¤
Error indicating that the relays have been cycled for the maximum number of times.
SHORT_CIRCUIT
class-attribute
instance-attribute
¤
Error indicating a short circuit detected in the component.
SWITCH_ON_FAULT
class-attribute
instance-attribute
¤
Error indicating that the component could not be switched on.
UNAUTHORIZED
class-attribute
instance-attribute
¤
Error indicating that the component is unauthorized to perform the last requested action.
UNDERTEMPERATURE
class-attribute
instance-attribute
¤
Error indicating that the component is operating under the minimum rated temperature.
UNDERVOLTAGE
class-attribute
instance-attribute
¤
Error indicating that the component is operating under the minimum rated voltage.
UNDERVOLTAGE_SHUTDOWN
class-attribute
instance-attribute
¤
Error indicating system shutdown due to undervoltage involving this component.
UNKNOWN
class-attribute
instance-attribute
¤
The component is reporting an unknown or an undefined error, and the sender cannot parse the component error to any of the variants below.
UNSPECIFIED
class-attribute
instance-attribute
¤
Default value. No specific error is specified.
Functions¤
from_proto
classmethod
¤
from_proto(
component_error_code: ValueType,
) -> ComponentErrorCode
Convert a protobuf ComponentErrorCode message to ComponentErrorCode enum.
PARAMETER | DESCRIPTION |
---|---|
component_error_code
|
protobuf enum to convert
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ComponentErrorCode
|
Enum value corresponding to the protobuf message. |
Source code in frequenz/client/common/microgrid/components/__init__.py
to_proto ¤
Convert a ComponentErrorCode enum to protobuf ComponentErrorCode message.
RETURNS | DESCRIPTION |
---|---|
ValueType
|
Enum value corresponding to the protobuf message. |
Source code in frequenz/client/common/microgrid/components/__init__.py
frequenz.client.common.microgrid.components.ComponentId ¤
Bases: BaseId
A unique identifier for a microgrid component.
Source code in frequenz/client/common/microgrid/components/__init__.py
Attributes¤
Functions¤
__eq__ ¤
Check if this instance is equal to another object.
Equality is defined as being of the exact same type and having the same underlying ID.
Source code in frequenz/core/id.py
__hash__ ¤
__hash__() -> int
Return the hash of this instance.
The hash is based on the exact type and the underlying ID to ensure that IDs of different types but with the same numeric value have different hashes.
Source code in frequenz/core/id.py
__init__ ¤
__init__(id_: int) -> None
Initialize this instance.
PARAMETER | DESCRIPTION |
---|---|
id_
|
The numeric unique identifier.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the ID is negative. |
Source code in frequenz/core/id.py
__init_subclass__ ¤
Initialize a subclass, set its string prefix, and perform checks.
PARAMETER | DESCRIPTION |
---|---|
str_prefix
|
The string prefix for the ID type (e.g., "MID"). Must be unique across all ID types.
TYPE:
|
allow_custom_name
|
If True, bypasses the check that the class name must end with "Id". Defaults to False.
TYPE:
|
**kwargs
|
Forwarded to the parent's init_subclass.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
TypeError
|
If |
Source code in frequenz/core/id.py
__lt__ ¤
Check if this instance is less than another object.
Comparison is only defined between instances of the exact same type.
Source code in frequenz/core/id.py
__new__ ¤
Create a new instance of the ID class, only if it is a subclass of BaseId.
frequenz.client.common.microgrid.components.ComponentStateCode ¤
Bases: Enum
All possible states of a microgrid component.
Source code in frequenz/client/common/microgrid/components/__init__.py
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
Attributes¤
CHARGING
class-attribute
instance-attribute
¤
State when the component is actively consuming energy.
DISCHARGING
class-attribute
instance-attribute
¤
State when the component is actively producing or releasing energy.
ERROR
class-attribute
instance-attribute
¤
State when the component is in an error state and may need attention.
EV_CHARGING_CABLE_LOCKED_AT_EV
class-attribute
instance-attribute
¤
The EV charging cable is locked at the vehicle end, indicating that charging is active.
EV_CHARGING_CABLE_LOCKED_AT_STATION
class-attribute
instance-attribute
¤
The EV charging cable is locked at the charging station end, indicating readiness for charging.
EV_CHARGING_CABLE_PLUGGED_AT_EV
class-attribute
instance-attribute
¤
The EV charging cable is plugged into the vehicle.
EV_CHARGING_CABLE_PLUGGED_AT_STATION
class-attribute
instance-attribute
¤
The EV charging cable is plugged into the charging station.
EV_CHARGING_CABLE_UNPLUGGED
class-attribute
instance-attribute
¤
The Electric Vehicle (EV) charging cable is unplugged from the charging station.
OFF
class-attribute
instance-attribute
¤
State when the component has successfully switched off.
PRECHARGER_CLOSED
class-attribute
instance-attribute
¤
The precharger circuit is closed, allowing full current to flow to the main circuit.
PRECHARGER_OPEN
class-attribute
instance-attribute
¤
The precharger circuit is open, meaning it's not currently active.
PRECHARGER_PRECHARGING
class-attribute
instance-attribute
¤
The precharger is in a precharging state, preparing the main circuit for activation.
READY
class-attribute
instance-attribute
¤
State when the component is fully operational and ready for use.
RELAY_CLOSED
class-attribute
instance-attribute
¤
The relay is in a closed state, allowing current to flow.
RELAY_OPEN
class-attribute
instance-attribute
¤
The relay is in an open state, meaning no current can flow through.
STANDBY
class-attribute
instance-attribute
¤
State when the component is in standby mode, and not immediately ready for operation.
SWITCHING_OFF
class-attribute
instance-attribute
¤
State when the component is in the process of switching off.
SWITCHING_ON
class-attribute
instance-attribute
¤
State when the component is in the process of switching on from an off state.
UNKNOWN
class-attribute
instance-attribute
¤
State when the component is in an unknown or undefined condition.
This is used when the sender is unable to classify the component into any other state.
UNSPECIFIED
class-attribute
instance-attribute
¤
Default value when the component state is not explicitly set.
Functions¤
from_proto
classmethod
¤
from_proto(
component_state: ValueType,
) -> ComponentStateCode
Convert a protobuf ComponentStateCode message to ComponentStateCode enum.
PARAMETER | DESCRIPTION |
---|---|
component_state
|
protobuf enum to convert
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ComponentStateCode
|
Enum value corresponding to the protobuf message. |
Source code in frequenz/client/common/microgrid/components/__init__.py
to_proto ¤
Convert a ComponentStateCode enum to protobuf ComponentStateCode message.
RETURNS | DESCRIPTION |
---|---|
ValueType
|
Enum value corresponding to the protobuf message. |