Zigbee2mqtt: getting rid of your proprietary Zigbee bridges (Xiaomi, Hue, TRADFRI)

ok
I will try today one more time.

Guys, some advice on CC Debugger.

Just bought one from ebay and it looks very much like the real CC Debugger (its circuit board says V1.0).

After installing the drivers (both Windows 7 and 10, two distinct computers) when I connect CC Debugger it’s not recognized.

On both cases it shows as Unknown USB Device (Device Descriptor Request Failed).

If I force the device to use TI’s driver I receive an error saying the folder doesn’t contain a compatible software driver for the device.

It seems to me my CC Debugger is not working properly and the best course of action is just order a new one.

Did anyone face the same issue with CC Debugger?

I had big problems setting up the CC-Debugger. I had to install Windows on my iMac…And after many trial and error I burned my CC-Debugger…Finally I bought ready to use cc2531 with zigbee2mqtt from flashedfirmware.com I got one for concentrator and two routers and they all work perfect.

let’s hope they are flashed with Serial Boot Loader (SBL) so that you can upload different firmwares :slight_smile:

I have no experience with SBL, but as I understood the CC2531 has to be flashed once with a CC Debugger.
After that you can use SBL to flash it.

Or do we have todlangweilig another firmware with the CC Debugger to make it ready for SBL? @koenkk

Hey, i have one weird thing.
I have few Aqara LED bulb (ZNLDP12LM) and few IKEA Tradfri.
When i switch off the Aqara (any one) from the HA UI then the switch is going off >> after “10 milliseconds” is on >> another “10 milliseconds” going to off (OFF - ON - OFF) - light goes off normaly. This situation isn`t available on IKEA Tradfrii lights. Have anyone any clue why this is?

Hey, I just setup the zigbee2mqtt and have the hue dimmers like yourself, but am struggling to setup the dimmer functions - the following doesn’t work:

- alias: hue_bedroom_dimmer
  trigger:
  - entity_id: sensor.0x001788010670e11c_action
    platform: state
  condition:
    condition: template
    value_template: >
      {% if is_state('sensor.0x001788010670e11c_action','up-press') or is_state('sensor.0x001788010670e11c_action','down-press') %}
        True
      {% else %}
        False
      {% endif %}
  action:
  - data_template:
      brightness: '{{ states.sensor.0x001788010670e11c_action.attributes.brightness | int }}'
      entity_id: light.bedroom_light
    service: light.turn_on

how did you setup, is there a different automation for every action?

@partymike This is how I’ve configured my Hue Dimmer. The two examples below use a scene in one and script in the other, giving you choice in what commands to run after a button is pressed.

automation:
  - alias: "Hue Dimmer bed2"
    hide_entity: true
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/hue_dimmer_bed2'
    condition:
      condition: or
      conditions:
        - condition: template
          value_template: "{{ 'on-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'up-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'down-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'off-press' == trigger.payload_json.action }}"
    action:
    - service: scene.turn_on
      data_template:
        entity_id: >-
          {%- set scene_map = {'on-press':'scene.hue_bed2_on',
                  'up-press':'scene.hue_bed2_up',
                'down-press':'scene.hue_bed2_down',
                   'off-press':'scene.hue_bed2_off'} -%}
          {{ scene_map[trigger.payload_json.action] }}

  # I use a script here (instead of using scene) so that I can introduce a delay when turning the lights off
  - alias: "Hue Dimmer EnSuite"
    hide_entity: true
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/hue_dimmer_ensuite'
    condition:
      condition: or
      conditions:
        - condition: template
          value_template: "{{ 'on-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'up-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'down-press' == trigger.payload_json.action }}"
        - condition: template
          value_template: "{{ 'off-press' == trigger.payload_json.action }}"
    action:
    - service: script.turn_on
      data_template:
        entity_id: >-
          {%- set script_map = {'on-press':'script.hue_ensuite_on',
                  'up-press':'script.hue_ensuite_up',
                'down-press':'script.hue_ensuite_down',
                   'off-press':'script.hue_ensuite_off'} -%}
          {{ script_map[trigger.payload_json.action] }}


script:
  hue_ensuite_on:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.ensuite
          brightness_pct: 100
  hue_ensuite_up:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.ensuite
          brightness_pct: 50
  hue_ensuite_down:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.ensuite
          brightness_pct: 1
  hue_ensuite_off:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.ensuite
          brightness_pct: 1
      - delay:
          seconds: 1
      - service: light.turn_off
        data:
          entity_id: light.ensuite

scene:
  - name: hue_bed2_on
    entities:
      light.bed_two:
        state: on
        brightness_pct: 100
  - name: hue_bed2_up
    entities:
      switch.bed_two_floor_light:
        state: on
  - name: hue_bed2_down
    entities:
      switch.bed_two_floor_light:
        state: off
  - name: hue_bed2_off
    entities:
      light.bed_two:
        state: off

Can’t find the answer from the topic but I am sure it has been answered somewhere.

I just installed zigbee2mqtt and paired my first sensor that is Xiaomi temperature sensor (round one). It pairs fine and I can see from zigbee2mqtt logs that it is reporting its attributers.

But I can’t find this sensor from Home Assistant anywhere. I have tried restarting zigbee2mqtt and HA but the sensor does not appear in HA sensor list.

What I am doing wrong?

Edit:
Problem was that I did not enable mqtt discovery when enabling the integration. And it was impossible to do this afterwards to the config so I had to reinstall.

Go to the states area in home assistant and filter by 0x.

@Jonde I have the same problem. I see in logs that device is paired but I can’t see it anywhere else in hass io. I tried so many thing so got lost.
What do you mean

enable mqtt discovery when enabling the integration

?
Which file I need to edit and how?

First you install mosquito broker addon (if you want to use that) and start it. After that you enable the integration from HA “configuration” -> “Integrations” and then click mqtt. That will ask you if you want to enable discovery so just check that box.

I see " Configured MQTT: Mosquitto broker " But it doesn’t contain anything. Just says “This integration has no devices.”

After that it started working for me, but try to pair the zigbee devices again and make sure zigbee2mqtt has connection to broker. You can check this from zigbee2mqtt addon logs or mqtt logs. I also reboot at this stage.

Do you have any mqtt configuration in main configuration.yaml?
Do you have anything specific in zigbee2mqtt configuration?

main configuration.yaml I have nothing.
zigbee2mqtt configuration.yaml (not the addon page) I have this:

homeassistant: true
mqtt:
base_topic: zigbee2mqtt
password: MY_PASSWORD
server: mqtt://MY_IP:1883
user: MY_USERNAME
permit_join: false
serial:
port: /dev/ttyACM0

The username and password are the user that I created for mqtt from “Configration” → “Users”. And you should have permit_join set to true so devices can join and then change that back to false when all devices have been paired.

Edit:
And I also have that same user and home assistant user set in the mosquito broker addon page config. Some reason it also needed the home assistant user. You can see from mosquito broker addon page logs if there is failed auths.

1 Like

IP is the static IP of your homeassistant?
will it work with “localhost” or 127.0.0.1?

It works!
Maybe someone else will have the same issue. So here are my steps:

  1. Add new user
  2. Restart hassio
  3. Install mosquito. Don’t start.
  4. Add user to mosquito logins. Start mosquito.
  5. Go to configuration=>Integrations and set up mosquito integration. No settings needed. Just click on it.
  6. Install zigbee2mqtt. Don’t start.
  7. Add to zigbee2mqtt user and server: mqtt://MY_IP:1883 where MY_IP is static raspberrypi IP. Start zigbee2mqtt.
  8. Restart hassio
  9. Check logs of zigbee2mqtt. It should be able to connect.
  10. Add new devices.

If steps don’t work I have no idea how to fix it. I tried many things and suddenly it worked.
Now it seems so simple but I understand frustration when it doesn’t want to work.

1 Like

Thats how it worked for mwe too :slight_smile:

Edit:
For security reasons, just remember to set permit_join to false when done adding devices and maybe add the card from github where you can easily set it to true when needed.

thanks for this, 1 question:

You have the topic as “topic: ‘zigbee2mqtt/hue_dimmer_bed2’” where i can see in my logs:

“state_topic”:“zigbee2mqtt/0x001788010670e11c”

Would I just rename the “0x001788010670e11c” to say “hue_dimmer_bed” in home assistant? Or is it something I need to change in mqtt?

Guess it doesn’t really matter other than easier to identify! :slight_smile: