Skip to content

HA MQTT Discovery creates Unnamed devices #292

Open
@kickouille

Description

@kickouille

Describe the bug
An unnamed MQTT device is created in Home Assistant for each gateway and the devices the gateway detected go under "Connected devices" section.

To Reproduce
Simply enable ha discovery and get some devices discovered.

Expected behavior
This unnamed device should not be created, or if it represents the gateway, it should get the name the gateway, along with the firmware version for example, and eventually information about its status, and show the devices it is connected (linked) to).

Screenshots

Image Image

Environment
Using gateway 1.5.0 with Home Assistant 2025.2.5

Additional context
My guess is that cns list below is not properly formatted and maybe misused:

{
  "stat_t": "+/+/BTtoMQTT/AABBCCDDEEFF",
  "dev_cla": "illuminance",
  "unit_of_meas": "lx",
  "state_class": "measurement",
  "name": "CGPR1-lux",
  "uniq_id": "AABBCCDDEEFF-lux",
  "val_tpl": "{{ value_json.lux | is_defined }}",
  "device": {
    "ids": [
      "AABBCCDDEEFF"
    ],
    "cns": [
      [
        "mac",
        "AABBCCDDEEFF"
      ]
    ],
    "mf": "Qingping",
    "mdl": "CGPR1",
    "name": "Motion & Light-DDEEFF",
    "via_device": "TheengsGateway2"
  }
}

cns should be used to link the discovered device to another device which represents the gateway itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions