feat(switch): ✨ add manual EVU2 input for models that do not report SG2 - #812
Merged
Merged
Conversation
- add an "EVU2 input (manual)" config switch on the MSW2-9S, whose SG2 contact no register reports (calc 185 stays 0, RFV reads 0.0) - resolve EVU2 as RFV sign > manual value > calc 185, so the SmartGrid status and the EVU2 binary sensor both follow the switch - carry the value on the coordinator into each poll's data; nothing is written to the heat pump - restore it from the switch's last state before the platforms are set up, so no entity computes a status from the default on a restart - gate on an explicit model list: calc 185 reads 0 in every corpus dump, so no data test separates "contact open" from "not reported" - document the switch in ADVANCED_FEATURES.md, translate it in all five languages Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the first refresh runs before the restore and applies the default, so the restored value only reached the entities at the next poll: the status still flipped on every restart, and stopping HA inside that window stored the switch as off and lost the setting - apply the restored value to the current data straight away - skip the restore for a disabled switch, which otherwise kept steering the status with no visible entity until the restore cache expired it - assert the restore tests on the data the entities read, seeded the way setup seeds it, instead of the coordinator's private copy - document enabling the switch after turning Smart Grid on later Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…id is on - fold the SmartGrid check into evu2_manual_input_required, so the switch setup and the coordinator share one rule: with SG off the switch is not created and its value is not applied, like the SG offset numbers - enable the switch by default, now that it only exists when it matters - show the stored setting on the switch rather than the applied value: with SG off the applied value is None, which would have been stored as off on the next reload and lost the setting Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- turn the EVU2 input paragraph into a how-to: what on and off mean, the two wiring cases, and an automation that copies an SG2 relay's state - explain that the switch only exists while Smart Grid is on, what a reload does when Smart Grid is turned on or off, and the 7-day restore - link the section from the Smart Grid mode entry and the README Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the restore was gated on SmartGrid being on, so a unit started with SG off and then switched on through the select (no reload) applied the default instead of the stored setting until the next reload - gate the restore on the model alone; whether the setting is applied stays the per-poll decision in _apply_evu2_manual Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- say that turning Smart Grid off takes effect at the next poll, and that Home Assistant keeps the setting about a week after the reload, counted once it has restarted - say that disabling the switch takes effect after the reload that follows it - re-sync the example automation when the Luxtronik switch comes up instead of at Home Assistant start, which also covers a slow or retried integration setup Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- entities without a register (luxtronik_key UNSET) got the attribute luxtronik_key "NSET UNSET": the enum name sliced as if it were a P/C index, e.g. the SmartGrid status sensor and the manual EVU2 switch - optional luxtronik_key_* fields left at UNSET did the same; on a live install that is six attributes across the water heater and both climate entities - skip both when the key is UNSET; nothing reads these attributes back Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- add a "derived" section for values the integration derives rather than reads, which the register sections cannot explain - carry the manual SG2 switch setting and the value the SmartGrid status used (None when not applied: SmartGrid off, or not a listed model) - an MSW2-9S report showing calc 185 at 0 and a status with SG2 closed is explainable from the dump alone now Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- base builds the luxtronik_key attributes before climate swaps in the current temperature key (C0227, or the configured indoor sensor), so the attribute showed "NSET UNSET" and, after the previous commit, nothing at all - move the attribute building into LuxtronikEntity's _set_luxtronik_key_attributes and call it again after the swap Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the switch comes up before automations arm their triggers on a normal restart, so the "from: unavailable" trigger alone never re-synced then - keep the Home Assistant start trigger for restarts and the unavailable one for reloads and slow or retried setups Refs #500 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 What this fixes
The last open piece of #500 (step 3 of the plan agreed with @siedi in that thread).
On the MSW2-9S, the SmartGrid status can never show a state that needs the SG2 contact closed. The controller reacts to SG2 normally but reports it nowhere the integration can read:
ID_WEB_HZIO_EVU2stays 0 whatever the contact does, confirmed by two owners (@Zaschii, SG2 wired permanently closed; @mhuiskes, SG2 switched by a relay);The gate is an explicit model list rather than a data test. calc 185 reads 0 in all 84 dumps in the diagnostics corpus, SmartGrid on or not, so nothing in the data separates "contact open" from "contact not reported".
✨ Changes
Manual SG2 input
EVU2_MANUAL_INPUT_MODELS) and only while Smart Grid mode is notOff, the same rule as the SG offset numbers. Nothing is written to the heat pump.LuxtronikCoordinatorData.evu2_manual,Nonewhen not applied). The switch shows the stored setting, not the applied value, so turning Smart Grid off and reloading does not store it as off.Diagnostics
derivedsection:evu2_manual(the setting) andevu2_manual_applied(what the status used,nullwhen not applied). An MSW2-9S report is explainable from the dump alone now.Entity attributes
luxtronik_key: "NSET UNSET"(the UNSET enum name sliced as if it were an index), and neither doluxtronik_key_*fields left at UNSET. On a live install that was six attributes across the water heater and both climate entities.luxtronik_key_current_temperaturenow names the key it actually reads (C0227, or the configured indoor sensor); base built the attribute before climate swapped the key in.Docs
🧪 Tests
Refs #500
🤖 Generated with Claude Code