Skip to content

Bug: Serial number (SN) field limited to 10 characters — too short for some EV Charger models #102

Description

@Sturmi77

Bug Description

The config_flow.py has a hardcoded maximum length of 10 characters for the serial number (SN) field in both CONFIG_SCHEMA and OPTION_SCHEMA:

vol.Required(CONF_SN): vol.All(
    str, vol.Length(max=10, msg="invalid_sn_length")
),

This prevents users from entering serial numbers longer than 10 characters. The SolaX EV Charger (X3-EVC series) can have serial numbers of 14 characters (e.g. C32203XXXXXXXX), making it impossible to set up the integration via the UI.

Impact

  • Integration cannot be configured at all for affected devices
  • Workaround requires manually patching config_flow.py after every HACS update

Steps to Reproduce

  1. Install integration via HACS
  2. Go to Settings → Devices & Services → Add Integration → SolaX HTTP
  3. Enter a serial number longer than 10 characters
  4. UI rejects input with invalid_sn_length error

Expected Behavior

The SN field should accept serial numbers of at least 20 characters to accommodate all current and future SolaX EV Charger models.

Suggested Fix

In config_flow.py, change both occurrences of max=10 to max=20 (or remove the length restriction entirely):

# CONFIG_SCHEMA
vol.Required(CONF_SN): vol.All(
    str, vol.Length(max=20, msg="invalid_sn_length")
),

# OPTION_SCHEMA
vol.Required(CONF_SN): vol.All(str, vol.Length(max=20)),

Environment

  • Integration version: v1.4.1
  • Home Assistant: 2026.03.x
  • EV Charger model: SolaX X3-EVC (serial number prefix C322)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions