Skip to content

Navigation Menu

Sign in
Sign up

Conversation with Claude about heatpump integration in HA #432

RienduPre started this conversation in General
Discussion options

@traktore-org
See my Claude conversation below, can you share your point of view. FYI I have a Nibe heatpump which is integrated in HA

Me: Linking to solar panels (Growatt) — higher heating temperature with solar surplus
Claude: Let me first check which entities are available.
[searched for growatt, nibe, solar, grott entities]
I found everything needed. You have:

number.vvm_320_r_offset — Heat pump heating offset (currently 0°C)
number.sem_heat_pump_boost_offset — SEM Heat pump boost offset (currently +2°C)
sensor.sem_surplus_total_w — Current solar surplus
binary_sensor.sem_solar_active — Solar active

But actually SEM already has this built in — number.sem_heat_pump_boost_offset is exactly for this purpose. SEM already automatically raises the heating temperature with solar surplus.
Two questions before I create an automation:

Do you know if SEM is already actively using the heat pump boost, or is it disabled?
Do you want to set the boost via the Nibe offset (e.g. +3°C at >1000W surplus) as an addition to SEM?

Me: Do it via SEM
Claude: [searched for SEM heat pump entities]
SEM has no separate switch for the heat pump boost — it works via two entities:

number.sem_heat_pump_boost_offset (currently +2°C) — the extra temperature SEM adds when boosting
sensor.sem_heat_pump_sg_ready_state — SG-Ready signal (currently 2 = normal, 3 = boost)

The best approach is an automation that raises the boost offset with sufficient solar surplus: (automation yaml)
Do you want to create this, and if so — what thresholds suit your situation? (>2000W boost to +5°C, reset to +2°C at <500W)
Me: But can SEM not do this itself, without an automation?
Claude: Yes, SEM probably has this built in. Check the SEM configuration in HA under Settings → Devices & Services → SEM for an option like:

"Heat pump solar boost"
SG-Ready settings
Heat pump priority with surplus

SEM is designed to manage exactly these things automatically. The number.sem_heat_pump_boost_offset and sensor.sem_heat_pump_sg_ready_state entities exist for a reason — SEM already uses them internally.
Do you want me to check the SEM configuration entities to see what's already set up?
Me: Yes
Claude: [searched SEM entities]
SEM only has three entities for the heat pump and no configuration option to automatically activate the boost based on surplus. The sensor.sem_heat_pump_sg_ready_state is at 2 (normal) and does not change automatically.
This means SEM does not manage the heat pump boost on its own — an automation is still needed for that. Do you want me to create it?

You must be logged in to vote

Replies: 20 comments

Comment options

Thanks for sharing the full Claude transcript — that's actually really useful, because the AI's diagnosis was partially right and partially wrong, and the gap is interesting.

What's correct in the Claude conversation: your sensor.sem_heat_pump_sg_ready_state is indeed stuck at 2 (normal) and won't change on its own. The observation is right.

What's wrong: the inferred cause — "SEM does not manage the heat pump boost on its own" — is not the design. SEM has a full HeatPumpController class with SG-Ready BLOCKED / NORMAL / BOOST / FORCE_ON state machine, climate-setpoint boost via boost_offset, and registration with the SurplusController to receive surplus events. It's been there since v1.2 and is fully exercised by the test suite (including the new audit-telemetry tests in v1.7.0 beta.24).

The real issue is your specific configuration. The registration in __init__.py:947 requires both SG-Ready relay entities to be configured:

if hp_relay1 and hp_relay2:
 hp_device = HeatPumpController(... climate_entity_id=...)
 coordinator._surplus_controller.register_device(hp_device)

That gate is a holdover from when SEM only supported Viessmann / Stiebel Eltron / Vaillant SG-Ready hardware. Your Nibe (nibe_heatpump) doesn't expose SG-Ready binary inputs in HA — it gives you a climate entity and a setpoint offset (number.vvm_320_r_offset), but no relays. So the gate fails → HeatPumpController is never registered → SurplusController never drives it → sg_ready_state is forever 2.

The HeatPumpController itself already handles climate-only mode internally (we verified this via the #421 audit telemetry's relay_path = no_relays_configured branch in beta.24). The only blocker is that registration gate one layer above.

Fix tracked in #437. Shipping as v1.7.1-beta.1. After that, your Nibe will only need heat_pump_climate_entity configured (no relays) and SEM will auto-boost it on surplus through your existing number.sem_heat_pump_boost_offset setting.

Three things will change in v1.7.1:

  1. Registration gate relaxed — accepts (relay1 AND relay2) OR climate_entity
  2. Config flow gets a description making the two paths explicit + validation
  3. Dashboard gets a heat pump status row showing mode (SG-Ready / Climate-only), boost state, and current setpoint

Closing this discussion when the fix lands. Thanks for the careful AI conversation — it surfaced a real design gap.

You must be logged in to vote
0 replies
Comment options

Fix shipped in v1.7.1-beta.1 (commit 05412f3, on develop).

Issue #437 (which tracked the fix) is now closed with full implementation details + acceptance criteria. Highlights:

  • Backend__init__.py registration gate now accepts climate-only configs. Logs climate-only setpoint boost on startup so you can confirm it picked up in your HA log.
  • Config flow — the Heat Pump step description now explicitly explains the two paths (SG-Ready relays vs climate-only setpoint boost). Form validation rejects half-configured SG-Ready setups.
  • Dashboard — new Heat Pump section on the Control card with mode (Climate-only), SG-Ready state, and the boost-offset stepper. Auto-hides when no heat pump is registered.

What to do when v1.7.1-beta.1 lands on HACS

  1. Upgrade SEM to v1.7.1-beta.1 in HACS
  2. Restart HA
  3. Open Settings → SEM → Configure → Heat Pump
  4. Set ONLY heat_pump_climate_entity to your Nibe climate target (e.g. climate.vvm_320_heating_circuit). Leave both relay fields empty.
  5. Save

Within ~10 seconds the SEM coordinator will start driving climate.set_temperature on your Nibe via the number.sem_heat_pump_boost_offset value. When solar surplus exceeds the threshold, the setpoint goes up by your configured offset; when surplus drops, it returns to normal.

sensor.sem_heat_pump_sg_ready_state will now actually mutate — 2 (NORMAL) → 3 (BOOST) → back to 2. You can also enable the (default-disabled) binary_sensor.sem_heat_pump_solar_boost to track boost cycles directly.

What you can do today as feedback

The v1.7.1 betas land on develop first and propagate to HACS once cut as releases. Until then you can:

  • Watch this repo to get a notification when v1.7.1-beta.1 ships to HACS
  • Comment here once you've tested it on your Nibe with feedback on the UX (is the dashboard section clear? does the config flow description make the two-path choice obvious?)
  • Report any edge cases — your number.vvm_320_r_offset is a SEPARATE Nibe offset entity from the climate.set_temperature SEM will drive. If both interact unexpectedly (e.g. additive offsets), that's interesting telemetry for a v1.7.1 follow-up.

Thanks again for the careful Claude conversation that surfaced this — discussion-driven scope discovery is exactly the loop we want.

Closing this discussion as resolved when you confirm the fix works on your install. If you'd rather keep it open as a how-to reference, that's also fine.

You must be logged in to vote
0 replies
Comment options

See the follow discussion I had on this subject with Claude:

Me: Is my Nibe heat pump SG-Ready?

Claude: (searched web for Nibe VVM320 SG-Ready)

Yes, the Nibe VVM320 is fully SG-Ready compatible. The technical manual confirms the VVM320 supports four SG-Ready states — exactly what SEM needs.

On the VVM320 you have two potential-free contact inputs (SG1 and SG2) that control the four states:

SG1 | SG2 | State -- | -- | -- Open | Open | Normal Closed | Open | Blocked Open | Closed | Boost (raised temperature) Closed | Closed | Force-on (maximum heating)

Physical location: Open the VVM320 and find the AA3 circuit board (input circuit board). The AUX inputs are labeled AUX1 and AUX2 — these are the SG-Ready contacts.

Wiring:

Shelly 1 Mini #1 (I + O) ──── AUX1 on AA3
Shelly 1 Mini #2 (I + O) ──── AUX2 on AA3

Then configure in SEM as relay1 and relay2 and it works automatically.


Me: Can the SG1 and 2 switches also be controlled via software?

Claude: (searched and found MODBUS registers)

Yes, this can be done via software. The Nibe has MODBUS registers for SG-Ready:

  • Register 3032 — enable "SG ready via API"
  • Register 6008 — set SG-Ready mode (1-4)

Let me check if those registers are already available as entities in your installation.

(searched HA entities)

Everything is already there — no physical relays needed! You already have:

  • switch.sg_ready_heating_48282 — SG-Ready heating (on)
  • switch.sg_ready_hot_water_48284 — SG-Ready hot water (on)
  • switch.sg_ready_cooling_48283 — SG-Ready cooling (on)
  • sensor.sg_ready_input_a_44878 — SG input A (currently 0)
  • sensor.sg_ready_input_b_44879 — SG input B (currently 0)
  • sensor.state_sg_ready_44874 — Current SG-Ready state

This means the Nibe already reads SG-Ready signals via software through the nibegw/MODBUS connection. No Shellys needed for the heat pump.

You only need to configure the two input sensors as relay1 and relay2 in SEM and SEM will control them directly via software. Shall I configure that?


Me: Yes, configure it

Claude: The SEM heat pump configuration cannot be set via MCP tools — this must be done through the HA UI config flow. Go to Settings → Devices & Services → Solar Energy Management → Configure, find the Heat Pump step and fill in:

  • Relay 1: switch.sg_ready_heating_48282
  • Relay 2: switch.sg_ready_hot_water_48284
  • Climate entity: leave empty
  • Priority: set higher number than EV (e.g. 2)

Can you open the SEM configuration page and check if a Heat Pump step is present?


Me: Yes

Claude: Fill in:

  • Relay 1: switch.sg_ready_heating_48282
  • Relay 2: switch.sg_ready_hot_water_48284
  • Climate entity: leave empty
  • Power sensor: look for a heat pump power sensor
  • Priority: set to 2

What do you see on screen?


Me: I filled it in like this now

Claude: Good. What did you fill in for power sensor and priority?


Me: Heat Pump Total Power and priority 2

Claude: Perfect. Save and check if SEM recognizes the heat pump — go to Settings → Devices & Services → Solar Energy Management and check if a heat pump device or entity is visible. Or check the SEM dashboard under the Control tab — the heat pump should now appear in the surplus distribution.

Do you see it appear?


Me: No, can you see it in HA?

Claude: (searched HA)

Yes, SEM has recognized the heat pump. The entities are there:

  • sensor.sem_heat_pump_modenormal
  • sensor.sem_heat_pump_sg_ready_state2 (normal) ✅
  • number.sem_heat_pump_boost_offset2°C

SEM is already managing the heat pump. The mode is "normal" because there is currently no sufficient solar surplus. Once the surplus reaches the threshold, SEM will automatically switch to BOOST and sensor.sem_heat_pump_sg_ready_state will go to 3.

Nothing more to do — it's working.

Me: Is my Nibe heat pump SG-Ready?

Claude: (searched web for Nibe VVM320 SG-Ready)

Yes, the Nibe VVM320 is fully SG-Ready compatible. The technical manual confirms the VVM320 supports four SG-Ready states — exactly what SEM needs.

On the VVM320 you have two potential-free contact inputs (SG1 and SG2) that control the four states:

SG1 | SG2 | State -- | -- | -- Open | Open | Normal Closed | Open | Blocked Open | Closed | Boost (raised temperature) Closed | Closed | Force-on (maximum heating)

Physical location: Open the VVM320 and find the AA3 circuit board (input circuit board). The AUX inputs are labeled AUX1 and AUX2 — these are the SG-Ready contacts.

Wiring:

Shelly 1 Mini #1 (I + O) ──── AUX1 on AA3
Shelly 1 Mini #2 (I + O) ──── AUX2 on AA3

Then configure in SEM as relay1 and relay2 and it works automatically.


Me: Can the SG1 and 2 switches also be controlled via software?

Claude: (searched and found MODBUS registers)

Yes, this can be done via software. The Nibe has MODBUS registers for SG-Ready:

  • Register 3032 — enable "SG ready via API"
  • Register 6008 — set SG-Ready mode (1-4)

Let me check if those registers are already available as entities in your installation.

(searched HA entities)

Everything is already there — no physical relays needed! You already have:

  • switch.sg_ready_heating_48282 — SG-Ready heating (on)
  • switch.sg_ready_hot_water_48284 — SG-Ready hot water (on)
  • switch.sg_ready_cooling_48283 — SG-Ready cooling (on)
  • sensor.sg_ready_input_a_44878 — SG input A (currently 0)
  • sensor.sg_ready_input_b_44879 — SG input B (currently 0)
  • sensor.state_sg_ready_44874 — Current SG-Ready state

This means the Nibe already reads SG-Ready signals via software through the nibegw/MODBUS connection. No Shellys needed for the heat pump.

You only need to configure the two input sensors as relay1 and relay2 in SEM and SEM will control them directly via software. Shall I configure that?


Me: Yes, configure it

Claude: The SEM heat pump configuration cannot be set via MCP tools — this must be done through the HA UI config flow. Go to Settings → Devices & Services → Solar Energy Management → Configure, find the Heat Pump step and fill in:

  • Relay 1: switch.sg_ready_heating_48282
  • Relay 2: switch.sg_ready_hot_water_48284
  • Climate entity: leave empty
  • Priority: set higher number than EV (e.g. 2)

Can you open the SEM configuration page and check if a Heat Pump step is present?


Me: Yes

Claude: Fill in:

  • Relay 1: switch.sg_ready_heating_48282
  • Relay 2: switch.sg_ready_hot_water_48284
  • Climate entity: leave empty
  • Power sensor: look for a heat pump power sensor
  • Priority: set to 2

What do you see on screen?


Me: I filled it in like this now

Claude: Good. What did you fill in for power sensor and priority?


Me: Heat Pump Total Power and priority 2

Claude: Perfect. Save and check if SEM recognizes the heat pump — go to Settings → Devices & Services → Solar Energy Management and check if a heat pump device or entity is visible. Or check the SEM dashboard under the Control tab — the heat pump should now appear in the surplus distribution.

Do you see it appear?


Me: No, can you see it in HA?

Claude: (searched HA)

Yes, SEM has recognized the heat pump. The entities are there:

  • sensor.sem_heat_pump_modenormal
  • sensor.sem_heat_pump_sg_ready_state2 (normal) ✅
  • number.sem_heat_pump_boost_offset2°C

SEM is already managing the heat pump. The mode is "normal" because there is currently no sufficient solar surplus. Once the surplus reaches the threshold, SEM will automatically switch to BOOST and sensor.sem_heat_pump_sg_ready_state will go to 3.

Nothing more to do — it's working.

You must be logged in to vote
0 replies
Comment options

Thanks for sharing the full follow-up — that's a really useful data point, because it surfaces a misconfiguration risk that SEM should help users avoid. The other Claude was right about the existence of software SG-Ready on the Nibe, but the specific wiring it suggested is incorrect, and your current SEM config will not actually boost the heat pump on surplus. Here's the analysis.

What those Nibe switches actually are

The entities switch.sg_ready_heating_48282 / switch.sg_ready_hot_water_48284 / switch.sg_ready_cooling_48283 are per-system SG-Ready enable flags in the Nibe firmware. They tell the heat pump "is SG-Ready allowed to influence my heating circuit / DHW / cooling at all". They are not the two-input SG1/SG2 pair that encodes the four SG-Ready states.

How SEM's SG-Ready protocol actually works

devices/heat_pump_controller.py:34-39 treats relay1+relay2 as a 2-bit binary encoding of the four states:

SGReadyState.BLOCKED: (relay1=OFF, relay2=OFF) # 00 — utility block
SGReadyState.NORMAL: (relay1=OFF, relay2=ON) # 01 — normal operation
SGReadyState.BOOST: (relay1=ON, relay2=OFF) # 10 — surplus boost
SGReadyState.FORCE_ON: (relay1=ON, relay2=ON) # 11 — force max

This matches the SG-Ready standard's two-contact protocol on hardware like Viessmann / Stiebel Eltron / Vaillant.

What's happening with your current config

When SEM tries to boost on solar surplus:

  • BOOST → switch.sg_ready_heating_48282 ON (enables heating SG-Ready ✓)
  • BOOST → switch.sg_ready_hot_water_48284 OFF (disables hot-water SG-Ready ✗)

When SEM goes back to NORMAL:

  • NORMAL → switch.sg_ready_heating_48282 OFF (disables heating SG-Ready ✗)
  • NORMAL → switch.sg_ready_hot_water_48284 ON (enables hot-water SG-Ready)

So instead of telling your Nibe "boost now / normal now / block now", SEM toggles which SG-Ready subsystem is enabled — never actually setting the SG-Ready state. The heat pump will never actually receive a BOOST signal from this configuration.

The "sg_ready_state = 2 (normal)" report you see is SEM's internal state, not the Nibe's response. SEM has registered the controller (gate passed because both "relays" are set), but the SG-Ready commands aren't reaching the heat pump in a way Nibe understands.

What I'd recommend instead

Two clean options, both fully supported by SEM:

Option A — Climate-only mode (simplest, available in v1.7.1-beta.1)

The fix we just shipped covers exactly your case. Once v1.7.1-beta.1 lands on HACS:

  1. Settings → SEM → Configure → Heat Pump
  2. Leave both relays empty
  3. Set heat_pump_climate_entity = your Nibe heating-circuit climate entity (likely climate.vvm_320_heating_circuit or similar)
  4. Save

SEM will then drive climate.set_temperature with your boost_offset value (default +2°C) when surplus is available. No relays needed, no MODBUS hacks. Sleek and matches how Nibe is designed to be controlled from HA.

Option B — Real SG-Ready via MODBUS Register 6008 (advanced)

If you specifically want the four-state SG-Ready protocol (BLOCKED / NORMAL / BOOST / FORCE_ON), you need to map SEM's sensor.sem_heat_pump_sg_ready_state (1–4) to a nibe_heatpump.set_register service call writing register 6008. That's a 5-line HA automation:

automation:
 - alias: SEM SG-Ready → Nibe Register 6008
 trigger:
 - platform: state
 entity_id: sensor.sem_heat_pump_sg_ready_state
 action:
 - service: nibe_heatpump.set_register
 data:
 register: 6008
 value: "{{ trigger.to_state.state | int }}"

Pre-requisite: Register 3032 ("SG ready via API") must be enabled once (you can set this via nibe_heatpump.set_register with register: 3032, value: 1).

In SEM's config, leave relays empty AND climate empty. The HeatPumpController won't auto-register, but SEM's _hp_status.sg_ready_state is still computed in the surplus controller — your automation reads it and drives the MODBUS write. (Note: this is functional, but I'm flagging it as the "advanced" path because it relies on you keeping the automation in sync with future SEM behaviour changes; the climate-only path in Option A is the one we test and ship regression coverage for.)

