Skip to content

Kostal Plenticore: add holdcharge implementation#30853

Merged
andig merged 1 commit into
evcc-io:masterfrom
iseeberg79:feat/plenticore_holdCharge
Jun 15, 2026
Merged

Kostal Plenticore: add holdcharge implementation#30853
andig merged 1 commit into
evcc-io:masterfrom
iseeberg79:feat/plenticore_holdCharge

Conversation

@iseeberg79

Copy link
Copy Markdown
Contributor

This implementation adds the holdCharge feature to Kostal Plenticore devices, as introduced in #27906.
It utilizes register 1038 to set a charge power limit (in watts), effectively preventing charging while still allowing discharge if required.

From the Kostal Modbus documentation:

Register Reg. dec. Description Unit Type Lenth Access Mode
0x40E 1038 Battery max. charge power limit, absolute W Float 2 RW 0x03/0x10
0x410 1040 Battery max. discharge power limit, absolute W Float 2 RW 0x03/0x10

The existing defer logic is used to ensure registers written are properly reset when switching modes.

@iseeberg79

Copy link
Copy Markdown
Contributor Author

@deadrabbit87 fyi

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="templates/definition/meter/kostal-plenticore-gen2.yaml" line_range="135" />
<code_context>
           error: ErrNotAvailable
           {{- end }}
+      - case: 4 # holdcharge
+        set:
+          source: const
+          value: 0 # W
</code_context>
<issue_to_address>
**issue (bug_risk):** The nested `set:` key will override the outer `set` mapping, likely breaking the intended behavior.

Using multiple `set:` keys or nesting them incorrectly can cause earlier definitions (like `source: const / value: 0`) to be ignored by YAML/template processors, so the `holdcharge` behavior may not run as intended. Please ensure the modbus write (if needed) is either a separate list item (another `- set:`) or expressed under a different key at the same level, so both operations are handled as expected.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread templates/definition/meter/kostal-plenticore-gen2.yaml
@andig andig added the devices Specific device support label Jun 14, 2026
@andig andig merged commit 3842c3d into evcc-io:master Jun 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants