Device manually added (zigbee2mqtt) but not visible by mqtt broker

I have manually added a device to the devices.js file. The device is visible by zigbee2mqtt and so it appears on the Zigbee map too.

"0x000d6ffffe62fa15" [style="rounded, filled", fillcolor="#4ea3e0", fontcolor="#ffffff", label="{0x000d6ffffe62fa15|0xb738 |IKEA TRADFRI LED bulb E27 WW clear 250 lumen, dimmable (LED1842G3)|online (01:00:56s ago)}"];

The problem I have is that the device is not visible by the mosquitto broker (MQTT).

The process I have followed:

  1. I successfully paired the IKEA bulb with zigbee2mqtt
  2. I found the device visible by zigbee2mqtt but it appeared as “unknown”
  3. I added the device to devices.js and so it is now fully recognised by zigbee2mqtt
  4. The device get listed on devices.yaml
  5. The device does not show up on mosquitto broker despite having configured:
mqtt:
  discovery: true
  discovery_prefix: homeassistant

(this is not the complete mqtt: configuration)

I have restarted hassio but still the device does not show up on “Configuration -> Integrations”

What step am I missing?

Some more info:

HA ver. 100.3
Mosquitto broker ver. 5.1
zigbee2mqtt ver 1.6.0

If I manually add the Zigbee device to the MQTT database (with MQTT Explorer) I see how it receives updates from zigbee2mqtt. Still the device does not show up under “Configuration -> Integration -> MQTT: Mosquito broker”.

Any help appreciated.

WORKAROUND:

  1. Go to /config/.storage/core.config_entries
  2. Delete entry concerning MQTT configuration entry
  3. Go to zigbee2mqtt Supported Devices and identify your device
  4. Configure your device on configuration.yaml file

The problem I had was due step#1 because it disregards the mqtt configuration on configuration.yaml

Still, I wonder why the device does not get automatically discovered by MQTT.

I did the same thing but it did not work out for me.

I have added the following to /config/configuration.yaml:

mqtt:
  discovery: true
  discovery_prefix: homeassistant

I have also added the following to /config/configuration.yaml and replaced the <FRIENDLY_NAME> with the friendly name of the device:

light:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    brightness: true
    color_temp: true
    xy: true
    schema: "json"
    command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/set"

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    unit_of_measurement: "-"
    value_template: "{{ value_json.linkquality }}"

MQTT is working fine but the device is not listed in Configuration\Integrations nor is it listed in Configuration\Devices

Is there anything else that I should lookout for?

I do not know the <FRIENDLY_NAME> you are using. If you follow my case above, the string I use on <FRIENDLY_NAME> is “0x000d6ffffe62fa15”, which is not that “friendly”.
Otherwise, your configuration looks very much like mine.

Yes, I’m using a similar not so friendly name as well but it does not work for me. Guess, it’s back to reading the docs and trying other possible solutions. Thanks for sharing.

You have added a mqtt section, but not configured a mqtt broker ?

My mqtt section looks like this :

mqtt:
  broker: 10.0.0.63
  port: 1883
  discovery: true
  discovery_prefix: homeassistant
  username: xxxx
  password: xxxx
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'  
    

I see now that my mqtt: configuration can be confusing. I have now added a clarification.

For me, adding the complete mqtt configuration in the configuration.yaml did not work either. It produces the following error:

Data in your config entry is going to override your configuration.yaml: {'broker': 'some.broker.url', 'discovery': True, 'password': '...

For now, I just have to add the devices manually.

I ended up modifying /config/.storage/core.device_registry and /config/.storage/core.entity_registry manually. Just copy a sample from other devices that are in there to manually add devices.

There is a “device_id” which I had to randomly create since I did not know where to generate or retrieve them from.

I also had to modify /config/configuration.yaml to add:

light:
  - platform: "mqtt"
    unique_id: "SOME_UNIQUE_ID_FROM_core.entity_registry"
    ...

sensor:
  - platform: "mqtt"
    unique_id: "SOME_UNIQUE_ID_FROM_core.entity_registry"
    ...

It kind of works as it shows up in the Configuration/Integrations, Devices section as well as the home screen dashboard.

See my third post.