Zigbee2mqtt Installation Help

Posted on
Sun Mar 05, 2023 8:27 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Zigbee2mqtt Installation Help

Please post requests for help and questions about the installation of Zigbee2mqtt in this thread where knowledgeable forum users can offer help and guidance. :)

Posted on
Sun May 07, 2023 2:11 am
LSpad offline
Posts: 30
Joined: Oct 01, 2018

Re: Zigbee2mqtt Installation Help

Hello - I’m trying to get set up with Zigbee2MQTT but I’m struggling with the initial setup

I've purchased the Sonoff Zigbee 3.0 USB Dongle Plus and I'm trying to set up Zigbee2MQTT in docker using the instructions provided by Zigbee2MQTT here: https://www.zigbee2mqtt.io/guide/instal ... updating-1

Everything is reasonably straightforwards - I've made a directory to keep my container, and I've created the two configuration files as instructed, substituting the path for my adapter in the relevant locations. When I come to start the stack I'm getting an error
Code: Select all
error gathering device information while adding custom device "./dev/tty.usbmodem202303241146591": no such file or directory


I have confirmed that the path is correct as follows:
Code: Select all
system_profiler SPUSBDataType
USB:

    USB 3.0 Bus:
...
       SONOFF Zigbee 3.0 USB Dongle Plus V2:

          Product ID: 0x55d4
          Vendor ID: 0x1a86
          Version: 4.42
          Serial Number: 20230324114659
          Speed: Up to 12 Mb/s
          Manufacturer: ITEAD
          Location ID: 0x14100000 / 15
          Current Available (mA): 500
          Current Required (mA): 132
          Extra Operating Current (mA): 0
Code: Select all
ls -l /dev/tty.*
crw-rw-rw-  1 root  wheel  0x16000006  2 May 13:05 /dev/tty.Bluetooth-Incoming-Port
crw-rw-rw-  1 root  wheel  0x16000002  2 May 13:04 /dev/tty.usbmodem14601
crw-rw-rw-  1 root  wheel  0x16000008  6 May 17:32 /dev/tty.usbmodem147101
crw-rw-rw-  1 root  wheel  0x16000004  6 May 17:32 /dev/tty.usbmodem202303241146591
crw-rw-rw-  1 root  wheel  0x16000000  2 May 13:04 /dev/tty.usbserial-A118WGTK
Code: Select all
ls -l /dev/tty.usbmodem202303241146591
crw-rw-rw-  1 root  wheel  0x16000004  6 May 17:32 /dev/tty.usbmodem202303241146591

and I've checked that I can write to the port:
Code: Select all
test -w /dev/tty.usbmodem202303241146591 && echo success || echo failure
success

Perhaps this is something simple but I'm stumped - any advice on getting myself up and running?

Many thanks
Luke

Posted on
Sun May 07, 2023 3:20 am
CliveS offline
Posts: 771
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Zigbee2mqtt Installation Help

Luke, I see you have the 'new' V2 Sonoff ZBDongle-E" (based on EFR32MG21), according to zigbee2mqtt this is still experimental but add the 2 lines below to your configuration.yaml

Code: Select all

USB connected adapter with external antenna.
Note before buying that ITead slightly confusingly now sells both the "ZBDongle-E" (based on EFR32MG21) and "ZBDongle-P" (based on CC2652P).
This section is about the "ZBDongle-E

If Zigbee2MQTT fails to start, try adding the following to your configuration.yaml

serial:
  adapter: ezsp

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Mon May 08, 2023 12:28 pm
LSpad offline
Posts: 30
Joined: Oct 01, 2018

Re: Zigbee2mqtt Installation Help

Many thanks for the advice - I've added that to my config, and I'm able to get the services to start - unfortunately (after much experimentation) I'm still unable to get things up and running.

I wasn't aware there are two versions of the Sonoff stick - I do have the E version, which seems an unfortunate choice... I have however
- Installed the latest driver on my Mac and rebooted
- Updated the firmware on the stick to the latest available Coordinator version (using the Elelabs EzspFwUtility)
- identified my device (/dev/tty.wchusbserial202303241146591), and confirmed I have write permissions

My docker compose and configuration files area s follows:
Docker-compose.yml
Code: Select all
version: '3.8'
services:
  mqtt:
    image: eclipse-mosquitto:2.0
    restart: unless-stopped
    volumes:
      - "./mosquitto-data:/mosquitto"
    ports:
      - "1883:1883"
      - "9001:9001"
    command: "mosquitto -c /mosquitto-no-auth.conf"

  zigbee2mqtt:
    container_name: zigbee2mqtt
    restart: unless-stopped
    image: koenkk/zigbee2mqtt
    volumes:
      - ./zigbee2mqtt-data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - 8080:8080
    environment:
      - TZ=Europe/Berlin
    devices:
      # using the device name results in 'no such file or directory' - I'm just listing all ttys here which seems to work?
      - /dev/tty:ttywf


configuration.yaml
Code: Select all
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://mqtt
serial:
  port: /dev/tty.wchusbserial202303241146591
  adapter: ezsp
frontend:
  port: 8080
advanced:
  # Optional: ZigBee pan ID (default: shown below)
  # Setting pan_id: GENERATE will make Zigbee2MQTT generate a new panID on next startup
  pan_id: GENERATE
  # Optional: Zigbee extended pan ID (default: shown below)
  # ext_pan_id: [0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD]
  # Optional: ZigBee channel, changing requires re-pairing of all devices. (Note: use a ZLL channel: 11, 15, 20, or 25 to avoid Problems)
  # (default: 11)
  channel: 11
  # Optional: network encryption key, will improve security
  # Note: changing requires repairing of all devices (default: shown below)
  network_key: GENERATE


Am I doing anything obviously wrong here?

Thanks again for your help
Luke

Posted on
Mon May 08, 2023 4:23 pm
CliveS offline
Posts: 771
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Zigbee2mqtt Installation Help

I don’t use Docker, in fact I run Zigbee2mqtt on a raspberry pi, but looking at your configuration.yaml the ‘server’ section should be
Code: Select all
server: mqtt://<ip address of mqtt server>:1883

And the port seems to have changed
from
port: /dev/tty.usbmodem202303241146591
to
port: /dev/tty.wchusbserial202303241146591
which maybe due to the firmware upgrade.

Also pan_id, channel and network _key are not required.

If you are still having problems then try the ‘Python Virtual Environment’ option instead of docker

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Thu May 11, 2023 1:05 pm
LSpad offline
Posts: 30
Joined: Oct 01, 2018

Re: Zigbee2mqtt Installation Help

Huge thanks Clive

So to those who want to get started from a zero base (like myself) I'll pop some instructions in here once I've completed the setup. Just to say I was unable to get Zigbee2MQTT to work at all in docker. Running it from a Python virtual environment is much easier even if it looks less friendly at first. I've successfully set up my Sonoff stick as a coordinator, run an MQTT broker courtesy of Joes great plugin, and linked everything together with Zigbee2MQTT in a virtual environment. I've more or less got my Aqara double rocker switch added to Indigo now.

Great work from all involved in developing these tools and plugins.

With best wishes
Luke

Posted on
Sun May 14, 2023 8:49 am
CliveS offline
Posts: 771
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Zigbee2mqtt Installation Help

Well I finally recieved my shiny new Mac mini M2 and decided to pension off the Raspery Pi that has been running Mosquitto and zigbee2mqtt.

Mosquitto installed via brew is fine but looking at the python virtual environment install for zigbee2mqtt it is based around the Pi so I hit problem 1 at the

Code: Select all
sudo chown -R pi:pi /opt/zigbee2mqtt


what is the Mac mini M2 equivalent to that?

Also autostart at boot looks like it will need some alternative to the Pi version.

Any guidance from those that have this installed on the M1/M2 Macs gratefully received.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sun May 14, 2023 1:31 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Zigbee2mqtt Installation Help

For auto start highly recommend PM2. I also use it for my node red setup too.

You also don't need to bother with virtual envs. Just follow the Linux instructions, they work fine. Ignore the systemctl bit and use PM2.

But to answer your question, it's
Code: Select all
 sudo chown -R ${USER}: /opt/zigbee2mqtt

Posted on
Wed Oct 25, 2023 3:55 pm
mundmc offline
User avatar
Posts: 1061
Joined: Sep 14, 2012

Re: Zigbee2mqtt Installation Help

I am SO CLOSE...

-Sonoff Zigbee 3.0 usb (CC2652P + CP2102N )
-indigo on immac
-imac virtual environment running zigbeee2mqtt
-gui enabled
-plugin installed
-contact switch added to zigbee
-new device showing in MQTT and in plugin

error messages as below, ONLY when connecting/ disconnecting:
Code: Select all
   Zigbee2mqtt Bridge Error        MQTT topic 'zigbee2mqtt/0x282c02bfffe87858' is missing 'device' and|or 'ieeAddr' keys in JSON payload:
   Zigbee2mqtt Bridge Warning          {"battery":100,"battery_low":false,"contact":true,"linkquality":171,"tamper":false,"voltage":3100}


I suppose there is a setting somewhere that places the device name into the json payload, but i know not where.

Now for the screen shots:
Attachments
Screenshot 2023-10-25 at 5.27.56 PM.png
coordinator settings
Screenshot 2023-10-25 at 5.27.56 PM.png (269.3 KiB) Viewed 1540 times
Screenshot 2023-10-25 at 5.26.59 PM.png
door sensor device
Screenshot 2023-10-25 at 5.26.59 PM.png (219.18 KiB) Viewed 1540 times
Screenshot 2023-10-25 at 5.25.51 PM.png
device in indigo
Screenshot 2023-10-25 at 5.25.51 PM.png (148.35 KiB) Viewed 1540 times
Screenshot 2023-10-25 173145.png
mqtt explorer info
Screenshot 2023-10-25 173145.png (26.85 KiB) Viewed 1540 times

Posted on
Wed Oct 25, 2023 4:23 pm
mundmc offline
User avatar
Posts: 1061
Joined: Sep 14, 2012

Re: Zigbee2mqtt Installation Help

NEVER MIND!

I missed the line in the github instructions clearingly stating to check "Include Device Information" in the zigbee2mqtt frontend settings!

This rocks!

Posted on
Thu Oct 26, 2023 3:05 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Zigbee2mqtt Installation Help

mundmc wrote:
NEVER MIND!

This rocks!


It does indeed.

Warning to anyone tempted to play with Home Assistant as well. Don’t enable the HA connectivity in zigbee2mqtt as it changes the messages and breaks the indigo plugin.

It might be possible to run both but do some testing and look at the options rather than blindly turning it on like me and then getting complaints from users (aka my wife) that lights and switches didn’t work.

Posted on
Wed Nov 01, 2023 8:04 pm
mundmc offline
User avatar
Posts: 1061
Joined: Sep 14, 2012

Re: Zigbee2mqtt Installation Help

I am so pleased, I have already purchased a discounted raspberry pi and a second dongle to deploy another repeater in my shop.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron