Skip to content

consider non charging for consumers and update consumer state messages - #3840

Merged
LKuemmel merged 4 commits into
openWB:feature_consumerfrom
LKuemmel:consumer_dev
Aug 21, 2026
Merged

LKuemmel merged 4 commits into
openWB:feature_consumerfrom
LKuemmel:consumer_dev

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates control logic to better handle “non-charging” behavior for consumers and refines consumer state/status messaging, while consolidating shared load-handling utilities across chargepoints and consumers.

Changes:

  • Update consumer state_str messages based on ConsumerUsage and charging state.
  • Centralize “no charge” cleanup logic into a new control.load.no_charge() and wire it into prepare.
  • Generalize “consider less charging” load-management logic to apply to both chargepoints and consumers, and move charge-start timestamp handling into the shared Load protocol.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/control/process.py Updates consumer state messaging and consumer state update handling.
packages/control/prepare.py Switches “no charge” reset call to the new centralized load.no_charge().
packages/control/load.py Adds new shared no_charge() implementation for chargepoints + consumers.
packages/control/load_protocol.py Adds shared set_timestamp_charge_start() helper to the Load protocol.
packages/control/consumer/consumer.py Removes per-consumer timestamp handling (now shared via Load).
packages/control/chargepoint/chargepoint.py Removes chargepoint-local set_timestamp_charge_start() (now shared via Load).
packages/control/chargepoint/chargepoint_all.py Removes old AllChargepoints.no_charge() implementation.
packages/control/algorithm/common.py Applies “less charging” consideration uniformly to all loads, including consumers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 76 to 80
def process_on_time(self):
if self.data.get.charge_state:
now = timecheck.create_timestamp()
if self.data.set.timestamp_wrote_last_on_time is None:
self.data.set.timestamp_wrote_last_on_time = now
Comment thread packages/control/load.py
Comment on lines +17 to +33
for load in list(data.data.cp_data.values()) + list(data.data.consumer_data.values()):
try:
# Kein EV angesteckt
control_parameter = load.data.control_parameter
if (not load.data.get.plug_state or
# Kein EV, das Laden soll
# Kein EV, das auf das Ablaufen der Einschalt- oder Phasenumschaltverzögerung wartet
(control_parameter.state != ChargepointState.PERFORMING_PHASE_SWITCH and
control_parameter.state != ChargepointState.PHASE_SWITCH_DELAY and
control_parameter.state != ChargepointState.SWITCH_OFF_DELAY and
control_parameter.state != ChargepointState.SWITCH_ON_DELAY and
control_parameter.state != ChargepointState.NO_CHARGING_ALLOWED)):
continue
else:
break
except Exception:
log.exception("Fehler beim Bereinigen der Werte für Ladepunkt/Verbraucher "+load.num)
Comment thread packages/control/algorithm/common.py Outdated
log.debug(
f"LP {cp.num} lädt deutlich unter dem Sollstrom und wird nur mit {cp.data.get.currents}A berücksichtigt.")
return get_medium_charging_current(cp.data.get.currents)
def consider_less_charging_chargepoint_in_loadmanagement(load: Load, set_current: float) -> bool:
Comment thread packages/control/algorithm/common.py Outdated
Comment on lines +178 to +184
log.debug(f"LP {load.num} lädt deutlich unter dem Sollstrom und "
f"wird nur mit {load.data.get.currents}A berücksichtigt.")
return get_medium_charging_current(load.data.get.currents)
elif load.data.set.current_prev != 0:
log.debug(
f"LP {load.num} lädt nicht und wird nur mit {load.data.get.currents}A berücksichtigt.")
return get_medium_charging_current(load.data.get.currents)
Comment on lines +169 to +173
if isinstance(load, Chargepoint):
expected_current = set_current - load.data.set.charging_ev_data.ev_template.data.nominal_difference
else:
return set_current
expected_current = set_current - 1
expected_current = max(expected_current, 0)
Comment thread packages/control/load_protocol.py Outdated
submode_changed: bool
data: LoadData

def set_timestamp_charge_start(self):
@LKuemmel
LKuemmel merged commit 571b12e into openWB:feature_consumer Aug 21, 2026
1 check passed
LKuemmel added a commit that referenced this pull request Aug 24, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Aug 26, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Aug 28, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Sep 7, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit to benderl/core that referenced this pull request Sep 8, 2026
openWB#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Sep 9, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Sep 9, 2026
#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review
LKuemmel added a commit that referenced this pull request Sep 9, 2026
* draft

* draft

* fixes

* fixes

* Anlauferkennung, Betriebsmodus zurücksetzen, Befehle für Pläne (#3588)

* draft

* Anlauferkennung

* Betriebsmodus zurücksetzen

* ammend

* Anlauferkennung

* draft

* draft scheduled charging

* add scheduled und time plan commands for adding and removing

* flake8

* update config

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* review

* fix pytest

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* on time, fixes (#3612)

* on_time

* eco default price, typo

* on_time accessible via 1883 (#3626)

* on_time accessible via 1883

* fix

* Add Consumer tab and cards to koala web theme (#3630)

* add consumer tab/cards

* apply new design to consumer cards

* add consumer time on to consumer card

* fix consumer card CSS

* remove redundant placeholders

* imported and exported for consumers; daily, monthly log; daily yields; graph data (#3644)

* update module config

* imported and exported for consumers

* daily, monthly log

* daily yields

* graph data

* Consumer cards in carousel - small screen mobile view (#3637)

* Intergrate consumers in koala theme charts (#3672)

* Add consumer to energy flow chart

* Add consumer row to daily totals chart

* Add consumer total to history chart

* add consumer color to store

* Align legend category dropdowns

* Add consumer component to display flow chart (#3673)

* Add consumer component to display flow chart

* Add user management role

* energy percentage, set usage per json, several fixes (#3705)

* energy percentage, set usage per json

* consider min interval

* fixes

* pv

* fix

* pycheck, fix extra meter

* ammend

* fixes

* ammend

* fix

* switch interval elapsed

* flake8

* improve wait for start

* shelly, pytest (#3730)

* add shelly, flake8, pytest consumer chargemodes

* fix shelly

* existing pytests running

* review

* fix colors, lookup dict names and colors for consumers (#3736)

* fix colors, lookup dict names and colors for consumers

* review

* hide mode controls for consumer measurement only (#3715)

* update consumer-configuration-access (user management) (#3743)

* diagram colors, pytests, remove extra meters from log data (#3742)

* fix colors, lookup dict names and colors for consumers

* review

* extend tests

* add colors for yearly graph data

* remove extra meters from log data

* remove comment

* flake8

* ammend

* fix_merge

* switch mode on card

* update consumer button groups

* update message - data order in consumer card

* linting

* reapply lost changes from #3715

* usage type self controlled (#3775)

* usage type self controlled

* fix

* review

* review (#3776)

* calc on time (#3777)

* calc on time

* review

* pytest (#3786)

* fix pytest

* fixes, pytest

* review

* fix

* fixes (#3794)

* typo

* fix

* pytest

* Reworked IDM and Lambda consumer and add Ovum (#3737)

* IDM: send PV/Hausverbrauch/Batterie via GLT statt Leistungsvorgabe

* Lambda: PV-Überschuss statt power_limit an E-Manager senden

* Add OVUM CubeSpeicher/MPlus consumer module

* IDM: revert scaling factor, fix flake8 formatting

* flake8

* Rename send_grid_values to send_values in config.py

* Adjust surplus calculation to account for charging power

Include charging power in surplus calculation to avoid misreporting surplus to the heat pump.

* Update send_values function to send grid power

* Add Self_Controlled for IDM and Lambda

* flake8: fix syntax error and whitespace in consumer modules

Stray pasted line broke lambda_ consumer.py syntax; idm/lambda_/ovum
files had trailing whitespace on blank lines and missing EOF newlines.

* split PR: remove moduls except mqtt

* fix loadmanagement, clean up (#3819)

* clean up

* fix loadmanagement

* review

* review

* flake8

* fix versions

* fix merge error

* consider non charging for consumers and update consumer state messages (#3840)

* no charge for loads

* consider non charging for consumers and update consumer state messages

* flake8

* review

* fix rebase

* pass data object as parameter in set_power_limit methode (#3854)

* fix some type hints (#3866)

* fix reset of consumer state string (#3887)

* pass data object as parameter in set_power_limit methode, review (#3856)

* improve

* review: update comments

* flake8

* fix rebase

* Verbraucher: Fixes für  Löschen & Hinzufügen (#3909)

* fixes delete consumer, add consumer

* review

* Verbraucher: Fixes für Topics und Anlauferkennung (#3911)

* fixes

* type hint

* fix thread handling (#3912)

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: BrettS <[email protected]>
Co-authored-by: Brett-S-OWB <[email protected]>
Co-authored-by: Lutz Bender <[email protected]>
Co-authored-by: SeaSpotter <[email protected]>
Co-authored-by: benderl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants