Skip to content

Energy Dashboard fix, sub-device infrastructure, and a plugin-aware options dialog - #2279

Merged
wills106 merged 1 commit into
wills106:mainfrom
Bl00d-B0b:fix/energy-dashboard-remove-disabled-sensors
Aug 22, 2026
Merged

Energy Dashboard fix, sub-device infrastructure, and a plugin-aware options dialog#2279
wills106 merged 1 commit into
wills106:mainfrom
Bl00d-B0b:fix/energy-dashboard-remove-disabled-sensors

Conversation

@Bl00d-B0b

@Bl00d-B0b Bl00d-B0b commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Base PR for the sub-device series (#2283 EPS, #2284 Parallel, #2285 External Generator, #2286 Dry Contact, plus #2277 and #2275 which stack on it). This PR moves no entities — it contains the shared fix and infrastructure, so each follow-up stays a small, single-topic review.

Energy Dashboard fix

Turning a feature switch off only marked the corresponding sensors inactive. The entity stayed alive and its registry entry was never removed, so the virtual device accumulated sensors stuck at unavailable (grid-to-battery, home-consumption and the PV-variant sensors). They are now removed and their registry entries purged.

Sub-device infrastructure (generic, usable by any plugin)

  • device_group on an entity description assigns it to a named sub-device linked to the inverter with via_device — the same pattern the battery pack devices already use.
  • active_when ({sensor_key: allowed values}) is evaluated against polled hub.data; a key that is not polled on a model never blocks availability.
  • The hub tracks such entities and adds or removes them as conditions change, with a two-poll hysteresis so a stale readback right after a write cannot make entities flicker.
  • A sub-device whose option is switched off is removed from the registry instead of lingering.
  • Switch and number writes publish the written value immediately, as selects and times already did.
  • Numbers gain max_key, letting a sensor value override native_max_value.
  • The number, select, switch, time and sensor platforms honour all of it.

Options dialog

Feature switches the selected plugin does not implement are no longer shown (an EV charger no longer offers EPS or the Dry Contact Box, for example). The same option can gate different functionality per plugin — Parallel Mode covers the inverter master-slave group on the hybrid and the charger-parallel group on the EV charger (#2275). All feature options now default to off for new entries, including the Energy Dashboard virtual device.

@Bl00d-B0b
Bl00d-B0b force-pushed the fix/energy-dashboard-remove-disabled-sensors branch from adbe0ee to f7347b6 Compare August 12, 2026 11:32
@Bl00d-B0b Bl00d-B0b changed the title Energy Dashboard: remove sensors that are switched off Energy Dashboard, EPS and Parallel: own sub-devices, and entities removed when switched off Aug 12, 2026
Bl00d-B0b added a commit to Bl00d-B0b/homeassistant-solax-modbus that referenced this pull request Aug 13, 2026
…en availability

The Gen4 dry-contact load-management controls become their own HA device
("<hub> Dry Contact", linked to the inverter via via_device, the same
pattern as the battery pack devices), and each entity only exists while
its full parent chain in the app's dependency tree is active:

  Dry Contact Mode (0xC3 -> 0x12F): Generator Control | Load Management
    Load Management (0xC2 -> 0x12E): Disabled | Manual Mode | Smart Save
      Manual Mode switch (0xB6 -> 0x122): only in Manual Mode
      Threshold On Feed-in Power (0xB7 -> 0x123)    \
      Threshold Off Consumption (0xB9 -> 0x125)     |
      Threshold Off Battery SoC (0xBA -> 0x126)     | only in Smart Save
      Minimum Per On Signal (0xBB -> 0x127)         |
      Maximum Per Day (0xBC -> 0x128)               |
      Schedule (0xBD -> 0x129)                      /
        Work Start/End Time 1 and 2 (0xBE-0xC1 -> 0x12A-0x12D):
        only while Schedule is enabled

All register mappings were verified live on an X3-Hybrid-G4 15kW by
changing each setting in the SolaX app and tracking the readback.

The dry-contact entities are managed dynamically by this tree, so the Dry
Contact Box option now only decides whether the sub-device exists at all;
it no longer sets the DCB feature bit on individual entities. Its label
drops the model suffix, since the option is offered only for plugins that
actually declare dry-contact entities.

Display names follow the app: Work Mode -> Load Management (option Manual
-> Manual Mode), Manual Mode Control -> Manual Mode, Feedin On Power ->
Threshold On Feed-in Power, Consume Off Power -> Threshold Off
Consumption, Switch Off SOC -> Threshold Off Battery SoC, Maximum Per Day
On -> Maximum Per Day, and the Work Stop Time readbacks become Work End
Time to match their time entities. Keys and entity ids are unchanged.

Other SolaX names are aligned with the cloud app at the same time: the
Self Use, Feed-In Priority and Backup families use "Min SoC" and "Charge
Battery to", "Feedin Priority" becomes "Feed-In Priority" everywhere
(including the remote control power-control options), Charge Start/End 1
become Force Charge Start/End and Discharge Start/End 1 become Allowed
Discharge Start/End, and Self Use Charge Battery to only appears while
Self Use night charge is enabled.

Stacked on wills106#2279, which adds the device_group/active_when infrastructure
this PR uses.
@Bl00d-B0b Bl00d-B0b changed the title Energy Dashboard, EPS and Parallel: own sub-devices, and entities removed when switched off Energy Dashboard, EPS, Parallel and External Generator: own sub-devices, and entities removed when switched off Aug 13, 2026
@Bl00d-B0b
Bl00d-B0b force-pushed the fix/energy-dashboard-remove-disabled-sensors branch from 41191ce to 23953c6 Compare August 13, 2026 05:37
@Bl00d-B0b Bl00d-B0b changed the title Energy Dashboard, EPS, Parallel and External Generator: own sub-devices, and entities removed when switched off Sub-devices for EPS, Parallel, External Generator and Dry Contact, and removal of switched-off entities Aug 13, 2026
@Bl00d-B0b
Bl00d-B0b force-pushed the fix/energy-dashboard-remove-disabled-sensors branch from 23953c6 to c38ce21 Compare August 13, 2026 05:41
@Bl00d-B0b
Bl00d-B0b force-pushed the fix/energy-dashboard-remove-disabled-sensors branch from c38ce21 to 1b83570 Compare August 13, 2026 11:16
@Bl00d-B0b Bl00d-B0b changed the title Sub-devices for EPS, Parallel, External Generator and Dry Contact, and removal of switched-off entities Energy Dashboard fix, sub-device infrastructure, and a plugin-aware options dialog Aug 13, 2026
…ptions dialog

Energy Dashboard: the refresh only marked sensors inactive when a feature
switch was turned off - the entity stayed alive and its registry entry was
never removed, so the device accumulated sensors stuck at unavailable
(grid-to-battery, home-consumption and PV-variant sensors). They are now
removed and their registry entries purged.

Generic sub-device infrastructure, used by follow-up PRs that move the
EPS, Parallel, External Generator and Dry Contact families into their own
devices: entity descriptions gain device_group (assigns the entity to a
named sub-device linked to the inverter with via_device, the same pattern
as the battery pack devices) and active_when ({sensor_key: allowed values}
evaluated against polled hub.data; keys not polled on a model never block
availability). The hub tracks gated entities and adds or removes them as
conditions change, with a two-poll hysteresis so a stale readback right
after a write cannot make entities flicker. A sub-device whose option is
switched off is removed from the registry instead of lingering. Switch and
number writes publish the written value immediately, as selects and times
already did. Numbers gain max_key, letting a sensor value override
native_max_value. The number, select, switch, time and sensor platforms
honour all of it. No entities move in this PR.

The options dialog no longer shows feature switches the selected plugin
does not implement, and all feature options now default to off for new
entries, including the Energy Dashboard virtual device.
@Bl00d-B0b
Bl00d-B0b force-pushed the fix/energy-dashboard-remove-disabled-sensors branch from 1b83570 to 841569e Compare August 20, 2026 12:27
@wills106
wills106 merged commit a201b84 into wills106:main Aug 22, 2026
13 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.

2 participants