Action items for you

  1. Stop the current config from doing harm — open Settings → SEM → Configure → Heat Pump and either:
    • Clear both relay fields immediately (controller deregisters, no more bogus toggles), or
    • Leave it as-is if your heat pump hasn't actually responded to the SEM toggles yet (the Nibe is probably ignoring the enable-flag thrash, but worth checking your heat pump logs for unexpected mode changes)
  2. Wait for v1.7.1-beta.1 on HACS, then Option A is a 30-second config change

I'll also open a small follow-up to make the SEM config flow detect this specific Nibe-style misconfiguration and warn the user — "these look like SG-Ready enable flags, not 2-bit state contacts; did you mean to use a climate.* entity instead?" That's a v1.7.1-beta.3 candidate.

This is exactly the kind of feedback loop the audit telemetry was meant to enable. Thanks for being a thoughtful tester.

You must be logged in to vote
0 replies
Comment options

Correction to my previous comment

Re-reading the transcript you shared, my last reply was over-confident. I assumed your current SEM relay1/relay2 are the Nibe enable-flag switches (switch.sg_ready_heating_48282 / switch.sg_ready_hot_water_48284), but the other Claude actually presented three SG-Ready paths, and I don't know which one you ended up applying. Let me lay them out cleanly so we can pinpoint the actual gap before recommending anything.

The three paths from your transcript

Path 1 — Hardware Shellys → AUX1/AUX2 on AA3 (✓ valid)

Shelly 1 Mini #1 (I + O) ──── AUX1 on AA3
Shelly 1 Mini #2 (I + O) ──── AUX2 on AA3

These are the proper SG1/SG2 contact pair the SG-Ready standard expects. If relay1 = switch.shelly1_mini_1 and relay2 = switch.shelly1_mini_2, then SEM's 2-bit encoding works correctly — BOOST flips both physical contacts the way the Nibe expects to see them. My previous comment glossed over this option entirely. It's a fully valid SEM setup.

If this is your current config, then the only real bug is the registration gate (v1.7.1-beta.1's #437 fix) — and even that fix may not be needed because the relays are configured, so the gate already passes today. In that case sg_ready_state should already be mutating, and the symptom is something else.

Path 2 — Direct MODBUS Register 6008 (✓ valid, advanced)

Five-line HA automation writing the 1–4 state directly. Requires Register 3032 enabled once. SEM's job is just to compute the state; the automation transports it.

Path 3 — switch.sg_ready_heating_48282 / switch.sg_ready_hot_water_48284 as relay1/relay2 (✗ broken)

This is the configuration I analyzed in my previous comment. The full analysis there is correct if this is what you have — those switches are per-subsystem enable flags, not the SG1/SG2 pair, so SEM ends up toggling which subsystem has SG-Ready enabled instead of setting the SG-Ready state.

What I'd like to confirm

Could you check Settings → SEM → Configure → Heat Pump and tell me the exact entity IDs you have in:

  • heat_pump_relay1_entity
  • heat_pump_relay2_entity
  • heat_pump_climate_entity (if set)

That tells us which of the three paths you actually applied, and the right fix:

  • Path 1 (Shellys) → already correct; symptom must come from elsewhere (probably an SG-Ready setting in the Nibe itself, e.g. Register 3032 not enabled, or the AUX inputs not yet defined as SG1/SG2 in the Nibe service menu)
  • Path 2 (MODBUS automation) → relays empty, the automation lives in HA; v1.7.1-beta.1 with relays empty + climate also empty is the structurally cleanest version
  • Path 3 (enable-flag switches) → clear those entries, switch to climate-only mode once v1.7.1-beta.1 lands

Sorry for the half-baked diagnosis

The misconfiguration detector I floated for v1.7.1-beta.3 is still useful, but only if Path 3 is actually a problem in the wild — which we can only know once you confirm what's configured. Holding off on opening that issue until then.

You must be logged in to vote
0 replies
Comment options

Visual side-by-side: Path 3 vs Path A in SEM v1.7.1-beta.3

To make the misconfig question concrete, I reproduced both options on HA-TEST using template-switch helpers that mirror the exact Nibe entity names (switch.sg_ready_heating_48282, switch.sg_ready_hot_water_48284, switch.sg_ready_cooling_48283, plus a climate.vvm_320_heating_circuit and input_number.vvm_320_r_offset). The sim YAML is committed to the repo at docs/screenshots/nibe-sim/ (regenerable, hardware-free).

Path 3 — switch.sg_ready_heating_48282 + switch.sg_ready_hot_water_48284 as relays (the misconfig)

Config flow → Heat Pump step:

Control tab dashboard (Heat Pump section visible because the controller registered):

SEM happily registers the controller (gate passes — both relays set). But when SEM goes to BOOST, it toggles heating_48282 ON and hot_water_48284 OFF — flipping which subsystem has SG-Ready enabled, never actually setting the SG-Ready state. So sensor.sem_heat_pump_sg_ready_state mutates in SEM's internal state machine, but the heat pump receives a meaningless signal.

Path A — climate.vvm_320_heating_circuit only (the v1.7.1-beta.1 fix)

Config flow → Heat Pump step: Both relay fields empty, climate populated.

Control tab dashboard:

The controller now drives climate.set_temperature via boost_offset on surplus — actually raising the heating curve on your Nibe. No SG-Ready involved.

What got shipped in v1.7.1-beta.3 (just published)

Two fixes:

  1. The feat(heat_pump): climate-only registration path for non-SG-Ready heat pumps (Nibe, Mitsubishi, Daikin) #437 climate-only gate (already in beta.1) — Nibe and other climate-entity-only heat pumps now register.
  2. A follow-up binary_sensor.sem_heat_pump_registered bug found while reproducing your case — the binary sensor was wired to a check that always returned False, so the dashboard auto-hide was keeping the Heat Pump section hidden even after a correct climate-only config. Without this fix, beta.1 would have worked for you internally but you'd never have seen the dashboard section confirming it. Fixed in coordinator/coordinator.py, 4 new regression tests pin the behaviour.

Concrete diagnosis path for your install

When v1.7.1-beta.3 lands on HACS, please check Settings → SEM → Configure → Heat Pump and tell me the exact two entity IDs in heat_pump_relay1_entity / heat_pump_relay2_entity (or whether they're now empty).

  • If they're switch.sg_ready_heating_48282 / switch.sg_ready_hot_water_48284 → that's Path 3, please clear them and either (a) set heat_pump_climate_entity = climate.<your nibe heating-circuit entity> for Path A, or (b) keep them all empty and run the MODBUS Register 6008 automation from my earlier comment for the real four-state SG-Ready protocol.
  • If they're switch.shelly1_mini_* (i.e. you actually wired hardware Shellys to AUX1/AUX2 on the AA3) → that's Path 1, already correct. The original "stuck at 2" symptom must come from the Nibe side — most commonly Register 3032 ("SG ready via API") not enabled, or the AUX1/AUX2 inputs not assigned as SG1/SG2 in the Nibe service menu.

Once we know which it is, we'll have a clean diagnosis.

You must be logged in to vote
0 replies
Comment options

This what I get with 1.7.1 beta 3
IMG_0899

You must be logged in to vote
0 replies
Comment options

Thanks for the screenshot — that's pinpoint useful. The raw heat_pump_title / heat_pump_not_configured text you see in Dutch is exactly what we'd predict for beta.3.

What you're seeing

The heat-pump section UI was added in v1.7.1-beta.1 and the English translation strings were authored at the same time, but they were EN-only — never propagated to the other 14 languages. Your HA profile is Dutch, so the lookup falls through and the raw translation keys render.

Other things visible in your screenshot are healthy:

Fixed in v1.7.1-beta.6

Shipped 2026年06月06日: 70 new translation entries (5 keys ×ばつ 14 languages including Dutch). The five keys:

Key EN NL (beta.6)
heat_pump_title Heat Pump Warmtepomp
heat_pump_mode Mode Modus
heat_pump_sg_ready_state SG-Ready State SG-Ready Status
heat_pump_boost_offset Boost Offset Boost Offset
heat_pump_not_configured description Geen warmtepomp geconfigureerd — stel relais (SG-Ready) of een climate-entiteit (climate-only) in onder Instellingen → SEM → Warmtepomp.

What to do

  1. Update to v1.7.1-beta.6 or later (beta.10 is shipping today with additional polish + HA Repairs handling for unavailable sensors).
  2. After the update lands in HACS, force-close the HA Companion app on your phone and reopen. The frontend bundle includes a content-hash cache-buster (?v=...) but the iOS PWA bootstrap is cached and needs a hard reload to pick up the new sem-localize.js. Pull-to-refresh on the SEM dashboard also works.
  3. The labels should switch to Dutch + the heat-pump section becomes self-explanatory.

If you actually want to use the heat pump for solar boost (vs leaving the section showing "not configured"), my earlier comment laid out the three SG-Ready paths — your existing Nibe is already integrated via nibe_heatpump, so the climate-only path (option A) is a 30-second config change.

Closing this discussion as resolved-pending-update. Re-open if beta.6+ still shows the raw keys after a hard refresh.

You must be logged in to vote
0 replies
Comment options

Hi @traktore-org
I'm on 1.7.1 beta 10.
I made a ESPboard with a coupel of relais to switch the Nibe SG1 and SG2 settings. This works within HA.
After that I configured the 2 switches from the ESP board in SEM, but it doesn't seem that SEM is able to work with that. See screenshot:
No heatpump configured!!

See also the energy costs below in the screenshot, all day on cheap but this is not the case at all!!!

Scherm­afbeelding 2026年06月06日 om 20 54 00
You must be logged in to vote
0 replies
Comment options

I'm still waiting when the SG ready kicks in when there is enough surplus

You must be logged in to vote
0 replies
Comment options

Follow-up on this: part of why the SG-Ready boost seemed to never kick in was that its telemetry was broken — the Mode sensor was stuck at "normal · 2" even while SEM was actually driving the relays (issue #570). That's fixed since v1.7.4-beta.22: sensor.sem_heat_pump_mode / _sg_ready_state now track the real relay state, and Boost / Force-on / Blocked are labelled properly.

So on a current beta you can genuinely watch it: on a sunny day with surplus above your heat-pump threshold, the Mode sensor should flip to boost (SG-Ready state 3). If you update and it still never leaves "normal" during real surplus, drop a note on #570 with your diagnostics — then it's a control problem rather than a display one, and I want to see it.

You must be logged in to vote
0 replies
Comment options

@traktore-org

I don't think the logic you use for SG-ready heatpumps is correct.

How the SG-Ready switches work (NIBE VVM 320)
A SG-Ready heat pump uses two digital inputs (two switches or relay contacts). By opening or closing these two contacts, an external controller (such as Home Assistant, a PV inverter, or an Energy Management System) can select one of four operating modes.
Think of it as a simple binary code:
Where:
0 = Open contact
1 = Closed contact

Mode 1 – Blocked (0 / 0)
The heat pump is prevented from running.
Typical use cases:
Very high electricity prices
Grid overload situations
Battery nearly empty
The compressor is stopped, although safety functions such as frost protection may remain active.

Mode 2 – Normal Operation (0 / 1)
The heat pump follows its normal settings:
Standard heating curve
Standard room temperature
Standard domestic hot water schedule
This is the default operating mode. [warmtepomp-kosten.nl]

Mode 3 – Recommended Operation (1 / 0)
The heat pump is encouraged to consume additional energy.
Typical applications:
Moderate solar surplus
Low electricity prices
The goal is to store energy in the building without significantly affecting comfort.

Mode 4 – Boost Operation (1 / 1)
The heat pump is instructed to maximize thermal storage.
Typical applications:
Large PV surplus
Negative electricity prices
Battery fully charged

Scherm­afbeelding 2026年07月08日 om 21 52 51 So my heartpump should be in normal mode, which should have the SG-ready switch in SGA= off and SGB=on, but in fact the are both off Scherm­afbeelding 2026年07月08日 om 21 57 25

Am I thinking the wrong way or is this a bug?

You must be logged in to vote
0 replies
Comment options

Thanks for sharing the follow-up conversation, @RienduPre — and unfortunately the honest point of view here is: that second Claude conversation set it up wrong, and it is not actually working, even though the entities appeared.

Here's the gap, verified against SEM's code:

SEM drives relay1/relay2 as the two SG-Ready state contacts — a 2-bit code encoding the four SG-Ready states (heat_pump_controller.py):

State relay1 : relay2
BLOCKED closed : open
NORMAL open : open
BOOST open : closed
FORCE_ON closed : closed

But switch.sg_ready_heating_48282 and switch.sg_ready_hot_water_48284 are not those two contacts. On the Nibe they are SG-Ready function-enable toggles — they decide whether SG-Ready is allowed to affect heating vs. hot water. They do not encode the state. So when SEM toggles them as a 2-bit code you get nonsense: at NORMAL it turns both off (disabling SG-Ready for heating and hot water entirely), and at BOOST it turns heating-enable off and hot-water-enable on — which is not a boost at all. Your sg_ready_state read 2 only because there was no surplus yet; with surplus this wiring still won't produce a real boost. Claude's "nothing more to do — it's working" was wrong.

What actually works — pick one of these three:

  1. Simplest (already shipped, v1.7.1+): climate-only. Leave both relay fields empty and set only the climate entity to your Nibe climate target (e.g. climate.vvm_320_heating_circuit). SEM then boosts the setpoint via number.sem_heat_pump_boost_offset on surplus. This is the path the earlier comments in this thread walked you through — no relays, no template switches.
  2. Path A — physical relays. Wire two switches (e.g. ×ばつ Shelly 1 Mini) to the VVM320's AUX1/AUX2 inputs and point relay1/relay2 at those. SEM then drives the real SG-Ready contacts directly.
  3. Path B — software SG-Ready. Create two HA template switch entities, each writing one bit of the SG-Ready state via the Nibe Modbus register (3032 enables Modbus-driven SG-Ready; the state write follows), then point relay1/relay2 at those template switches. The built-in sg_ready_heating / sg_ready_hot_water switches are not a substitute for this — that's the exact mistake above.

Both wiring paths are documented in docs/EV_CHARGING_LOGIC.md §12.

To confirm which path is actually live, check sensor.sem_heat_pump_registration_status — it reports registered_sg_ready, registered_climate_only, or registered_sg_ready_and_climate. If you're on climate-only that's the honest "it's working" signal.

My recommendation: go with option 1 (climate-only) — it needs no extra hardware or template switches and is exactly what v1.7.1 added for Nibe. Clear the two relay fields, set the climate entity, and watch sensor.sem_heat_pump_sg_ready_state move 2 → 3 next time you have real surplus. Happy to help if the registration-status sensor shows something unexpected.

You must be logged in to vote
0 replies
Comment options

Hi @traktore-org

But Is have 2 physical relays configured with an ESP32 board. The 2 toggles you see in the screenshot represent the the relays.
I don't use switch.sg_ready_heating_48282 and switch.sg_ready_hot_water_48284

You must be logged in to vote
0 replies
Comment options

Thanks for the correction, @RienduPre — that changes the diagnosis, and it's good news.

You're on a valid path. Two physical relays on an ESP32 board driving the Nibe's SG1/SG2 inputs, pointed at relay1/relay2 in SEM, is exactly Path A (real SG-Ready contacts). My previous comment assumed you'd wired the software switch.sg_ready_heating_48282 / switch.sg_ready_hot_water_48284 enable-toggles — you didn't, so that concern doesn't apply to you. Disregard it.

On the "is the logic a bug?" question from your earlier comment — I checked the code, and no, it's correct. In fact it's the exact thing you reported in #523 , which is already fixed. Here's the current relay map (devices/heat_pump_controller.py:51):

SG-Ready state relay1 : relay2
Blocked (EVU-Sperre) 1 : 0
Normal 0 : 0
Boost (recommended) 0 : 1
Force-on 1 : 1

So on a current build Normal = both contacts open (0:0) — which is why you see both relays off while there's no surplus. That is the correct, standard behaviour (BWP "SG Ready" label, and what the Nibe VVM320 itself expects): both inputs open → the pump just runs on its normal heating curve. It is not being blocked.

The table you quoted (Normal = 0/1, Blocked = 0/0) doesn't match that standard — and it happens to match SEM's old, pre-#523 map, which was precisely the bug you surfaced back then (SEM's BOOST used to drive 1:0, which a standard pump reads as EVU-block). That's corrected now.

One thing to check: your version. The corrected map shipped in the v1.7.3-beta.31 series. If you're still on 1.7.1-beta.10 (as in your earlier screenshot), you still have the old map, where Normal was 0:1 — that's likely why your expectation and the hardware disagree. Please update to the current beta (v1.7.4-beta.31) and re-check.

After updating:

  1. Watch it boost. With the telemetry fix in SG-Ready mode not updated #570 (v1.7.4-beta.22+), sensor.sem_heat_pump_mode / sensor.sem_heat_pump_sg_ready_state now track the real relay state. On a sunny moment with surplus above your heat-pump threshold, relay2 should close (0:1) and Mode should flip to boost / state 3.
  2. If your ESP32 relays are wired normally-closed (NC) instead of normally-open, the sense is inverted — enable the Invert SG-Ready option in the Heat Pump config step, which flips both contacts.
  3. Confirm registration via sensor.sem_heat_pump_registration_status — it should read registered_sg_ready.

If you update to the current beta and Mode still never leaves "normal" during genuine surplus, that's a control problem rather than an encoding one — drop the details on #570 with a screenshot of the relay states + surplus at that moment and I'll dig in. Thanks again for pushing on this; your reports are what got the map corrected in the first place.

You must be logged in to vote
0 replies
Comment options

I'm on beta beta 31

You must be logged in to vote
0 replies
Comment options

Perfect — beta.31 is exactly where you want to be. 👍

That means you already have the corrected SG-Ready relay map (the fix from #523). Verified against the code on that build (devices/heat_pump_controller.py):

SG-Ready state relay1 : relay2
Blocked 1 : 0
Normal 0 : 0
Boost (recommended) 0 : 1
Force-on 1 : 1

So both relays off = Normal (0:0) is correct, not a bug. The table you quoted earlier (Normal = 0/1) is the non-standard one that matched SEM's old pre-#523 map — on beta.31 that's gone. With no solar surplus right now, both contacts open is precisely what the VVM320 expects to just run its normal heating curve.

What to watch next — on a sunny moment with surplus above your heat-pump threshold, relay2 (SGB) should close → 0:1, and (thanks to the #570 telemetry fix in beta.22+) sensor.sem_heat_pump_mode / sensor.sem_heat_pump_sg_ready_state should flip to boost / state 3.

Two quick checks so you're confident it's live:

  • sensor.sem_heat_pump_registration_status should read registered_sg_ready.
  • If your ESP32 relays are wired normally-closed (NC) rather than normally-open, the sense is inverted — turn on the Invert SG-Ready toggle in the Heat Pump config step and both contacts flip.

If you're on beta.31, the registration status looks right, and Mode still never leaves "normal" during genuine surplus, then it's a control problem rather than an encoding one — pop the details (relay states + surplus at that moment) on #570 and I'll dig in. But based on everything here, your wiring and version are correct; it should just boost the next time you get real surplus. 🌞

You must be logged in to vote
0 replies
Comment options

I'll keep a close eye on it the upcoming days
Thanks for your help

You must be logged in to vote
0 replies
Comment options

One observation allready

If I toggle the second switch to on, my heatpump reacts on this as expected(Mode 3)
SEM doesn't reflect the manual toggle, I guess SEM only changes the mode if SEM give the command itself?

You must be logged in to vote
0 replies
Comment options

Good observation, @RienduPre — and your guess is exactly right. ✅

SEM only updates its own SG-Ready state when SEM issues the command. I verified this in the code: sensor.sem_heat_pump_sg_ready_state and sensor.sem_heat_pump_mode both read self._hp_status.sg_ready_state in devices/heat_pump_controller.py, and that value is written in exactly one place — inside _set_sg_ready_state() (line 345), which only runs when SEM calls activate() / deactivate() / block(). There is no state-change listener on your relay entities feeding back into it.

So it's an open-loop / commanded-state model: SEM tracks what it last told the relays to do, not what the physical contacts currently are. When you flip relay2 by hand, the heat pump reacts (Mode 3, as you saw — nice confirmation that your ESP32 → SG1/SG2 wiring and the 0:1 = BOOST encoding are correct!), but SEM's sensor stays on its last commanded value until SEM itself next changes state.

Practically this is harmless for normal use: during real solar surplus SEM will command BOOST itself, drive relay2 closed, and the sensor will update to 3. The mismatch only shows up when you manually override the relays outside SEM.

To actually test the end-to-end path without waiting for sun, the clean way is to force a surplus condition (or lower the heat-pump surplus threshold temporarily) so SEM makes the decision — then both the relay and sem_heat_pump_sg_ready_state should move to 3 together. Manually toggling the relay tests the pump side but bypasses SEM, so the sensor won't follow.

Reflecting external/manual relay changes back into the sensor would need a feedback listener on the relay entities — that's a reasonable enhancement rather than a bug. If you'd find that useful (e.g. you sometimes drive the relays from other automations too), say the word and I'll note it as an enhancement for the maintainer to consider. Otherwise, sounds like your setup is behaving correctly — enjoy watching that first sunny boost. 🙂

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /