Index
frequenz.client.common.microgrid.electrical_components ¤
Defines the electrical components that can be used in a microgrid.
Classes¤
frequenz.client.common.microgrid.electrical_components.ElectricalComponentCategory ¤
Bases: Enum
Possible types of microgrid electrical component.
Source code in src/frequenz/client/common/microgrid/electrical_components/_category.py
22 23 24 25 26 27 28 29 30 31 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 131 132 133 134 | |
Attributes¤
BATTERY
class-attribute
instance-attribute
¤
A storage system for electrical energy, used by inverters.
BREAKER
class-attribute
instance-attribute
¤
A relay, used for switching electrical circuits on and off.
CAPACITOR_BANK
class-attribute
instance-attribute
¤
A capacitor bank, used for power factor correction and reactive power compensation.
CHP
class-attribute
instance-attribute
¤
A heat and power combustion plant (CHP stands for combined heat and power).
CONVERTER
class-attribute
instance-attribute
¤
An electricity converter, e.g., a DC-DC converter.
CRYPTO_MINER
class-attribute
instance-attribute
¤
A device for mining cryptocurrencies.
ELECTROLYZER
class-attribute
instance-attribute
¤
A device for splitting water into hydrogen and oxygen using electricity.
EV_CHARGER
class-attribute
instance-attribute
¤
A station for charging electrical vehicles.
GRID_CONNECTION_POINT
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.
PLC
class-attribute
instance-attribute
¤
A programmable logic controller (PLC).
POWER_TRANSFORMER
class-attribute
instance-attribute
¤
A transformer, used for changing the voltage of electrical circuits.
PRECHARGER
class-attribute
instance-attribute
¤
A precharger, used for preparing electrical circuits for switching on.
STATIC_TRANSFER_SWITCH
class-attribute
instance-attribute
¤
A static transfer switch, used for switching between power sources.
STEAM_BOILER
class-attribute
instance-attribute
¤
A steam boiler, used to generate steam for heating or industrial processes.
UNINTERRUPTIBLE_POWER_SUPPLY
class-attribute
instance-attribute
¤
An uninterruptible power supply (UPS), used to provide backup power.
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.
WIND_TURBINE
class-attribute
instance-attribute
¤
A wind turbine, used to generate electricity from wind energy.
Functions¤
from_proto
classmethod
¤
from_proto(
component_category: ValueType,
) -> ElectricalComponentCategory
Convert a protobuf ElectricalComponentCategory message to enum.
| PARAMETER | DESCRIPTION |
|---|---|
component_category
|
protobuf enum to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ElectricalComponentCategory
|
Enum value corresponding to the protobuf message. |
Source code in src/frequenz/client/common/microgrid/electrical_components/_category.py
to_proto ¤
Convert a ElectricalComponentCategory enum to protobuf message.
| RETURNS | DESCRIPTION |
|---|---|
ValueType
|
Enum value corresponding to the protobuf message. |
Source code in src/frequenz/client/common/microgrid/electrical_components/_category.py
frequenz.client.common.microgrid.electrical_components.ElectricalComponentDiagnosticCode ¤
Bases: Enum
All diagnostics that can occur across electrical component categories.
Source code in src/frequenz/client/common/microgrid/electrical_components/_diagnostic_code.py
22 23 24 25 26 27 28 29 30 31 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 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 220 221 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 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
Attributes¤
ARC_FAULT
class-attribute
instance-attribute
¤
Arc fault detected in the component.
BATTERY_BLOCK_ERROR
class-attribute
instance-attribute
¤
Battery block error detected.
BATTERY_CALIBRATION_NEEDED
class-attribute
instance-attribute
¤
Battery calibration is needed.
BATTERY_CONTROLLER_ERROR
class-attribute
instance-attribute
¤
Battery controller error detected.
BATTERY_IMBALANCE
class-attribute
instance-attribute
¤
Battery system imbalance detected.
BATTERY_LOW_SOH
class-attribute
instance-attribute
¤
Low state of health (SOH) detected in the battery.
BATTERY_RELAY_ERROR
class-attribute
instance-attribute
¤
Battery relay error detected.
CONFIG_ERROR
class-attribute
instance-attribute
¤
Configuration error related to the component.
EV_CHARGING_CABLE_INVALID
class-attribute
instance-attribute
¤
Invalid electric vehicle (EV) cable.
EV_CHARGING_CABLE_LOCK_FAILED
class-attribute
instance-attribute
¤
Electric vehicle (EV) cable lock failure.
EV_CHARGING_CABLE_UNPLUGGED_FROM_EV
class-attribute
instance-attribute
¤
EV_CHARGING_CABLE_UNPLUGGED_FROM_EV = ELECTRICAL_COMPONENT_DIAGNOSTIC_CODE_EV_CHARGING_CABLE_UNPLUGGED_FROM_EV
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 = ELECTRICAL_COMPONENT_DIAGNOSTIC_CODE_EV_CHARGING_CABLE_UNPLUGGED_FROM_STATION
Electric vehicle (EV) cable was abruptly unplugged from the charging station.
EV_CONSUMER_INCOMPATIBLE
class-attribute
instance-attribute
¤
Incompatible electric vehicle (EV) plug.
EV_UNEXPECTED_PILOT_FAILURE
class-attribute
instance-attribute
¤
Unexpected pilot failure in an electric vehicle (EV) component.
EXCESS_LEAKAGE_CURRENT
class-attribute
instance-attribute
¤
Excess leakage current was detected in the component.
FAN_FAULT
class-attribute
instance-attribute
¤
Fan fault detected in the component.
FAULT_CURRENT
class-attribute
instance-attribute
¤
Fault current detected in the component.
FUSE_ERROR
class-attribute
instance-attribute
¤
The component's fuse has blown.
GRID_ABNORMAL
class-attribute
instance-attribute
¤
The grid is in an abnormal condition not covered by other grid-specific diagnostic codes.
GRID_DISCONNECTED
class-attribute
instance-attribute
¤
The grid is disconnected.
GRID_OVERFREQUENCY
class-attribute
instance-attribute
¤
The grid frequency is over the maximum rated value.
GRID_OVERVOLTAGE
class-attribute
instance-attribute
¤
The grid voltage is over the maximum rated value.
GRID_UNDERFREQUENCY
class-attribute
instance-attribute
¤
The grid frequency is under the minimum rated value.
GRID_UNDERVOLTAGE
class-attribute
instance-attribute
¤
The grid voltage is under the minimum rated value.
GRID_VOLTAGE_IMBALANCE
class-attribute
instance-attribute
¤
Voltage imbalance between grid phases.
GROUND_FAULT
class-attribute
instance-attribute
¤
Ground fault detected in the component.
HARDWARE_FAULT
class-attribute
instance-attribute
¤
Hardware fault detected in the component.
HARDWARE_INACCESSIBLE
class-attribute
instance-attribute
¤
The hardware of the component is inaccessible.
HIGH_HUMIDITY
class-attribute
instance-attribute
¤
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 = ELECTRICAL_COMPONENT_DIAGNOSTIC_CODE_ILLEGAL_COMPONENT_STATE_CODE_REQUESTED
An illegal state was requested for the component.
INTERNAL
class-attribute
instance-attribute
¤
An internal error within the component.
INVERTER_DC_OVERVOLTAGE
class-attribute
instance-attribute
¤
The inverter DC bus voltage is over the maximum rated value.
INVERTER_DC_UNDERVOLTAGE
class-attribute
instance-attribute
¤
The inverter DC bus voltage is under the minimum rated value.
LOW_SYSTEM_INSULATION_RESISTANCE
class-attribute
instance-attribute
¤
LOW_SYSTEM_INSULATION_RESISTANCE = ELECTRICAL_COMPONENT_DIAGNOSTIC_CODE_LOW_SYSTEM_INSULATION_RESISTANCE
Low system insulation resistance detected in the component.
OVERCURRENT
class-attribute
instance-attribute
¤
The component is drawing more current than the maximum rated value.
OVERCURRENT_CHARGING
class-attribute
instance-attribute
¤
The component's consumption current is over the maximum rated value during charging.
OVERCURRENT_DISCHARGING
class-attribute
instance-attribute
¤
The component's production current is over the maximum rated value during discharging.
OVERTEMPERATURE
class-attribute
instance-attribute
¤
The component is operating over the maximum rated temperature.
OVERVOLTAGE
class-attribute
instance-attribute
¤
The component is operating over the maximum rated voltage.
PLAUSIBILITY_ERROR
class-attribute
instance-attribute
¤
Plausibility issues within the system involving this component.
PRECHARGE_ERROR
class-attribute
instance-attribute
¤
The component's precharge unit has failed.
PROTECTIVE_SHUTDOWN
class-attribute
instance-attribute
¤
The component performed a protective shutdown.
PV_FAULT
class-attribute
instance-attribute
¤
Fault in the photovoltaic (PV) system.
PV_GROUND_FAULT
class-attribute
instance-attribute
¤
Ground fault detected on the photovoltaic (PV) side.
PV_REVERSAL_POLARITY
class-attribute
instance-attribute
¤
Reverse polarity condition detected on the photovoltaic (PV) side.
PV_REVERSE_CURRENT
class-attribute
instance-attribute
¤
Reverse current condition detected on the photovoltaic (PV) side.
PV_UNDERPERFORMANCE
class-attribute
instance-attribute
¤
The photovoltaic (PV) system is underperforming.
RELAY_CYCLE_LIMIT_REACHED
class-attribute
instance-attribute
¤
The relays have been cycled for the maximum number of times.
SHORT_CIRCUIT
class-attribute
instance-attribute
¤
Short circuit detected in the component.
SWITCH_ON_FAULT
class-attribute
instance-attribute
¤
The component could not be switched on.
UNAUTHORIZED
class-attribute
instance-attribute
¤
The component is unauthorized to perform the last requested action.
UNDERTEMPERATURE
class-attribute
instance-attribute
¤
The component is operating under the minimum rated temperature.
UNDERVOLTAGE
class-attribute
instance-attribute
¤
The component is operating under the minimum rated voltage.
UNKNOWN
class-attribute
instance-attribute
¤
The component is reporting an unknown or an undefined error.
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,
) -> ElectricalComponentDiagnosticCode
Convert a protobuf ElectricalComponentDiagnosticCode message to enum.
| PARAMETER | DESCRIPTION |
|---|---|
component_error_code
|
protobuf enum to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ElectricalComponentDiagnosticCode
|
Enum value corresponding to the protobuf message. |
Source code in src/frequenz/client/common/microgrid/electrical_components/_diagnostic_code.py
to_proto ¤
Convert a ElectricalComponentDiagnosticCode enum to protobuf message.
| RETURNS | DESCRIPTION |
|---|---|
ValueType
|
Enum value corresponding to the protobuf message. |
Source code in src/frequenz/client/common/microgrid/electrical_components/_diagnostic_code.py
frequenz.client.common.microgrid.electrical_components.ElectricalComponentId ¤
Bases: BaseId
A unique identifier for a microgrid electrical component.
Source code in src/frequenz/client/common/microgrid/electrical_components/_ids.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.electrical_components.ElectricalComponentStateCode ¤
Bases: Enum
All possible states of a microgrid electrical component.
Source code in src/frequenz/client/common/microgrid/electrical_components/_state_code.py
22 23 24 25 26 27 28 29 30 31 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
Attributes¤
CHARGING
class-attribute
instance-attribute
¤
The component is actively consuming energy.
DISCHARGING
class-attribute
instance-attribute
¤
The component is actively producing or releasing energy.
ERROR
class-attribute
instance-attribute
¤
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
¤
EV_CHARGING_CABLE_LOCKED_AT_STATION = ELECTRICAL_COMPONENT_STATE_CODE_EV_CHARGING_CABLE_LOCKED_AT_STATION
The EV charging cable is locked at the charging station end, ready 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
¤
EV_CHARGING_CABLE_PLUGGED_AT_STATION = ELECTRICAL_COMPONENT_STATE_CODE_EV_CHARGING_CABLE_PLUGGED_AT_STATION
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
¤
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
¤
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
¤
The component is in standby mode, and not immediately ready for operation.
SWITCHING_OFF
class-attribute
instance-attribute
¤
The component is in the process of switching off.
SWITCHING_ON
class-attribute
instance-attribute
¤
The component is in the process of switching on from an off state.
UNAVAILABLE
class-attribute
instance-attribute
¤
The component is not available for use.
UNKNOWN
class-attribute
instance-attribute
¤
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,
) -> ElectricalComponentStateCode
Convert a protobuf ElectricalComponentStateCode message to enum.
| PARAMETER | DESCRIPTION |
|---|---|
component_state
|
protobuf enum to convert
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ElectricalComponentStateCode
|
Enum value corresponding to the protobuf message. |
Source code in src/frequenz/client/common/microgrid/electrical_components/_state_code.py
to_proto ¤
Convert a ElectricalComponentStateCode enum to protobuf message.
| RETURNS | DESCRIPTION |
|---|---|
ValueType
|
Enum value corresponding to the protobuf message. |