Skip to content

EEBus: add OHPCF heat pump compressor flexibility#30636

Merged
andig merged 28 commits into
masterfrom
feat/eebus-ohpcf
Jun 29, 2026
Merged

EEBus: add OHPCF heat pump compressor flexibility#30636
andig merged 28 commits into
masterfrom
feat/eebus-ohpcf

Conversation

@andig

@andig andig commented Jun 8, 2026

Copy link
Copy Markdown
Member

Stacked on #30633 (eebus-go @dev bump) and based on the upstream OHPCF use case from enbility/eebus-go#223.

OHPCF (Optimization of Self-Consumption by Heat Pump Compressor Flexibility) lets evcc, acting as CEM, observe and control the optional power consumption a remote heat pump compressor announces.

Read (server/eebus):

  • bumps eebus-go to the branch that adds usecases/cem/ohpcf and registers the use case on the CEM entity (reachable via CustomerEnergyManagement).
  • on OHPCF data update events, reads and logs the announced flexibility: availability, requested and maximum power, process state, pausable/stoppable flags, minimal run and pause durations.

Charger (charger/eebus-ohpcf.go):

  • exposes the compressor as a switchable load (api.Charger). Status/Enabled are derived from the power consumption process state: running → charging, available/scheduled/paused → connected, else → disconnected.
  • OHPCF has no power setpoint, so MaxCurrent converts the loadpoint's allotted current to power (using the active phases from loadpoint.Controller) and schedules the optional consumption to start now once the available surplus covers the compressor's requested power, pausing or aborting it otherwise. The schedule/resume/pause/stop decision is centralised in one guarded helper so an unchanged state issues no repeated commands.
  • CurrentPower reports the announced power while running.

The control decision logic (state × surplus → action) and the status/enabled mapping are unit tested. The use-case wiring is exercised by the existing eebus integration handshake test.

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

andig added 2 commits June 8, 2026 14:14
The dev branch reworks remote service trust around ship-go's ServiceIdentity
and splits the load control write approval event into separate limit and
device configuration events.

NewConfiguration now takes the device categories as well as an optional SHIP
Pairing config and ring buffer persistence; evcc trusts remote services by
their configured SKI via RegisterRemoteService and does not use SHIP Pairing,
so both are passed as nil.

RegisterRemoteSKI/UnregisterRemoteSKI/RemoteServiceForSKI/CancelPairingWithSKI
are replaced by their ServiceIdentity-based equivalents, and the service
reader callbacks switch from raw SKI strings to ServiceIdentity, gaining the
new SHIP Pairing auto-trust events as no-ops.

Device configuration writes were applied automatically up to v0.7.0 but now
require explicit approval, so the LPC/LPP handlers approve all pending
configuration writes to preserve the previous behaviour.
Bumps eebus-go to the branch adding the cem/ohpcf use case and registers
it on the CEM entity alongside the other use cases.

OHPCF lets evcc, acting as CEM, observe the optional power consumption a
remote heat pump compressor announces. The use case is wired read-only:
its data update events are read and logged (availability, requested and
maximum power, process state, pausable/stoppable flags and the minimal
run and pause durations) and the use case is reachable for on-demand reads
via CustomerEnergyManagement. Scheduling, aborting, pausing and resuming a
consumption process are intentionally left out for now.

@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 reviewed your changes and they look great!


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 added the infrastructure Basic functionality label Jun 8, 2026
Adds a charger that exposes a remote heat pump compressor announcing
optional power consumption (OHPCF) as a switchable load.

Status, enabled state and control are derived from the compressor's power
consumption process state: running maps to charging, available/scheduled/
paused to connected, everything else to disconnected. OHPCF has no power
setpoint, so MaxCurrent instead converts the loadpoint's allotted current
to power (using the active phases) and schedules the optional consumption
to start now once the available surplus covers the compressor's requested
power, pausing or aborting it otherwise.
@andig andig changed the title EEBus: add read-only OHPCF (heat pump compressor flexibility) support EEBus: OHPCF heat pump compressor flexibility (read + charger control) Jun 8, 2026
CurrentPower now reports the heat pump's actual measured power consumption
through the MPC (Monitoring of Power Consumption) use case instead of the
announced OHPCF estimate, capturing the MPC entity from its support update
and returning api.ErrNotAvailable when no measurement is available, matching
the eebus meter implementation.
Comment thread server/eebus/eebus.go Outdated
andig and others added 4 commits June 8, 2026 20:57
meter/eebus.go inlined the eebusapi.ErrDataNotAvailable to api.ErrNotAvailable
mapping in eebusReadValue and readPhases. Both now use the existing
eebus.WrapError helper so the mapping lives in a single place.
The OHPCF charger now reads and controls the heat pump compressor directly,
so the server-side diagnostic logging is no longer needed. OHPCF use case
events are forwarded straight to registered devices via ucCallback, like the
other use cases.
@andig andig changed the title EEBus: OHPCF heat pump compressor flexibility (read + charger control) EEBus: add OHPCF heat pump compressor flexibility Jun 8, 2026
Base automatically changed from chore/eebus-go-dev to master June 15, 2026 07:55
@github-actions github-actions Bot added the stale Outdated and ready to close label Jun 22, 2026
@andig

andig commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

@github-actions github-actions Bot removed the stale Outdated and ready to close label Jun 23, 2026

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Done. I merged origin/master into this branch and resolved the conflicts in commit 64412ef.

Copilot finished work on behalf of andig June 23, 2026 09:47
@andig

andig commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

Closed due to missing feedback

@andig andig closed this Jun 23, 2026
@TheEragon

Copy link
Copy Markdown

Why close this? This could be useful for Vaillant heat pumps, if there is enough surplus we could heat the hot water to a higher than standard temperature

@andig

andig commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

Why close this

In case you've missed it: #30636 (comment)

@CiNcH83

CiNcH83 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Did not realize that this is already in a state worth testing. In fact I am already failing to configure it...

It looks like there is a new charger (OHPCF) for that? Can't find it in the UI (list of heating devices) though. So I tried YAML...

meters:
- name: arotherm_mpc
  type: eebus
  ski: 4bb4ddc3cc35facb2262ac8afde5b3cfea4b0689
  usage: charge

chargers:
- name: arotherm_ohpcf
  type: eebus-ohpcf
  ski: 4bb4ddc3cc35facb2262ac8afde5b3cfea4b0689

loadpoints:
- title: aroTHERM plus
  charger: arotherm_ohpcf
  meter: arotherm_mpc
  mode: pv

Does not seem to work either...
ohpcf_trace.log

Probably can't add EEBUS twice..

@TheEragon

TheEragon commented Jun 24, 2026

Copy link
Copy Markdown

Did not realize that this is already in a state worth testing. In fact I am already failing to configure it...

It looks like there is a new charger (OHPCF) for that? Can't find it in the UI (list of heating devices) though. So I tried YAML...

meters:
- name: arotherm_mpc
  type: eebus
  ski: 4bb4ddc3cc35facb2262ac8afde5b3cfea4b0689
  usage: charge

chargers:
- name: arotherm_ohpcf
  type: eebus-ohpcf
  ski: 4bb4ddc3cc35facb2262ac8afde5b3cfea4b0689

loadpoints:
- title: aroTHERM plus
  charger: arotherm_ohpcf
  meter: arotherm_mpc
  mode: pv

Does not seem to work either... ohpcf_trace.log

I think this might be related to this bug

@CiNcH83

CiNcH83 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The following config works:

chargers:
- name: arotherm_ohpcf
  type: eebus-ohpcf
  ski: 4bb4ddc3cc35facb2262ac8afde5b3cfea4b0689

loadpoints:
- title: aroTHERM plus
  charger: arotherm_ohpcf
  mode: pv

Including MPC:
image

So how do I test the feature now? DHW has just been loaded. So there is nothing to do for the heat pump right now.

One thing that will sorely be missed opposed to the sensoNET charger is the DHW temperature display. There is however a HVAC use-case (MDT - Monitoring of DHW Temperature) which covers that.

@CiNcH83

CiNcH83 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I now also enabled EEBUS Energy Management in Vaillant:
image

Guess we have to wait and see what happens now? Does it make sense to remove any DHW time windows to see whether DHW loading starts anyway? Or check whether it overloads to T+5?

@andig

andig commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

You can add integrateddevice capability, let me check on MDA. We announce flexibility for „now“ (really like FLOA) but its probably bot a good fit.

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Not a lot of sun today. So I started a fast charge. I did set the Vaillant upper bound to 52 °C and max. Temp. in evcc to 50 °C. So the fast charge (or Boost) was stopped at 50 °C by evcc. So far so good. evcc went into the Disconnected state afterwards and does not show the temperature bar anymore:
image

Shouldn't it go into Standby state? Not sure whether evcc re-evaluates demands through OHPCF in the Disconnected state?

evcc.log

Sorry for the logs getting bigger. But I am now heading towards long-term testing.

[EDIT]
The charge may very well have been stopped by Vaillant as well. I think it stops at 50 °C as well when being set to 52 °C because it will overshoot otherwise.

@andig

andig commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Fixed

Map every connected compressor state except running to standby (B); a stopped
or completed boost no longer flips the loadpoint to disconnected and hides the
temperature bar. Disconnected (A) is now reserved for a lost entity.
@andig

andig commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Lets merge this, I think it's good enough for broader testing. I really appreciate your time trying this. Didn't think it would work as expected...

@andig andig enabled auto-merge (squash) June 29, 2026 09:52
@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

One thing that should probably be done is that the OHPCF heat pump becomes a generic heating device in the UI list.

@andig andig merged commit 1005f07 into master Jun 29, 2026
9 checks passed
@andig andig disabled auto-merge June 29, 2026 09:54
@andig andig deleted the feat/eebus-ohpcf branch June 29, 2026 09:54
@andig

andig commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

One thing that should probably be done is that the OHPCF heat pump becomes a generic heating device in the UI list.

@naltatis is that possible?

@andig

andig commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

We should probably also mention Vaillant specifically.

@TheEragon

Copy link
Copy Markdown

Just a note that this won't work for Vaillant unless have HEMS defined.

Any reply from Vaillant by any chance @CiNcH83?

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Yes. They would like to debug it. Currently trying to reproduce by disabling hems (EnergyGuard).

@andig

andig commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

We‘d also still need to fix dimming. Right now- once the heatpump becomes a loadpoint but doesn‘t have current control I don‘t think we‘d be doing anything useful, but that needs be verified.

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
image

Currently stuck in "Ready to heat..". Should be normal though as there is no demand...

evcc.log

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

We‘d also still need to fix dimming. Right now- once the heatpump becomes a loadpoint but doesn‘t have current control I don‘t think we‘d be doing anything useful, but that needs be verified.

OK. Will try to perform a dim when I finished looking at EnergyGuard with Vaillant and controlbox is up and running again...

@naltatis

Copy link
Copy Markdown
Member

One thing that should probably be done is that the OHPCF heat pump becomes a generic heating device in the UI list.

@naltatis is that possible?

This can be done with

group: heatinggeneric

See the demo-heatpump template.
https://github.com/evcc-io/evcc/blob/master/templates/definition/charger/demo-heatpump.yaml#L2

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

I outsourced the Vaillant topic here.

@CiNcH83

CiNcH83 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

With regards to dimming, I will test that tomorrow, now that debugging with Vaillant has been finished.

What I can say already is that the OHPCF config tile does not mention dimming:
image

@CiNcH83

CiNcH83 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Another thing I just realized is that temperature display via MDT does not give me fractions. 36,5 becomes 37 °C.

@andig

andig commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Did you check if the log even has fractions?

@CiNcH83

CiNcH83 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

There are indeed only integers:

{"number":37}

EDIT: scale value is always 0.

@CiNcH83

CiNcH83 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Dimming...

power reduction arrives...
image

... and boost has entirely been stopped.

Trace log is 60MB... [LINK]

It looks as if evcc still uses the configured 3,5 kW min. power to determine when to boost?

@CiNcH83

CiNcH83 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Re-boost seems to work...

image

@andig

andig commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

It looks as if evcc still uses the configured 3,5 kW min. power to determine when to boost?

Can you remove that config?

@CiNcH83

CiNcH83 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

How would I do that?

image

@andig

andig commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Enter 0.1? Not nice, but...

@andig

andig commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

and boost has entirely been stopped.

Dimming is actually tricky. We dim meters by setting the consumption limit using LPCs. We're also dimming heatpumps using SG Ready. We're currently not dimming controllable chargers since those would usually just be reduced in current/power. Now, since OHPCF only controls flexible power consumption, we should also add dimming similar to SG Ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Basic functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants