Zigbee2mqtt devices not auto added to lovelace?

I’ve got a question.
I’m new to zigbee2mqtt so maybe it’s a stupid question but i can’t find a solution anywhere.

I have Discovery on ( true) and can see the device in the entity list but isn’t it supposed to be auto added to the lovelace dashboard in some way? How do i do that.
If i manually add it it’s displayed and working allright. It’s a switch TS0001
In the log:
2020-03-25 13:12:00: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"devices","message":[{"ieeeAddr":"0x00124b0018e300f7","type":"Coordinator","networkAddress":0,"friendly_name":"Coordinator","softwareBuildID":"zStack30x","dateCode":"20190425","lastSeen":1585138320108},{"ieeeAddr":"0xec1bbdfffe9202d3","type":"Router","networkAddress":27281,"model":"TS0001","vendor":"CR Smart Home","description":"Valve control","friendly_name":"0xec1bbdfffe9202d3","manufacturerID":0,"manufacturerName":"_TYZB01_seqwasot","powerSource":"Mains (single phase)","modelID":"TS0001","lastSeen":1585138203915}]}'

In the devices.js of zigbee2mqtt it’s supported:

       zigbeeModel: ['TS0001'],
       model: 'TS0001',
       vendor: 'CR Smart Home',
       description: 'Valve control',
       supports: 'control',
       fromZigbee: [fz.on_off],
       toZigbee: [tz.on_off],
   },

Configuration.yaml

mqtt:
  discovery: true
  broker:XXXXXXX
  port: XXXXXXX
  username: XXXXXXX
  password: XXXXXXX
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

OR i’m totally wrong and the switches and other zigbee2mqtt devices won’t be added to Lovelace automatically.

I’ve also read this:

Any ideas? Please help me.

No, you put what you want on your lovelace dashboard.

OK , but i’m confused now because of this text in zigbee2mqtt:

Although Home Assistant integration through MQTT discovery is preferred, 
manual integration is possible with the following configuration:

switch:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_off: "OFF"
    payload_on: "ON"
    value_template: "{{ value_json.state }}"
    command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/set"

So it says it should be auto added…right ?

You said the device was auto-added…

You are right!
My bad, it’s in the entity list of Home Assistant because of my manual editing.
So it’s not auto added to the entity list nor Lovelace dashboard.

I’ve removed all the configuration and rebooted. The entity is gone now.
Zigbee2mqtt sees the device and it’s paired

Running zigbee2mqtt 1.12.0 and 0.107.6

This is what the log says:

igbee2mqtt:info  2020-03-25 15:09:20: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
zigbee2mqtt:info  2020-03-25 15:09:20: MQTT publish: topic 'zigbee2mqtt/0xec1bbdfffe9202d3', payload '{"state":"OFF","linkquality":52}'
zigbee2mqtt:info  2020-03-25 15:09:21: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.12.0","commit":"unknown","coordinator":{"type":"zStack30x","meta":{"transportrev":2,"product":2,"majorrel":2,"minorrel":7,"maintrel":2,"revision":20190425}},"log_level":"info","permit_join":true}'
zigbee2mqtt:info  2020-03-25 15:09:21: MQTT publish: topic 'homeassistant/switch/0xec1bbdfffe9202d3/switch/config', payload '{"payload_off":"OFF","payload_on":"ON","value_template":"{{ value_json.state }}","command_topic":"zigbee2mqtt/0xec1bbdfffe9202d3/set","state_topic":"zigbee2mqtt/0xec1bbdfffe9202d3","json_attributes_topic":"zigbee2mqtt/0xec1bbdfffe9202d3","name":"0xec1bbdfffe9202d3_switch","unique_id":"0xec1bbdfffe9202d3_switch_zigbee2mqtt","device":{"identifiers":["zigbee2mqtt_0xec1bbdfffe9202d3"],"name":"0xec1bbdfffe9202d3","sw_version":"Zigbee2mqtt 1.12.0","model":"Valve control (TS0001)","manufacturer":"CR Smart Home"},"availability_topic":"zigbee2mqtt/bridge/state"}'
zigbee2mqtt:info  2020-03-25 15:09:21: MQTT publish: topic 'homeassistant/sensor/0xec1bbdfffe9202d3/linkquality/config', payload '{"icon":"mdi:signal","unit_of_measurement":"lqi","value_template":"{{ value_json.linkquality }}","state_topic":"zigbee2mqtt/0xec1bbdfffe9202d3","json_attributes_topic":"zigbee2mqtt/0xec1bbdfffe9202d3","name":"0xec1bbdfffe9202d3_linkquality","unique_id":"0xec1bbdfffe9202d3_linkquality_zigbee2mqtt","device":{"identifiers":["zigbee2mqtt_0xec1bbdfffe9202d3"],"name":"0xec1bbdfffe9202d3","sw_version":"Zigbee2mqtt 1.12.0","model":"Valve control (TS0001)","manufacturer":"CR Smart Home"},"availability_topic":"zigbee2mqtt/bridge/state"}'

So it’s published to Home Assistant…but nowhere to be found
‘homeassistant’ is default topic for the switch to be discovered…

Confirm that you have no entity called

switch.0xec1bbdfffe9202d3_switch

?

Confirmed…nothing in the entity list with :
0xec1bbdfffe9202d3

OK - so presuming there never has been so it hasn’t been renamed, the likely culprits here are that…

  • homeassistant is speaking to a different mqtt broker than zigbee2mqtt

  • discovery isn’t working

I thought: Maybe it’s the MQTT server settings in Home Assistant so i changed the port from 8883 to 1883. But no, nothing. And when i think of it , my MQTT alarm panel works flawless. So i think something else is wrong with Home Assistant.

I’ve checked the MQTT topic # and this is what it says:

Message 8 received on homeassistant/switch/0xec1bbdfffe9202d3/switch/config at 3:47 PM:

{
    "payload_off": "OFF",
    "payload_on": "ON",
    "value_template": "{{ value_json.state }}",
    "command_topic": "zigbee2mqtt/0xec1bbdfffe9202d3/set",
    "state_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "json_attributes_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "name": "0xec1bbdfffe9202d3_switch",
    "unique_id": "0xec1bbdfffe9202d3_switch_zigbee2mqtt",
    "device": {
        "identifiers": [
            "zigbee2mqtt_0xec1bbdfffe9202d3"
        ],
        "name": "0xec1bbdfffe9202d3",
        "sw_version": "Zigbee2mqtt 1.12.0",
        "model": "Valve control (TS0001)",
        "manufacturer": "CR Smart Home"
    },
    "availability_topic": "zigbee2mqtt/bridge/state"
}

So…now i’m clueless again…

If that was the case: the MQTT alarm panel shouldn’t work either (?)

Does mqtt alarm panel rely on being connected to the same broker as zigbee2mqtt?

If they’re definitely talking to the same broker and both can see each other’s messages, then I’m at a bit of a loss too, sorry :man_shrugging:

Yes, i only have 1 MQTT broker and it’s connecting to the same one.
When i listen to MQTT through developer options it’s being published to that broker AND Home Assistant displays it here. So it’s definitely listening to the right broker :frowning:

Changing the port didn’t help a thing. As expected.

It seems something is broken in the Discovery part? But how to fix it.

Just to make sure the same MQTT broker is used :wink:

 Message 11 received on home/alarm at 4:35 PM:

disarmed

QoS: 0 - Retain: false
Message 10 received on home/alarm at 4:35 PM:

pending

QoS: 0 - Retain: false
Message 9 received on homeassistant/sensor/0xec1bbdfffe9202d3/linkquality/config at 4:31 PM:

{
    "icon": "mdi:signal",
    "unit_of_measurement": "lqi",
    "value_template": "{{ value_json.linkquality }}",
    "state_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "json_attributes_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "name": "0xec1bbdfffe9202d3_linkquality",
    "unique_id": "0xec1bbdfffe9202d3_linkquality_zigbee2mqtt",
    "device": {
        "identifiers": [
            "zigbee2mqtt_0xec1bbdfffe9202d3"
        ],
        "name": "0xec1bbdfffe9202d3",
        "sw_version": "Zigbee2mqtt 1.12.0",
        "model": "Valve control (TS0001)",
        "manufacturer": "CR Smart Home"
    },
    "availability_topic": "zigbee2mqtt/bridge/state"
}

QoS: 0 - Retain: true
Message 8 received on homeassistant/switch/0xec1bbdfffe9202d3/switch/config at 4:31 PM:

{
    "payload_off": "OFF",
    "payload_on": "ON",
    "value_template": "{{ value_json.state }}",
    "command_topic": "zigbee2mqtt/0xec1bbdfffe9202d3/set",
    "state_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "json_attributes_topic": "zigbee2mqtt/0xec1bbdfffe9202d3",
    "name": "0xec1bbdfffe9202d3_switch",
    "unique_id": "0xec1bbdfffe9202d3_switch_zigbee2mqtt",
    "device": {
        "identifiers": [
            "zigbee2mqtt_0xec1bbdfffe9202d3"
        ],
        "name": "0xec1bbdfffe9202d3",
        "sw_version": "Zigbee2mqtt 1.12.0",
        "model": "Valve control (TS0001)",
        "manufacturer": "CR Smart Home"
    },
    "availability_topic": "zigbee2mqtt/bridge/state"
}

If you click on configuration -> integrations -> mqtt, discovery is selected ?

Yes and to be sure the settings were all right i disabled it and enabled it and then rebooted. Result…nothing added or visible.

I’m getting frustrated right now. Everything is configured properly, every setting is checked multiple times…i really don’t understand why it’s not working.
I was planning to use zwave2mqtt too but if this isn’t working right then zwave2mqtt will be hell also.

Guys i got it !!!

Plowing through the logfile i found this:

MQTT Addon: “Data in your config entry is going to override your configuration”

Discovery that was shown was set to False there.

What i did to fix it:
Configuration ->Integrations. Select MQTT …delete it…reboot…it works!
It now says MQTT:configuration.yaml instead of MQTT only

Thanks for all your answers and trying to help me out! Very much appreciated!

1 Like