[FIXED] MQTT finds device but doesn't show

I am looking at getting rid of my current Xiaomi Gateway and have setup Mosquito Broker and Zigbee2MQTT as per the instructions I have found (I have the board configured). And they appear to talk to one another without issue. I also setup the 10min timer for discovering devices as found in the documentation.

When trying to add a new Zigbee device, looking at the logs of Zigbee2MQTT it appears to find the device and it’s details okay, but I cannot find the device as an Entity anywhere.

Have included logs and configuraton below. Not sure why the devices aren’t showing. Running Hass.IO 0.107.7 as a fresh install before doing anything with my currenty running install (using Xiaomi Gateway).
Configuration.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

mqtt:
  broker: core-mosquitto # This will have to be your mqtt broker, Mosquitto addon is recommended.
  discovery: true

input_boolean:
  zigbee_permit_join:
    name: Allow devices to join
    initial: off
    icon: mdi:cellphone-wireless

timer:
  zigbee_permit_join:
    name: Time remaining
    duration: 600 # Updated this to the number of seconds you wish

sensor:
  - platform: mqtt
    name: Bridge state
    state_topic: "zigbee2mqtt/bridge/state"
    icon: mdi:router-wireless

automation:
  - id: enable_zigbee_join
    alias: Enable Zigbee joining
    trigger:
      platform: state
      entity_id: input_boolean.zigbee_permit_join
      to: 'on'
    action:
    - service: mqtt.publish
      data:
        topic: zigbee2mqtt/bridge/config/permit_join
        payload: 'true'
    - service: timer.start
      data:
        entity_id: timer.zigbee_permit_join
  - id: disable_zigbee_join
    alias: Disable Zigbee joining
    trigger:
    - entity_id: input_boolean.zigbee_permit_join
      platform: state
      to: 'off'
    action:
    - data:
        payload: 'false'
        topic: zigbee2mqtt/bridge/config/permit_join
      service: mqtt.publish
    - data:
        entity_id: timer.zigbee_permit_join
      service: timer.cancel
  - id: disable_zigbee_join_timer
    alias: Disable Zigbee joining by timer
    trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.zigbee_permit_join
    action:
    - service: mqtt.publish
      data:
        topic: zigbee2mqtt/bridge/config/permit_join
        payload: 'false'
    - service: input_boolean.turn_off
      data:
        entity_id: input_boolean.zigbee_permit_join

Mosquito Broker config:

logins: []
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Mosquito Broker log:

[11:15:32] INFO: Setup mosquitto configuration
[11:15:32] WARNING: SSL not enabled - No valid certs found!
[11:15:32] INFO: No local user available
[11:15:32] INFO: Initialize Hass.io Add-on services
[11:15:32] INFO: Initialize Home Assistant discovery
[11:15:32] INFO: Start Mosquitto daemon
1586567732: mosquitto version 1.6.3 starting
1586567732: Config loaded from /etc/mosquitto.conf.
1586567732: Loading plugin: /usr/share/mosquitto/auth-plug.so
1586567732: |-- *** auth-plug: startup
1586567732:  ├── Username/password checking enabled.
1586567732:  ├── TLS-PSK checking enabled.
1586567732:  └── Extended authentication not enabled.
1586567732: Opening ipv4 listen socket on port 1883.
1586567732: Opening ipv6 listen socket on port 1883.
1586567732: Opening websockets listen socket on port 1884.
1586567732: Warning: Mosquitto should not be run as root/administrator.
1586567733: New connection from 172.30.33.1 on port 1883.
[INFO] found mqtt on Home Assistant
1586567733: New client connected from 172.30.33.1 as mqttjs_dd849d93 (p2, c1, k60, u'mqtt').
1586567806: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1586567806: New client connected from 172.30.32.1 as auto-A0E17B1C-B4F5-BCF7-3F5D-4D41789B3C14 (p2, c1, k60, u'homeassistant').

Zigbee2MQTT config:

data_path: /share/zigbee2mqtt
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://core-mosquitto'
  user: <user>
  password: <password>
serial:
  port: /dev/ttyACM0
advanced:
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blacklist: []
ban: []
whitelist: []
queue: {}
socat:
  enabled: false
  master: 'pty,raw,echo=0,link=/dev/ttyZ2M,mode=777'
  slave: 'tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5'
  restartdelay: 1
  initialdelay: 1
  options: '-d -d'
  log: false

Zigbee2MQTT log:

zigbee2mqtt:info  2020-04-11 11:05:46: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_removed","message":"left_network","meta":{"friendly_name":"0x00158d0001dc0a1a"}}'
zigbee2mqtt:info  2020-04-11 11:05:53: Device '0x00158d0001dc0a1a' joined
zigbee2mqtt:info  2020-04-11 11:05:53: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":{"friendly_name":"0x00158d0001dc0a1a"}}'
zigbee2mqtt:info  2020-04-11 11:05:53: Starting interview of '0x00158d0001dc0a1a'
zigbee2mqtt:info  2020-04-11 11:05:53: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_started","meta":{"friendly_name":"0x00158d0001dc0a1a"}}'
zigbee2mqtt:info  2020-04-11 11:05:54: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_announced","message":"announce","meta":{"friendly_name":"0x00158d0001dc0a1a"}}'
zigbee2mqtt:info  2020-04-11 11:05:54: Successfully interviewed '0x00158d0001dc0a1a', device has successfully been paired
zigbee2mqtt:info  2020-04-11 11:05:54: Device '0x00158d0001dc0a1a' is supported, identified as: Xiaomi Mi power plug ZigBee (ZNCZ02LM)
zigbee2mqtt:info  2020-04-11 11:05:54: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"interview_successful","meta":{"friendly_name":"0x00158d0001dc0a1a","model":"ZNCZ02LM","vendor":"Xiaomi","description":"Mi power plug ZigBee","supported":true}}'
zigbee2mqtt:info  2020-04-11 11:05:55: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":25,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:05:56: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":25,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:05:56: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":25,"linkquality":89}'

So, if I am understanding the log correctly, the device (in this case a Xiaomi power plug) is being recognised/discovered without issue. So, not sure why it is not showing up. When I look at the Mosquite integration and devices, it lists none. If I check the System Options within the Integration it has ‘enable newly added entities’ enabled.

This is running in a VM on an Intel Nuc. A while back I also briefly tried on a RPi and had devices there add and show successfully. My preference is to use the NUC (where my current Hass.IO install is) and a VM to keep all my machines together.

I assume that when you say it’s not showing up you mean it’s absent from Configuration > Entities view and Developer Tools > States view.

You appear to have configured everything needed to enable MQTT Discovery. That means if zigbee2mqtt publishes the correct payload to this ’ discovery topic’:

homeassistant/switch/0x00158d0001dc0a1a/config

then an entity called switch.0x00158d0001dc0a1a will be created.

Maybe the zigbee2mqtt log you posted is just a fragment of everything it has logged because what I don’t see listed is when it published to that discovery topic I described.

Yes, that is correct. It is not showing in either Configuration > Entities view or Developer Tools > States view.

I will see if there is a more detailed log somewhere or increase the logging level.

I did also just install the Zigbee2MQTTAssistant plug-in and it shows both the plug I have added as well as the controller which seems to the the USB Zigbee device.

I’m not sure if this is what you were referring to?

zigbee2mqtt:info  2020-04-11 11:15:33: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
zigbee2mqtt:info  2020-04-11 11:17:09: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":39,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:24:42: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":39,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:30:14: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":39,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:37:02: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":39,"linkquality":92}'
zigbee2mqtt:info  2020-04-11 11:43:16: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":39,"linkquality":94}'
zigbee2mqtt:info  2020-04-11 11:43:35: MQTT publish: topic 'zigbee2mqtt/bridge/config/devices', payload '[{"ieeeAddr":"0x00124b00039d66e1","type":"Coordinator","networkAddress":0,"friendly_name":"Coordinator","softwareBuildID":"zStack12","dateCode":"20190608","lastSeen":1586569415820},{"ieeeAddr":"0x00158d0001dc0a1a","type":"Router","networkAddress":6547,"model":"ZNCZ02LM","vendor":"Xiaomi","description":"Mi power plug ZigBee","friendly_name":"0x00158d0001dc0a1a","manufacturerID":4447,"manufacturerName":"LUMI","powerSource":"Mains (single phase)","modelID":"lumi.plug","hardwareVersion":18,"dateCode":"04-20-2018","lastSeen":1586569403248}]'
zigbee2mqtt:info  2020-04-11 11:43:35: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"devices","message":[{"ieeeAddr":"0x00124b00039d66e1","type":"Coordinator","networkAddress":0,"friendly_name":"Coordinator","softwareBuildID":"zStack12","dateCode":"20190608","lastSeen":1586569415835},{"ieeeAddr":"0x00158d0001dc0a1a","type":"Router","networkAddress":6547,"model":"ZNCZ02LM","vendor":"Xiaomi","description":"Mi power plug ZigBee","friendly_name":"0x00158d0001dc0a1a","manufacturerID":4447,"manufacturerName":"LUMI","powerSource":"Mains (single phase)","modelID":"lumi.plug","hardwareVersion":18,"dateCode":"04-20-2018","lastSeen":1586569403248}]}'
zigbee2mqtt:info  2020-04-11 11:44:00: Starting network scan (includeRoutes 'false')
zigbee2mqtt:info  2020-04-11 11:44:01: Network scan finished
zigbee2mqtt:info  2020-04-11 11:44:01: MQTT publish: topic 'zigbee2mqtt/bridge/networkmap/raw', payload '{"nodes":[{"ieeeAddr":"0x00124b00039d66e1","friendlyName":"Coordinator","type":"Coordinator","networkAddress":0,"failed":[],"lastSeen":null},{"ieeeAddr":"0x00158d0001dc0a1a","friendlyName":"0x00158d0001dc0a1a","type":"Router","networkAddress":6547,"manufacturerName":"LUMI","modelID":"lumi.plug","failed":[],"lastSeen":1586569403248}],"links":[{"source":{"ieeeAddr":"0x00158d000231e452","networkAddress":49629},"target":{"ieeeAddr":"0x00124b00039d66e1","networkAddress":0},"linkquality":23,"depth":1,"routes":[],"sourceIeeeAddr":"0x00158d000231e452","targetIeeeAddr":"0x00124b00039d66e1","sourceNwkAddr":49629,"lqi":23,"relationship":1},{"source":{"ieeeAddr":"0x00158d0001dc0a1a","networkAddress":6547},"target":{"ieeeAddr":"0x00124b00039d66e1","networkAddress":0},"linkquality":93,"depth":1,"routes":[],"sourceIeeeAddr":"0x00158d0001dc0a1a","targetIeeeAddr":"0x00124b00039d66e1","sourceNwkAddr":6547,"lqi":93,"relationship":1},{"source":{"ieeeAddr":"0x00158d000201649a","networkAddress":30754},"target":{"ieeeAddr":"0x00124b00039d66e1","networkAddress":0},"linkquality":170,"depth":1,"routes":[],"sourceIeeeAddr":"0x00158d000201649a","targetIeeeAddr":"0x00124b00039d66e1","sourceNwkAddr":30754,"lqi":170,"relationship":1},{"source":{"ieeeAddr":"0x00124b00039d66e1","networkAddress":0},"target":{"ieeeAddr":"0x00158d0001dc0a1a","networkAddress":6547},"linkquality":102,"depth":0,"routes":[],"sourceIeeeAddr":"0x00124b00039d66e1","targetIeeeAddr":"0x00158d0001dc0a1a","sourceNwkAddr":0,"lqi":102,"relationship":0}]}'
zigbee2mqtt:info  2020-04-11 11:48:00: MQTT publish: topic 'zigbee2mqtt/bridge/config/devices', payload '[{"ieeeAddr":"0x00124b00039d66e1","type":"Coordinator","networkAddress":0,"friendly_name":"Coordinator","softwareBuildID":"zStack12","dateCode":"20190608","lastSeen":1586569680031},{"ieeeAddr":"0x00158d0001dc0a1a","type":"Router","networkAddress":6547,"model":"ZNCZ02LM","vendor":"Xiaomi","description":"Mi power plug ZigBee","friendly_name":"0x00158d0001dc0a1a","manufacturerID":4447,"manufacturerName":"LUMI","powerSource":"Mains (single phase)","modelID":"lumi.plug","hardwareVersion":18,"dateCode":"04-20-2018","lastSeen":1586569675245}]'
zigbee2mqtt:info  2020-04-11 11:48:00: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"devices","message":[{"ieeeAddr":"0x00124b00039d66e1","type":"Coordinator","networkAddress":0,"friendly_name":"Coordinator","softwareBuildID":"zStack12","dateCode":"20190608","lastSeen":1586569680043},{"ieeeAddr":"0x00158d0001dc0a1a","type":"Router","networkAddress":6547,"model":"ZNCZ02LM","vendor":"Xiaomi","description":"Mi power plug ZigBee","friendly_name":"0x00158d0001dc0a1a","manufacturerID":4447,"manufacturerName":"LUMI","powerSource":"Mains (single phase)","modelID":"lumi.plug","hardwareVersion":18,"dateCode":"04-20-2018","lastSeen":1586569675245}]}'
zigbee2mqtt:info  2020-04-11 11:50:28: MQTT publish: topic 'zigbee2mqtt/0x00158d0001dc0a1a', payload '{"state":"OFF","power":0,"voltage":null,"consumption":25.42,"temperature":40,"linkquality":92}'

Looks as though I have now fixed this.
I removed the MQTT config from configuration.yaml and removed the MQTT integration.
I then rebooted and added the integration again saying to discover and the plug has now appeared as expected. I have also added another test device and had it show successfully.

Well done!