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


#896

Hi @scottdarby,
Before I order the debugger, sniffer, and hardware cable from one of the drop shippers, do you happen to have any pre-flashed CC2531’s available?


#897

I haven’t unfortunately, Sorry about this.


#898

Disconnecting and reconnecting the lead to the CC2531 a couple times fixed it for me. I assume it was just a bad connection.


#899

No worries, I thought it was worth asking :+1:


#900

I tried wiggling the connections, and got a green light - Once!

But it still didn’t show up Flash Programmer (under Program CCxxxx SoC). And after disconnecting and reconnecting, I haven’t been able to get it back to green, regardless of jiggling & resetting for 30 minutes.

But it seems you guys are right, it’s “just” bad connections, so I’ll keep at it… Or end up ordering new components, we’ll see how patient I am :slight_smile:


#901

Anybody tried flashing one of these using the arduino? Mine just got here and getting ready to give it a go. Just wondered if there was anything I needed to look out for.


#902

I did the same a few months ago. Just follow the guide in the wiki and you should be fine:

The only challenge I experienced was to connect the wires to the tiny connectors of the CC2531 because I did not have the downloader cable.


#903

I just try to get a little smaler and easyer to configure automation

You understand what I try to do?
Instead on a condition for every single button press letting Jinja do a little more work
Something like this (sadly this dont work(yet ))

automation:
  - alias: VI ON
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/0x00178801105efead'
    action:
    - service: scene.turn_on
      data_template:
        entity_id: >-
          {% if is_state("trigger.payload_json.action", "on") %}
            scene.sz_max
          {% elif is_state("trigger.payload_json.action", "up-press") %}
            scene.sz_arbeiten
          {% elif is_state("trigger.payload_json.action", "up-hold") %}
            scene.sz_arbeiten
          {% elif is_state("trigger.payload_json.action", "down-press") %}
            scene.sz_lesen
          {% elif is_state("trigger.payload_json.action", "down-hold") %}
            scene.sz_poppen
          {% elif is_state("trigger.payload_json.action", "off") %}
            scene.sz_aus
          {% endif %}

instead of : 
  - alias: IV ON
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'on' == trigger.payload_json.action }}"
    action:
      entity_id: scene.sz_max
      service: scene.turn_on
  - alias: IV UP
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'up-press' == trigger.payload_json.action }}"
    action:
      entity_id: scene.sz_arbeiten
      service: scene.turn_on
  - alias: IV UP-hold
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'up-hold' == trigger.payload_json.action }}"
    action:
      service: script.turn_on
      entity_id: script.dash_pc_hochfahren
  - alias: IV DOWN
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'down-press' == trigger.payload_json.action }}"
    action:
      service: scene.turn_on
      entity_id: scene.sz_lesen
  - alias: IV DOWN-hold
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'down-hold' == trigger.payload_json.action }}"
    action:
      service: scene.turn_on
      entity_id: scene.sz_poppen
  - alias: IV OFF
    hide_entity: true
    trigger:
      platform: mqtt
      topic: 'zigbee2mqtt/huedimmer4'
    condition:
      condition: template
      value_template: "{{ 'off' == trigger.payload_json.action }}"
    action:
      service: scene.turn_on
      entity_id: scene.sz_aus


#904

I have an old AVRdude programer that has that small connector on it so should be okay there hopefully. I just hope my old uno still works. :slight_smile:


#905

Hi everyone does somebody know to use the zigbee2mqtt.yaml file? I’m a noob, and struggling with the issue on how to enable zigbee2mqtt’s permit_join option?


I can’t get it to work. Thanx in advance.


#906

It is a package file. Look here for more info about packages.


#907

Didn’t work for me either so just did it manually as you’ll only use it on the rare occasions when you add new things so wasn’t worth the effort to get that card working.


#908

Hello!
I am on hassio, raspberri pi 3b+ and here is my issue:

[Info] Configuration file found. Will overwrite configurable               fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
2018-12-02T18:51:34: PM2 log: Launching in no daemon mode
2018-12-02T18:51:35: PM2 log: App [npm:0] starting in -fork mode-
2018-12-02T18:51:35: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-0.2.0
> node index.js
		Zigbee2mqtt requires node version >=8.11 10, you are running v8.11.4!
  zigbee2mqtt:info 2018-12-2 18:51:43 Logging to directory: '/share/zigbee2mqtt/log/2018-12-02.18-51-43'
  zigbee2mqtt:info 2018-12-2 18:51:45 Starting zigbee2mqtt version 0.2.0 (commit #unknown)
  zigbee2mqtt:info 2018-12-2 18:51:45 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-12-2 18:51:46 zigbee-shepherd started
  zigbee2mqtt:info 2018-12-2 18:51:46 Coordinator firmware version: '20180815'
  zigbee2mqtt:info 2018-12-2 18:51:46 Currently 0 devices are joined:
  zigbee2mqtt:warn 2018-12-2 18:51:46 `permit_join` set to  `true` in configuration.yaml.
  zigbee2mqtt:warn 2018-12-2 18:51:46 Allowing new devices to join.
  zigbee2mqtt:warn 2018-12-2 18:51:46 Set `permit_join` to `false` once you joined all devices.
  zigbee2mqtt:info 2018-12-2 18:51:46 Zigbee: allowing new devices to join.
  zigbee2mqtt:info 2018-12-2 18:51:46 Connecting to MQTT server at mqtt://192.168.1.111:1883
  zigbee2mqtt:info 2018-12-2 18:51:47 zigbee-shepherd ready
  zigbee2mqtt:error 2018-12-2 18:51:56 Not connected to MQTT server!

I have flashed usb stick and wrote this in zigbee config:

{
  "data_path": "/share/zigbee2mqtt",
  "homeassistant": true,
  "permit_join": true,
  "mqtt_base_topic": "zigbee2mqtt",
  "mqtt_server": "mqtt://192.168.1.111:1883",
  "serial_port": "/dev/ttyACM1"
}

And this in HA config:

mqtt:

Could you please say what am I doing wrong?


#909

Do you have a MQTT user and password on your MQTT server? If so, you should include them in the configuration.yaml file as well.

This is my configuration.yaml (on docker):

homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://192.168.1.20:1883'
  user: xxxxxxxxx
  password: xxxxxxxx
serial:
  port: /dev/ttyACM0
advanced:
  log_level: info
  channel: 11
devices:

#910

Hm, today is a first day of trying mqtt. I do not think I have. I did not create anything besides what I wrote above.
Where should I look more info on mqtt server?


#911

This is a good starting point: https://www.home-assistant.io/docs/mqtt/broker/.


#912

@IK0ADR

Hi, I’m trying to use your script, but the mapXXX.png is allways empty (0kb).
I usually do the same thing with mqtt.fx and it works but for some reason with your script it doesn’t.

I’m running hassio on ubuntu so i’ve change your script to run on my setup.

#!/bin/bash
D=$(date +%Y%m%d%H%M%S)
mosquitto_sub -V mqttv311 -C 1 -u xxx -P xxx -h 192.168.1.xxx -t zigbee2mqtt/bridge/networkmap/graphviz | sed -e 's/|EndDevice//' -e 's/|[^|]\+(.*)|/|/' -e 's/No [^|]\+|//' | sfdp -Tpng > /tmp/map$D.png &
sleep 15s
mosquitto_pub -V mqttv311 -u xxx -P xxx -h 192.168.1.xxx -m "graphviz" -t zigbee2mqtt/bridge/networkmap
sleep 15s
sudo cp /tmp/map$D.png /usr/share/hassio/homeassistant/www/map.png
sudo rm -rf /tmp/map$D.png

image

I have graphviz installed. Any hints on what could be wrong?


#913

I think it is a ownership problem.
My script is for hassbian, you should check the changes necessary for hassio, the directory structure is different.

Also, you missed the line starting with sudo chown, that should be corrected for hassio.

Ciao!!


#914

is It posible to run this connected on the USB of a openwrt router? i don’t have a rpi, and i don’t want the pc to be On all the time to use this, but the router option would be perfect for me! am i crazy?


#915

Dont forget to check out Home assistant packages. There are new created