-
Notifications
You must be signed in to change notification settings - Fork 117
eebus: fix failsafe #3277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
eebus: fix failsafe #3277
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,49 +44,50 @@ def __init__(self, config: StepwiseControlSetup): | |||||||||||||
|
|
||||||||||||||
| def setup(self) -> None: | ||||||||||||||
| with ModifyLoglevelContext(control_command_log, logging.DEBUG): | ||||||||||||||
| self.lpp_value = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.analog_input[AnalogInputMapping.LPP_VALUE.name] | ||||||||||||||
| lpp_value_prev = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.analog_input_prev[AnalogInputMapping.LPP_VALUE.name] | ||||||||||||||
| self.lpp_active = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.digital_input[DigitalInputMapping.LPP_ACTIVE.name] | ||||||||||||||
| lpp_active_prev = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.digital_input_prev[DigitalInputMapping.LPP_ACTIVE.name] | ||||||||||||||
| changed = True if self.lpp_value != lpp_value_prev or self.lpp_active != lpp_active_prev else False | ||||||||||||||
| if check_fault_state_io_device(self.config.configuration.io_device): | ||||||||||||||
| control_command_log.info("Fehler des IO-Geräts: EZA-Begrenzung kann nicht erfasst werden.") | ||||||||||||||
| else: | ||||||||||||||
| self.lpp_value = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.analog_input[AnalogInputMapping.LPP_VALUE.name] | ||||||||||||||
| lpp_value_prev = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.analog_input_prev[AnalogInputMapping.LPP_VALUE.name] | ||||||||||||||
| self.lpp_active = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.digital_input[DigitalInputMapping.LPP_ACTIVE.name] | ||||||||||||||
| lpp_active_prev = data.data.io_states[f"io_states{self.config.configuration.io_device}" | ||||||||||||||
| ].data.get.digital_input_prev[DigitalInputMapping.LPP_ACTIVE.name] | ||||||||||||||
| changed = True if self.lpp_value != lpp_value_prev or self.lpp_active != lpp_active_prev else False | ||||||||||||||
|
|
||||||||||||||
| max_output_inverter = 0 | ||||||||||||||
| for inverter in self.config.configuration.devices: | ||||||||||||||
| max_output_inverter += data.data.pv_data[f"pv{inverter['id']}"].data.config.max_ac_out | ||||||||||||||
| max_output_inverter = 0 | ||||||||||||||
| for inverter in self.config.configuration.devices: | ||||||||||||||
| max_output_inverter += data.data.pv_data[f"pv{inverter['id']}"].data.config.max_ac_out | ||||||||||||||
|
Comment on lines
+61
to
+62
|
||||||||||||||
| for inverter in self.config.configuration.devices: | |
| max_output_inverter += data.data.pv_data[f"pv{inverter['id']}"].data.config.max_ac_out | |
| for device in self.config.configuration.devices: | |
| if device["type"] == "inverter": | |
| max_output_inverter += data.data.pv_data[f"pv{device['id']}"].data.config.max_ac_out |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_component_name_by_id expects an int component id, but here a full device dict is passed. This will cause get_component_name_by_id to raise a ValueError when this log line runs (e.g. when LPP becomes active and changed is true). Pass device['id'] (and likely only log for device['type'] == 'inverter').
| control_command_log.info( | |
| f"Erzeugungsanlage {get_component_name_by_id(device)} " | |
| if device.get("type") != "inverter": | |
| continue | |
| control_command_log.info( | |
| f"Erzeugungsanlage {get_component_name_by_id(device['id'])} " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the IO device is in fault state you set
self.import_power_left = surplusand then subtractfixed_import_power, which can makeimport_power_left<= 0. Incontrol/loadmanagement.py:_limit_by_dimmingthe dimming limit is only applied whendimming_power_leftis truthy (if dimming_power_left:), so non-positive values will disable limiting entirely. To keep failsafe behavior, clamp the computed power to at least 0 (or return a non-None sentinel and adjust the caller) so the limiter still enforces a stop/reduction.