[SOLVED] Zigbee2MQTT - unable to permit joining

Hi :slight_smile:

Fresh install of the latest version of HA on my Odroid XU-4

Mosqito broker and Zigbee2Mqtt addon installed

I have put this script from the git of the zigbee2mqtt project :

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

But nothing happen when I click on join… I cannot pair any of my zigbee devices

Here’s my zigbee2mqtt log :

Blockquote
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
./run.sh: line 17: [Info] Configuration backup found in /share/zigbee2mqtt/.configuration.yaml.bk. Skipping config backup.: No such file or directory
[Info] Socat is DISABLED and not started
2020-03-10T12:57:59: PM2 log: Launching in no daemon mode
2020-03-10T12:57:59: PM2 log: App [npm:0] starting in -fork mode-
2020-03-10T12:57:59: PM2 log: App [npm:0] online
[email protected] start /zigbee2mqtt-1.11.0
node index.js
zigbee2mqtt:info 2020-03-10 12:58:03: Logging to console and directory: ‘/share/zigbee2mqtt/log/2020-03-10.12-58-02’ filename: log.txt
zigbee2mqtt:info 2020-03-10 12:58:03: Starting zigbee2mqtt version 1.11.0 (commit #unknown)
zigbee2mqtt:info 2020-03-10 12:58:03: Starting zigbee-herdsman…
zigbee2mqtt:info 2020-03-10 12:58:05: zigbee-herdsman started
zigbee2mqtt:info 2020-03-10 12:58:05: Coordinator firmware version: ‘{“type”:“zStack12”,“meta”:{“transportrev”:2,“product”:0,“majorrel”:2,“minorrel”:6,“maintrel”:3,“revision”:20190608}}’
zigbee2mqtt:info 2020-03-10 12:58:05: Currently 0 devices are joined:
zigbee2mqtt:info 2020-03-10 12:58:05: Zigbee: disabling joining new devices.
zigbee2mqtt:info 2020-03-10 12:58:05: Connecting to MQTT server at mqtt://core-mosquitto
zigbee2mqtt:info 2020-03-10 12:58:05: Connected to MQTT server
zigbee2mqtt:info 2020-03-10 12:58:05: MQTT publish: topic ‘zigbee2mqtt/bridge/state’, payload ‘online’
zigbee2mqtt:info 2020-03-10 12:58:06: MQTT publish: topic ‘zigbee2mqtt/bridge/config’, payload ‘{“version”:“1.11.0”,“commit”:“unknown”,“coordinator”:{“type”:“zStack12”,“meta”:{“transportrev”:2,“product”:0,“majorrel”:2,“minorrel”:6,“maintrel”:3,“revision”:20190608}},“log_level”:“info”,“permit_join”:false}’

Any ideas ? :thinking:

Thanks :wink:

It seems your ‘join’ message is never received by zigbee2mqtt. Are your mqtt settings for zigbee2mqtt correct ?

I have no error messages from the mqtt brocker either :thinking:

How can I be sure of that ?

Was a sensor sensor.coordinator_version created?

No, I’ve no such sensor into my entities

Then there is something wrong with either

  • communication between zigbee2mqtt and your broker
  • communication between your broker and HA

Best way to troubleshoot is installing a mqtt client like mqtt explorer or mqtt fx and see what messages pass through your broker.

Doesn’t mean that the connection of this plugin to my mqtt broker is correct ?

You still have to test this

This

MQTT publish: topic ‘zigbee2mqtt/bridge/config’, payload ‘{“version”:“1.11.0”,“commit”:“unknown”,“coordinator”:{“type”:“zStack12”,“meta”:{“transportrev”:2,“product”:0,“majorrel”:2,“minorrel”:6,“maintrel”:3,“revision”:20190608}},“log_level”:“info”,“permit_join”:false}’

is where zigbee2mqtt creates your sensor.coordinator_version sensor, but since that is never created there is still something wrong between broker and HA. Also, in the zigbee2mqtt log you should see an entry that pairing is enabled when you toggle the switch, that is not there either.

Then I’m out of ideas… I just installed the mosquitto broker, add a user/password, put them into the config field, that’s all.

What have I missed then ? :thinking:

Hit ‘start listening’, then hit ‘publish’. You should see your message under ‘Listen to a topic’

No, nothing happen…

Show how you configured your broker in HA. HA is not communicating with your broker.

logins:
  - username: mqtt
    password: 'O{>3j7Mi-q'
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Don’t mind the key :smiley:

And you added the mqtt configuration ?

image

The file seems to be present, but empty

Make sure your configuration.yaml contains the following :

mqtt:
  broker: core-mosquitto
  port: 1883
  discovery: true
  discovery_prefix: homeassistant
  username: mqtt
  password: 'O{>3j7Mi-q'
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'  

Thanks a lot :slight_smile:

This is working now :slight_smile: :slight_smile: