add new device to zigbee2mqtt

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

Post Reply
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

add new device to zigbee2mqtt

Post by remko2000 »

I want to add a new device TS0601 (avato led dimmer). After pairing in zigbee2mgtt I get ' not supported device'. However in the zigbee2mqttwiki it looks lik it's a supported device: AVATTO ZDMS16-1 (same device). No I try to add this manually but I'm stuck. I find the right js code for this device. How do I add this in the frontend zigbee2mqtt?
Or do I need to make a file by terminal in my raspberry with this code? Wat is the right path to the right folder for this:
In my 'pi@homebridge' I've got thse files:
docker.compose.yaml domoticz get-docker.sh nest-api
Where do I find my zigbee configuration?
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: add new device to zigbee2mqtt

Post by waltervl »

Are you on the latest zigbee2mqtt version?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

I've 1.35.3. How can I update? By terminalcommand?
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: add new device to zigbee2mqtt

Post by waltervl »

Depends how you installed it. Check the zigbee2mqtt documentation https://www.zigbee2mqtt.io/guide/installation/
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

I thought by linux but upgrade with cd /opt/zigbee2mqtt
./update.sh I get an error:

Code: Select all

pi@homebridge:/opt/zigbee2mqtt $ ./update.sh
Stopping Zigbee2MQTT...
Creating backup of configuration...
Checking out changes to package-lock.json...
Updated 0 paths from the index
Updating...
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
remote: Enumerating objects: 6654, done.
remote: Counting objects: 100% (6654/6654), done.
remote: Compressing objects: 100% (1897/1897), done.
remote: Total 6537 (delta 5023), reused 6066 (delta 4603), pack-reused 0 (from 0)
Receiving objects: 100% (6537/6537), 3.89 MiB | 3.91 MiB/s, done.
Resolving deltas: 100% (5023/5023), completed with 99 local objects.
From https://github.com/Koenkk/zigbee2mqtt
   fe0742a..d44463a  master     -> origin/master
 * [new tag]         1.36.0     -> 1.36.0
 * [new tag]         1.36.1     -> 1.36.1
 * [new tag]         1.37.0     -> 1.37.0
 * [new tag]         1.37.1     -> 1.37.1
 * [new tag]         1.38.0     -> 1.38.0
 * [new tag]         1.39.0     -> 1.39.0
 * [new tag]         1.39.1     -> 1.39.1
 * [new tag]         1.40.0     -> 1.40.0
 * [new tag]         1.40.1     -> 1.40.1
 * [new tag]         1.40.2     -> 1.40.2
 * [new tag]         1.41.0     -> 1.41.0
 * [new tag]         1.42.0     -> 1.42.0
 * [new tag]         2.0.0      -> 2.0.0
 * [new tag]         2.1.0      -> 2.1.0
 * [new tag]         2.1.1      -> 2.1.1
 * [new tag]         2.1.2      -> 2.1.2
 * [new tag]         2.1.3      -> 2.1.3
 * [new tag]         2.2.0      -> 2.2.0
 * [new tag]         2.2.1      -> 2.2.1
 * [new tag]         2.3.0      -> 2.3.0
 * [new tag]         2.4.0      -> 2.4.0
 * [new tag]         2.5.0      -> 2.5.0
 * [new tag]         2.5.1      -> 2.5.1
 * [new tag]         2.6.0      -> 2.6.0
 * [new tag]         2.6.1      -> 2.6.1
Updating fe0742a..d44463a
error: Your local changes to the following files would be overwritten by merge:
	data/configuration.yaml
Please commit your changes or stash them before you merge.
Aborting
User avatar
jvdz
Posts: 2441
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: add new device to zigbee2mqtt

Post by jvdz »

Rename your version of data/configuration.yaml to something else, do the update and update the new data/configuration.yaml with your config settings.
I think you have to also read up on the upgrade from version 1 to 2 as there were some major changes in the config file: https://www.zigbee2mqtt.io/guide/config ... pdate.html
User avatar
gizmocuz
Posts: 2706
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: add new device to zigbee2mqtt

Post by gizmocuz »

You need to be on version 2+

Best to install zigbee2mqtt via docker compose.
This way it is much easier to upgrade, and you have no system dependencies.

I would suggest to backup your current zigbee2mqtt folder, specially the configuration parts (data folder)

In the zigbee2mqtt make a backup (open the Zigbee2MQTT web UI, navigate to Settings > Tools, and click "Request z2m backup")

install docker compose and zigbee2mqtt
Making sure everything is working, then if needed restore the backup

https://www.zigbee2mqtt.io/guide/instal ... er-compose

and you can google for

zigbee2mqtt move to docker compose
Quality outlives Quantity!
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

I've updated my Zigbee2mqttversion (first back up data) and updated the settings.yaml file with my own settingsfile. The status:

Code: Select all

zigbee2mqtt.service - zigbee2mqtt
     Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; enabled; vendor preset: enabled)
     Active: activating (start) since Fri 2025-09-12 15:13:02 CEST; 55s ago
   Main PID: 9921 (node)
      Tasks: 69 (limit: 1595)
        CPU: 1min 40.844s
     CGroup: /system.slice/zigbee2mqtt.service
             ├─ 9921 /usr/bin/node index.js
             ├─10182 /bin/sh -c pnpm run prepack
             ├─10184 node /usr/bin/pnpm run prepack
             ├─11160 node /home/pi/.local/share/pnpm/.tools/pnpm/10.12.1/bin/pnpm run prepack
             ├─11175 sh -c pnpm run clean && pnpm run build
             ├─11222 node /home/pi/.local/share/pnpm/.tools/pnpm/10.12.1/bin/pnpm run build
             ├─11267 sh -c tsc && node index.js writehash
             └─11268 node /opt/zigbee2mqtt/node_modules/.bin/tsc

