MQTT Discovery not working?

Currently running 0.85.1 and zigbee2mqtt. I believe I have everything configure correctly, but my Xiaomi PIR sensor is not showing up in my entity list. Here’s what my relevant config.yaml looks like:

mqtt:
  broker: homeassistant # This will have to be your mqtt broker
  discovery: true

Here’s a log snippet (the last line is what I would expect to create the sensor):

zigbee2mqtt:info 2019-1-22 18:31:55 Logging to directory: '/share/zigbee2mqtt/log/2019-01-22.18-31-54'
  zigbee2mqtt:info 2019-1-22 18:31:55 Starting zigbee2mqtt version 1.0.1 (commit #fcfeac8)
  zigbee2mqtt:info 2019-1-22 18:31:55 Starting zigbee-shepherd
  zigbee2mqtt:info 2019-1-22 18:31:58 zigbee-shepherd started
  zigbee2mqtt:info 2019-1-22 18:31:58 Coordinator firmware version: 'undefined'
  zigbee2mqtt:info 2019-1-22 18:31:58 Currently 1 devices are joined:
  zigbee2mqtt:info 2019-1-22 18:31:58 0x00158d0001ad6282 (0x00158d0001ad6282): RTCGQ11LM - Xiaomi Aqara human body movement and illuminance sensor (EndDevice)
  zigbee2mqtt:info 2019-1-22 18:31:58 Zigbee: disabling joining new devices.
  zigbee2mqtt:info 2019-1-22 18:31:58 Connecting to MQTT server at mqtt://homeassistant
  zigbee2mqtt:info 2019-1-22 18:31:58 zigbee-shepherd ready
  zigbee2mqtt:info 2019-1-22 18:31:59 Connected to MQTT server
  zigbee2mqtt:info 2019-1-22 18:31:59 MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
  zigbee2mqtt:info 2019-1-22 18:31:59 MQTT publish: topic 'zigbee2mqtt/0x00158d0001ad6282', payload '{"illuminance":0,"linkquality":7,"occupancy":false}'
  zigbee2mqtt:info 2019-1-22 18:31:59 MQTT publish: topic 'homeassistant/binary_sensor/0x00158d0001ad6282/occupancy/config', payload '{"payload_on":true,"payload_off":false,"value_template":"{{ value_json.occupancy }}","device_class":"motion","state_topic":"zigbee2mqtt/0x00158d0001ad6282","json_attributes_topic":"zigbee2mqtt/0x00158d0001ad6282","name":"0x00158d0001ad6282_occupancy","unique_id":"0x00158d0001ad6282_occupancy_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0x00158d0001ad6282","name":"0x00158d0001ad6282","sw_version":"Zigbee2mqtt 1.0.1","model":"Aqara human body movement and illuminance sensor (RTCGQ11LM)","manufacturer":"Xiaomi"},"availability_topic":"zigbee2mqtt/bridge/state"}'

Any ideas - or am I doing something stupid :slight_smile:

TIA for your help!!

It looks like you are missing the discovery prefix.

mqtt:
  discovery: true
  discovery_prefix: homeassistant

Sorry this doesn’t make sense. I must be a nob. mqtt explorer shows <host> => owntracks => <username> => entity

Home Assistant isn’t picking it up at all but doesn’t throw any errors.

why would there be a prefix given that every single device would be <some device> => username => entity???

Also all of this is done in the UI now and there is no option for the prefix and the instructions are out of date not actually referencing how to configure this in the UI since yaml is discurraged.

1 Like