Skip to content

Conversation

@bbarabe
Copy link

@bbarabe bbarabe commented Jan 30, 2026

Summary
This PR adds full System Work Mode configuration controls (numbers/switches/time/selects) gated by a new "Allow write access" option (default off). It also strengthens energy sensors, adds home consumption energy, improves setting propagation, and includes migration scaffolding for smooth upgrades from 5.0.0.

Key changes

  • Config controls (Configuration entities):
    • Work Mode (sysWorkMode) and Energy Pattern (energyMode) as select entities.
    • Solar Sell, Time‑Of‑Use, Sell/Charge time enable toggles as switches.
    • Time 1‑6 as time entities.
    • Power 1‑6, Battery SOC 1‑6, Max Solar/Max Sell/Zero Export as numbers.
    • Day‑of‑week TOU switches (Mon–Sun).
  • Safety gate:
    • New config option Allow write access (default false).
    • Writes blocked unless enabled.
  • Master inverter handling:
    • Settings fetch/write always use the master inverter (equipMode == 1).
    • Master SN cached in memory.
  • Energy sensors:
    • Grid import/export energy, battery charge/discharge energy, home consumption energy.
    • Uses HA integration sensor when available (fallback to custom).
  • UX improvements:
    • Optimistic updates + delayed refresh to handle API propagation delays.
    • Options updates trigger integration reload.
    • Suggested object IDs ensure stable entity IDs (e.g., sensor.solark_grid_power).
  • Migration:
    • Config flow version bumped to 2.
    • async_migrate_entry seeds allow_write_access and updates entry version.

Testing

  • Manual SolArk CLI tests for live/flow/settings.
  • Settings writes with Allow Write Access on/off.
  • Restart HA after update.

@bbarabe bbarabe closed this Jan 30, 2026
@bbarabe
Copy link
Author

bbarabe commented Jan 30, 2026

Found an issue with battery energy - will fix before resubmitting. Also, would love to test it with single inverter (I use a master/slave)

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