fix: Convert input registers 125/126 to read-only sensors | Hinen#1086
Open
thiagofigueiro wants to merge 1 commit into
Open
fix: Convert input registers 125/126 to read-only sensors | Hinen#1086thiagofigueiro wants to merge 1 commit into
thiagofigueiro wants to merge 1 commit into
Conversation
…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.
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
Fix two entities in the Hinen H5000 profile that were incorrectly declared as writable
selectplatforms 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.yamlEnergy 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 isBatteryType(Lead-acid/Lithium/Others). Writing to it would change the battery chemistry setting, not the priority.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 isBatMdlSerialNum(number of battery modules in series). Writing to it would change the module count.This is the same pattern used by
kstar_hybrid.yamlfor itsBattery Typeentity.Testing
Verified in a local dev instance. Both
sensor.inverter_energy_patternandsensor.inverter_battery_typereport 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)
After