Fix I_Status and I_Status_Vendor register type: uint16 not int16#985
Merged
WillCodeForCats merged 2 commits intoMay 24, 2026
Merged
Conversation
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.
1b7f02a to
f219c47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I_Status(address 40107) andI_Status_Vendor(address 40108) are decoded asint16in hub.py but are defined asuint16in the SolarEdge SunSpec Implementation Technical Note.Spec reference
See SolarEdge Sunspec Implementation Technical Note v3.2 (June 2025) shows both registers typed as
uint16below:Changes
hub.py: Move
I_StatusandI_Status_Vendorfrom theint16decode list to theuint16decode list.sensor.py + const.py: Update the not-implemented sentinel checks in
SolarEdgeInverterStatus.native_valueandStatusVendor.native_valuefromSunSpecNotImpl.INT16toSunSpecNotImpl.UINT16. Also updates theVENDOR_STATUSdict key inconst.pyto match.Testing
Tested on SE7600, firmware
0003.2537(≥ 3.20.xx), single inverter.Integration loaded cleanly,
I_Statusdecoded correctly(status 4, Production), no errors in logs.