Sep 12 15:13:02 homebridge systemd[1]: Starting zigbee2mqtt...
Sep 12 15:13:03 homebridge node[9921]: Starting Zigbee2MQTT without watchdog.
Problem is that my frontend doesn't work (neither the devices).

This is my yaml:

Code: Select all

homeassistant:
  discovery_topic: zigbeeAD
mqtt:
  base_topic: zigbeeAD
  server: mqtt://10.0.1.xxx
serial:
  port: /dev/ttyUSB0
frontend:
  port: 8090
  host: 10.0.1.xxx
devices:
  '0x54ef441000a6a331':
    friendly_name: '0x54ef441000a6a331'
    homeassistant:
      name: wallswitchzigbee
    optimistic: true
    description: led planken keuken
  '0x00158d000405d35e':
    friendly_name: '0x00158d000405d35e'
    description: gordijnen woonkamer
  '0x00158d0002480368':
    friendly_name: '0x00158d0002480368'
  '0x00158d00022cb62a':
    friendly_name: '0x00158d00022cb62a'
    description: Temp vriezer
  '0x00158d00022ae420':
    friendly_name: '0x00158d00022ae420'
  '0x54ef4410013328b3':
    friendly_name: '0x54ef4410013328b3'
    description: licht plafond garage
  '0x54ef4410012c5f27':
    friendly_name: '0x54ef4410012c5f27'
    description: rookmelder beneden
  '0x54ef441001331e96':
    friendly_name: '0x54ef441001331e96'
    description: led werkbank
  '0x54ef4410012ff46a':
    friendly_name: '0x54ef4410012ff46a'
    description: rookmelder eerste
  '0x54ef4410012c5fcb':
    friendly_name: '0x54ef4410012c5fcb'
    description: rookmelder zolder
  '0x00158d000245d583':
    friendly_name: '0x00158d000245d583'
    description: raamsensor bijkamer woonkamer
  '0x00158d000ad849f6':
    friendly_name: '0x00158d000ad849f6'
    description: deursensor buiten achter
  '0x00158d0002436ac7':
    friendly_name: '0x00158d0002436ac7'
    description: Deur meterkast
  '0x00158d00020921c3':
    friendly_name: '0x00158d00020921c3'
    description: Raam werkkamer eerste
  '0x00158d00024e57a0':
    friendly_name: '0x00158d00024e57a0'
    description: Beweging gang
  '0x00158d000233b2b2':
    friendly_name: '0x00158d000233b2b2'
    description: Waterlekkage wasmachine
  '0x00158d00066f91d8':
    friendly_name: '0x00158d00066f91d8'
    description: Knop zonnescherm bg
  '0xa4c1380cb52ad1dc':
    friendly_name: '0xa4c1380cb52ad1dc'
permit_join: true
ota:
  ikea_ota_use_test_url: false
  update_check_interval: 1440
pnpm start gives an error:

Code: Select all

pnpm start

> [email protected] start /opt/zigbee2mqtt
> node index.js

Starting Zigbee2MQTT without watchdog.
Building Zigbee2MQTT... (initial build), failed
Error: Command failed: pnpm run prepack

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
 ELIFECYCLE  Command failed with exit code 1.
What can be the problem?
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

Solved it after many hours trying.

One thing I don't understand. In the new yaml.file I've:

Code: Select all

homeassistant:
  discovery_topic: zigbeeAD
mqtt:
  base_topic: zigbeeAD
  server: mqtt://10.0.1.xxx
In domoticz I also fill in the 'zigbeeAD' into the mqtt discoverysettings. In the frontend z2m I get an error:
HA discovery topic cannot be equal to the mqtt base topic.
What are the smartest settings for this so that domoticz 'talks' properly to Z2m and visa versa?
I also have to set a Home Assistant status topic???
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: add new device to zigbee2mqtt

Post by waltervl »

I would make the base_topic default again (zigbee2MQTT) so you have a split of Z2M AD config topics in zigbeeAD and the Z2M state and set topics in zigbee2MQTT.
In Domoticz configuration you use the discovery_topic (zigbeeAD).

base_topic: zigbee2MQTT
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

thx, I've now in my yaml:

Code: Select all

homeassistant:
  enabled: true
  discovery_topic: zigbeeAD
  status_topic: zigbeeAD/status
mqtt:
  base_topic: zigbee2MQTT
  server: mqtt://10.0.1.122
In domoticz:
Auto Discovery Prefix: zigbeeAD

Some zigbeedevices working perfect now in domoticz but some are a little instable (workls one time in domoticz but works fine in frontend z2m). What can here be the problem? I tried to add them again but same result. What can cause this strange behaviour?
User avatar
jvdz
Posts: 2441
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: add new device to zigbee2mqtt

Post by jvdz »

Make the first part of the topic unique to separate the AD from the Status/Command messages.
The check for issues you can monitor the mqtt messages with a program to see what happens when it fails.
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: add new device to zigbee2mqtt

Post by waltervl »

And be sure you removed the retained old config topics from zigbeeAD. They could be pointing to the old zigbeeAD set and state topic and so not working.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
remko2000
Posts: 182
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: add new device to zigbee2mqtt

Post by remko2000 »

thx, problem is solved. After a while en some restarts things starting to work as expected.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest