Skip to content

Fix I_Status and I_Status_Vendor register type: uint16 not int16#985

Merged
WillCodeForCats merged 2 commits into
WillCodeForCats:mainfrom
virtitnerd:fix/register-types
May 24, 2026
Merged

Fix I_Status and I_Status_Vendor register type: uint16 not int16#985
WillCodeForCats merged 2 commits into
WillCodeForCats:mainfrom
virtitnerd:fix/register-types

Conversation

@virtitnerd
Copy link
Copy Markdown
Contributor

Summary

I_Status (address 40107) and I_Status_Vendor (address 40108) are decoded as int16 in hub.py but are defined as uint16 in the SolarEdge SunSpec Implementation Technical Note.

Spec reference

See SolarEdge Sunspec Implementation Technical Note v3.2 (June 2025) shows both registers typed as uint16 below:

image

Changes

hub.py: Move I_Status and I_Status_Vendor from the int16 decode list to the uint16 decode list.

sensor.py + const.py: Update the not-implemented sentinel checks in SolarEdgeInverterStatus.native_value and StatusVendor.native_value from SunSpecNotImpl.INT16 to SunSpecNotImpl.UINT16. Also updates the VENDOR_STATUS dict key in const.py to match.

Testing

Tested on SE7600, firmware 0003.2537 (≥ 3.20.xx), single inverter.
Integration loaded cleanly, I_Status decoded correctly
(status 4, Production), no errors in logs.

SunSpec Implementation Technical Note v3.2 (June 2025) defines:
  40107 I_Status        uint16  Operating State
  40108 I_Status_Vendor uint16  Vendor-defined operating state/error codes

Both registers were being decoded as int16, which is incorrect per spec.
The not-implemented sentinel for uint16 is 0xFFFF (SunSpecNotImpl.UINT16),
not 0x8000 (SunSpecNotImpl.INT16) used for signed registers.

For I_Status values 1-8 the decoded value is identical under either type.
For I_Status_Vendor the distinction matters: vendor-defined error codes are
unsigned and a code of 0x8000 would be misread as not-implemented if decoded
as int16. The spec notes I_Status_Vendor applies to firmware <= 3.19.xx;
I_Status_Vendor4 (uint32) applies to firmware >= 3.20.xx.

Verified against: SolarEdge SunSpec Implementation Technical Note v3.2
Table: Inverter Model MODBUS Register Map, addresses 40107-40108
…Vendor

Following the register type correction in the previous commit, the
not-implemented checks that guard I_Status and I_Status_Vendor must
use SunSpecNotImpl.UINT16 (0xFFFF) instead of SunSpecNotImpl.INT16 (0x8000).

Without this change, after decoding I_Status_Vendor as uint16, the guard
in native_value would never match on 0xFFFF, allowing an unrecognised value
to fall through to the DEVICE_STATUS dict lookup and raise a KeyError.

Also updates VENDOR_STATUS in const.py: the not-implemented sentinel key
changes from SunSpecNotImpl.INT16 to SunSpecNotImpl.UINT16 to match.
@virtitnerd virtitnerd force-pushed the fix/register-types branch from 1b7f02a to f219c47 Compare May 24, 2026 00:35
@WillCodeForCats WillCodeForCats self-assigned this May 24, 2026
@WillCodeForCats WillCodeForCats merged commit c8fa49d into WillCodeForCats:main May 24, 2026
5 checks passed
@virtitnerd virtitnerd deleted the fix/register-types branch May 24, 2026 15:17
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