Skip to content

Sensor Split for inverter_system_state sensor#75

Merged
derolli1976 merged 2 commits into
mainfrom
72-bug-sensorinverter_system_state-is-longer-than-255
Oct 15, 2025
Merged

Sensor Split for inverter_system_state sensor#75
derolli1976 merged 2 commits into
mainfrom
72-bug-sensorinverter_system_state-is-longer-than-255

Conversation

@derolli1976
Copy link
Copy Markdown
Owner

Description

This update improves handling of the Inverter System State value returned by Enpal devices.
The integration now detects long bitfield status strings and automatically splits them into multiple structured sensors:

  • inverter_system_state_decimal
  • inverter_system_state_flags
  • individual inverter_system_state_* sensors for each bit (e.g. Grid-connected, Shutdown, etc.)
    The original long text sensor is preserved (truncated to 240 chars) to maintain backward compatibility.

Motivation and Context

Previously, the System State value exceeded Home Assistant’s 255-character state limit, causing the entity to become unknown.
This change prevents that error and provides more granular, automation-friendly sensors.
Improves stability, data visibility, and long-term statistics.

Fixes: overflow issue for sensor.inverter_system_state.

How Has This Been Tested?

  • Tested on a live Enpal installation (Firmware 8.47.3-454410).
  • Verified entity creation in Home Assistant 2025.10.
  • Confirmed state updates, correct flag parsing, and absence of 255-char warnings.
  • Checked reloading, persistence after restart, and entity uniqueness (unique_id preserved).

Screenshots (if appropriate)

(See screenshot in PR description showing generated sub-sensors: decimal, flags, and per-bit status.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality changed or removed)

Checklist

  • My code follows the style and conventions of this project.
  • My change does not require documentation updates (auto-discovery).
  • The change was tested manually in Home Assistant.
  • All existing functionality continues to work as expected.

@derolli1976 derolli1976 merged commit 94c7a3c into main Oct 15, 2025
11 checks passed
@derolli1976 derolli1976 deleted the 72-bug-sensorinverter_system_state-is-longer-than-255 branch December 5, 2025 06:02
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.

[Bug] sensor.inverter_system_state is longer than 255, falling back to unknown

1 participant