Skip to content

Solis MQTT discovery publishes invalid sensor topics when inverter serial is empty #519

@SruiSan

Description

@SruiSan

Under certain conditions, the Solis integration creates sensors with an empty inverter serial.
This results in invalid MQTT discovery topics like:

homeassistant/sensor//current_power/config

and invalid device identifiers:

"identifiers": ["solismqtt_"]

Root cause:

sensor.py creates entities without validating inverter_sn

unique_id is built using possibly empty data

Proposed fix:

Skip discovery when inverter_sn is empty

Enforce non-empty serial in SolisSensor.init

Build unique_id using {DOMAIN}{inverter_sn}{sensor_type}

This prevents invalid MQTT discovery and retained garbage topics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions