Skip to content

fix: Convert input registers 125/126 to read-only sensors | Hinen#1086

Open
thiagofigueiro wants to merge 1 commit into
davidrapan:mainfrom
thiagofigueiro:fix/reg-125-126-readonly-enum
Open

fix: Convert input registers 125/126 to read-only sensors | Hinen#1086
thiagofigueiro wants to merge 1 commit into
davidrapan:mainfrom
thiagofigueiro:fix/reg-125-126-readonly-enum

Conversation

@thiagofigueiro

Copy link
Copy Markdown
Contributor

Summary

Fix two entities in the Hinen H5000 profile that were incorrectly declared as writable select platforms when their underlying Modbus registers are read-only input registers. Attempting to set a new value via these selects would silently write to the holding registers at the same address, which are different parameters entirely, and would potentially misconfigure the inverter.

Changes

custom_components/solarman/inverter_definitions/hinen_hybrid.yaml

  1. Energy Pattern (reg 125) — removed platform: "select". This register is an input register reporting the current energy priority (Load/Battery/Grid). It has no writable counterpart — the holding register at address 125 is BatteryType (Lead-acid/Lithium/Others). Writing to it would change the battery chemistry setting, not the priority.

  2. Battery Control Mode (reg 126) — removed platform: "select" and renamed to Battery Type to match the Modbus spec. Same issue: input register 126 reports the installed battery chemistry, but holding register 126 is BatMdlSerialNum (number of battery modules in series). Writing to it would change the module count.

This is the same pattern used by kstar_hybrid.yaml for its Battery Type entity.

Testing

Verified in a local dev instance. Both sensor.inverter_energy_pattern and sensor.inverter_battery_type report correct values and are available on the API. Stale select entities from the entity registry were cleaned up after restart.

Before

(unavailable because I took the screenshot after I had already fixed the profile)

image

After

image image

…le selects

Energy Pattern (reg 125) and Battery Control Mode (reg 126) are input
registers — read-only by Modbus spec. The profile incorrectly declared
them as platform: select, which implies write capability. Writing to
these addresses would silently target the corresponding holding
registers (BatteryType at 125, BatMdlSerialNum at 126), potentially
misconfiguring the inverter.

Convert both to read-only sensor entities by removing platform: select.
The lookup mappings are retained so they display the string labels
correctly as enum sensors.
@thiagofigueiro thiagofigueiro changed the title Fix read-only input registers 125/126 mistakenly configured as writab… fix: read-only input registers 125/126 mistakenly configured as writab… Jun 6, 2026
@thiagofigueiro thiagofigueiro changed the title fix: read-only input registers 125/126 mistakenly configured as writab… fix: Convert input registers 125/126 to read-only sensors | Hinen Jun 6, 2026
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