Skip to content

EEBus: apply §14a/LPC dimming to OHPCF heat pump#31346

Closed
andig wants to merge 1 commit into
masterfrom
feat/ohpcf-dimmer
Closed

EEBus: apply §14a/LPC dimming to OHPCF heat pump#31346
andig wants to merge 1 commit into
masterfrom
feat/ohpcf-dimmer

Conversation

@andig

@andig andig commented Jun 30, 2026

Copy link
Copy Markdown
Member

The OHPCF heat pump charger (#30636) ignored an active EnWG §14a / LPC consumption limit: it only honoured PV surplus, never the grid-side cap evcc receives as a controllable system.

This implements api.Dimmer on the OHPCF charger, the same hook the loadpoint already uses to push the HEMS dim state down to a charger:

  • Dim(true) pauses (or aborts, if the compressor is not pausable) the optional consumption; Dim(false) releases it and resumes per the on/off intent.
  • Dimmed() reports the current dim state.
  • The control gate now drives the compressor on only when enabled and not dimmed (controlEnable), so a dim always wins over surplus.
  • The template gains the dim capability.

go build, go vet, charger + template tests, gofmt and golangci-lint all pass.

🤖 Generated with Claude Code

Implement api.Dimmer on the OHPCF charger so an active EnWG §14a / LPC consumption limit pauses or aborts the optional compressor consumption and releases it again. Dim overrides the on/off intent in the control gate. Add the dim capability to the template.
@andig andig added enhancement New feature or request infrastructure Basic functionality heating Heating labels Jun 30, 2026

@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 left some high level feedback:

  • In TestOHPCFDimGate, consider avoiding direct mutation of internal fields like c.dimmed and instead exercise the public API (e.g. Dim) or a small helper constructor to keep tests resilient to internal refactors.
  • In Dim, you could early-return when the requested dim state matches the current c.dimmed value to avoid unnecessary apply() calls and external interactions when there is no effective state change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `TestOHPCFDimGate`, consider avoiding direct mutation of internal fields like `c.dimmed` and instead exercise the public API (e.g. `Dim`) or a small helper constructor to keep tests resilient to internal refactors.
- In `Dim`, you could early-return when the requested `dim` state matches the current `c.dimmed` value to avoid unnecessary `apply()` calls and external interactions when there is no effective state change.

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.

@andig

andig commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Superseded by #31348: dimming now uses the EG LPC consumption limit (like the EEBus meter) instead of OHPCF schedule/pause, and is based on feat/eebus so it can also add the dim capability to the wolfvaillant template.

🤖 Generated with Claude Code

@andig andig closed this Jun 30, 2026
@andig andig deleted the feat/ohpcf-dimmer branch June 30, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request heating Heating infrastructure Basic functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant