Skip to content

Feature: local_power pro counter - #4120

Merged
LKuemmel merged 2 commits into
openWB:masterfrom
AlexanderHa98:feature_local_power_per_counter
Oct 16, 2026
Merged

LKuemmel merged 2 commits into
openWB:masterfrom
AlexanderHa98:feature_local_power_per_counter

Conversation

@AlexanderHa98

Copy link
Copy Markdown
Contributor

No description provided.

@AlexanderHa98
AlexanderHa98 requested a balanced review from Copilot October 15, 2026 07:02

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.

🟡 Changes recommended

Counters outside the grid-counter subtree retain zero or stale local-power values.

1 open finding
What changed in this PR

Adds per-counter local_power values to the control model and MQTT handling.

Changes:

  • Stores calculated local power during home-consumption processing.
  • Adds the counter field, MQTT validation, and configuration topic entry.
File Description
packages/​helpermodules/​update_config.py Adds the local-power topic pattern.
packages/​helpermodules/​setdata.py Validates local-power values as floats.
packages/​control/​counter.py Defines the local-power field.
packages/​control/​counter_all/​counter_all.py Stores calculated local power per visited counter.

🧠 Review effort: Balanced


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

home_consumption = 0.0
not_home_consumption = 0.0
local_power = self._get_local_power_from_counter(element)
data.data.counter_data[f"counter{element['id']}"].data.get.local_power = local_power

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.

🔵 Needs a closer look

Descendants of failed counters can retain stale local-power readings when their subtree is skipped.

1 open finding

🧠 Review effort: Balanced

@LKuemmel
LKuemmel merged commit d65f3aa into openWB:master Oct 16, 2026
1 check passed
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.

3 participants