Add device-gated "Cut PV generation" switch for SH-RT inverters (reg 31211)#738
Add device-gated "Cut PV generation" switch for SH-RT inverters (reg 31211)#738sebastian-tennant wants to merge 3 commits into
Conversation
The datasheet "PV power limitation" register 13018 is marked "Only SHT supported" and silently fails on the SH-RT family (reads 0xFFFF, writes ignored). iSolarCloud instead uses reg 31211 (HA address 31210) to stop PV on RT inverters: 0xAA = cut PV, 0x55 = allow PV. Confirmed working on an SH10RT (firmware SAPPHIRE-H 95.12). Implemented as a template switch gated via `availability` to the RT family (plus a backing `Cut PV generation raw` modbus sensor), so the write path is never exposed on models where the register's meaning is unconfirmed. Reads of the register are harmless on any model. The availability check can be widened by owners of other models that confirm the same register. Use case: cut solar during negative grid import prices so the battery charges purely from the (paid) grid.
The template switch state key is 'state', not 'is_on' — 'is_on' is an invalid option and HA silently fails to register the switch. Verified end-to-end on an SH10RT: toggling drove total_dc_power 1544 W -> 0 W (write 0xAA) and back (write 0x55), with sensor.cut_pv_generation_raw reading 170/85 respectively. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pushed a fix: the template switch must use |
|
Interesting! Which option in iSolarCloud does this correspond to? |
…SolarCloud option Removes the overconfident claim that reg 31211 is "the register iSolarCloud uses" and replaces it with an accurate description: identified by theunknown86 (issue mkaiser#554) via Modbus traffic analysis of iSolarCloud. There is no named user-facing option in the iSolarCloud app that corresponds to this register. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the question - I think my assistant assumed a few things. Register 31211 was not found via a named iSolarCloud option. It was identified by @theunknown86 in issue #554 (December 2025) through Modbus traffic analysis: they monitored which registers the iSolarCloud app wrote to the inverter while controlling PV on their SH10RS. There is no visible toggle or slider in iSolarCloud that a user would recognise as "cut PV generation" on RT inverters — the app writes the register internally without surfacing it as a named control. The documented equivalent (register 13018, "PV power limitation" in Modbus spec v1.1.11) is explicitly marked "Only SHT supported" and returns Empirical confirmation on SH10RT (firmware SAPPHIRE-H 95.12):
Because the register is not in the public Modbus spec and was found on SH10RS/SH10RT only, the availability gate ( I have pushed a small docs-only commit to this PR correcting the YAML comments to accurately describe the origin. |
Summary
Adds a Cut PV generation switch that actually works on the SH-RT inverter family.
The datasheet "PV power limitation" register 13018 is marked "Only SHT supported" and silently fails on SH-RT inverters — it reads back
0xFFFFand writes are ignored, with no effect on PV output. iSolarCloud instead uses register 31211 (HA holding address 31210) to stop PV production on RT inverters:0xAA= cut PV0x55= allow PV (normal)Confirmed working live on an SH10RT, firmware SAPPHIRE-H 95.12: writing
0xAAdrove total DC power from ~5.4 kW to 0 W in ~10 s; writing0x55restored PV.Implementation
Rather than a raw
modbusswitch (which would be writable on every model regardless of support), this is implemented as a template switch so it can be gated:modbus.write_registerpath is never reachable — no risk of writing0xAAinto reg 31211 on a model where its meaning is unconfirmed.Cut PV generation rawmodbus sensor reads the register; reads are harmless on any model.availabilitycheck.Use case
Cut solar during negative grid import prices (e.g. Amber in Australia) so the home battery charges purely from the paid grid.
Testing
is_onstate tracked the register correctly.availabilityevaluates to unavailable whensensor.sungrow_device_typeis non-RT.