Skip to content

Timed Charge (43110 bit 1) read-only; Work Mode whole-register values [BREAKING] - #32

Merged
fboundy merged 1 commit into
mainfrom
patch
Jul 4, 2026
Merged

fboundy merged 1 commit into
mainfrom
patch

Conversation

@fboundy

@fboundy fboundy commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Root-causes and fixes the reported "Mode - Timed Charge bounces off" behaviour.

Root cause (firmware, not a code bug): bit 1 of the Energy Storage Control Switch (register 43110) does not persist as a user-set value on this inverter firmware family. A Modbus write to set it succeeds and is acknowledged by the device, but the next poll (~6s later) reads it back cleared, with every other bit untouched. Confirmed live, and cross-referenced against wills106/homeassistant-solax-modbus (plugin_solis_fb00.py) — which the reporting user wrote the relevant part of — that never exposes this bit as a controllable option and drives all real TOU enablement through register 43707's per-slot switches (already implemented here).

Changes

  • Bit 1 → read-only. Removed the controllable Mode - Timed Charge switch entity; exposed the bit read-only as binary_sensor.solis_timed_charge_status via a new binary_sensor platform (SolisBinaryStatusSensor, get_binary_sensors, Platform.BINARY_SENSOR added to PLATFORMS).
  • Work Mode select → whole-register values. Replaced the bit-conflict conflicts_with/requires logic (whose interaction with bit 1 was the source of the bounce) with the 8 field-tested whole-register on_value options copied from solax_modbus: 1, 17, 33, 37, 41, 49, 64, 96 — none of which set bit 1.
  • Drift baselines unchanged: the bit-1 unique_id moves from the switch platform to the binary_sensor platform (identical register+bit), so no known_sensors_*.json regeneration; added get_binary_sensors coverage to the generator + drift test so the new platform is tracked.
  • Docs updated (tou.md, sensors.md).

⚠️ Breaking change

For anyone on a shipped release (≤ v0.1.16):

  • The bit-1 Timed Charge switch entity disappears, replaced by a read-only binary_sensor (binary_sensor.solis_timed_charge_status).
  • The Work Mode select's valid option strings change entirely (now the 8 solax values, e.g. Self-Use, Feed-in priority, Off-Grid Mode, …).

Flagging for a prominent changelog note — you may want a minor-version bump rather than a routine patch.

Test plan

  • tests/test_binary_status_sensor.py (new): read-only entity has no write methods, bit update sets is_on, ignores other register / wrong controller, device_info delegates
  • tests/test_solis_select_entity.py: Work Mode now writes/resolves each of the 8 whole-register values
  • tests/test_ac_coupling.py, tests/test_switch_conflicts_requires.py: bit-1 switch removal
  • tests/test_sensor_drift.py: passes against existing baselines (bit-1 uid moved platforms)
  • Full suite: 362 passed
  • ruff check / ruff format --check clean

Live verification on the real inverter to follow after merge.

…e-register values

Bit 1 of the Energy Storage Control Switch (register 43110) does not
persist as a user-set value on this inverter firmware family: a Modbus
write succeeds and is acknowledged, but the device silently clears it
within one poll cycle. This produced the reported "Timed Charge
bounces off" behaviour. Confirmed live and cross-referenced against
wills106/homeassistant-solax-modbus, which never exposes this bit as
a control either and drives all TOU enablement through register 43707.

- Remove the bit-1 switch entity; expose it read-only as
  binary_sensor.solis_timed_charge_status via a new binary_sensor
  platform (SolisBinaryStatusSensor + get_binary_sensors).
- Replace the Work Mode select's bit-conflict logic with the 8
  field-tested whole-register values from solax_modbus (1/17/33/37/
  41/49/64/96), none of which set bit 1.
- Drift baselines unchanged: the bit-1 unique_id simply moves from the
  switch platform to the binary_sensor platform (same register+bit).

BREAKING: the bit-1 Timed Charge switch entity is replaced by a
read-only binary_sensor, and the Work Mode select's option strings
change entirely.
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@fboundy
fboundy merged commit 9718152 into main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant