Repository navigation
Conversation
The Work Mode select options each conflicted with their own bit, never cleared the Timed Charge bit, and left stale mode bits from the previous mode - so plain modes couldn't turn TOU off and cross-mode transitions could write invalid combos the firmware rejects, which reads back as controls bouncing off on the next poll. Each option now clears exactly the other mode bits it is incompatible with per the official Appendix 8 map. Mode - Timed Charge gains conflicts_with [2, 11]: toggling it from Off-Grid or Peak Shaving force-sets the fallback Self-Use bit, which those modes forbid - the firmware rejected the combo and the switch bounced off. The select's bit-position branch now pushes its state after a write (the on_value branch already did). Also renames the six discharge slots that were mislabelled as "Timed Charge ... 7-12" to "Timed Discharge ... 1-6" (enable switches, start/end times, SOC/current/voltage numbers). Names only; unique_ids are register-derived so nothing migrates.
Contributor
|
Failed to generate code suggestions for PR |
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.
Summary
Fixes the reported "Mode - Timed Charge bounces off" interaction between the mode switches and the Work Mode select, plus the mislabelled discharge entities.
Work Mode select (register 43110) — the option definitions were internally broken:
conflicts_with(clear bit 0, then immediately re-set it).new == current, wrote nothing, and the select could never turn TOU off.Each option now clears exactly the incompatible other mode bits per the official Appendix 8 map; "+ TOU" variants keep bit 1 via
requires.Mode - Timed Charge switch (bit 1) — had no
conflicts_with. Toggling it from Off-Grid (2) or Peak Shaving (11) force-sets the fallback Self-Use bit, which those modes forbid → firmware rejects → bounce. Nowconflicts_with [2, 11].Select state push —
async_select_option's bit-position branch never pushed entity state after a write (theon_valuebranch did); fixed.Discharge renames — the six discharge slots were labelled "Timed Charge … 7-12"; now "Timed Discharge … 1-6" (enable switches on 43707 bits 6-11, start/end times, SOC/current/voltage numbers). Names only — unique_ids are register/bit-derived, so no registry migration and the sensor-drift suite passes unchanged.
Test plan
tests/test_solis_select_entity.py: parametrised round-trip — every Work Mode option applied from six different starting mode states must resolve back to itself; plain modes clear TOUtests/test_switch_conflicts_requires.py: toggling Timed Charge from Peak Shaving (real definitions) writes Self-Use+TOU with bit 11 clearedtests/test_ac_coupling.py: discharge name assertionsruff check/ruff format --checkcleanLive verification on the real inverter to follow (restart HA, confirm Timed Charge stays on, then timed charge/discharge tests on both protocols).