Python Plugin: Zigbee2Mqtt Topic is solved

Python and python framework

Moderator: leecollings

manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

EddyG wrote: Monday 25 October 2021 11:57 If you go into the zigbee2mqtt GUI you can go to Settings -> About
There you will find the version, in my case from yesterday.

Code: Select all

Zigbee2MQTT version 1.21.2-dev commit: 3f0a2fed
So if you update now from the dev branch you are good.
I see:

Code: Select all

1.21.2 commit: 44922120
I removed and re-installed the whole package. Should I do something special to get the dev version?
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

If you use googled 'git change branch' then you would have found

Code: Select all

git checkout -b <branch>
or switch back and forth

Code: Select all

git checkout -
And a lot of useful information about git.
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

EddyG wrote: Monday 25 October 2021 13:26 If you use googled 'git change branch' then you would have found

Code: Select all

git checkout -b <branch>
or switch back and forth

Code: Select all

git checkout -
And a lot of useful information about git.
:oops: thanks
I think a lot is due to the fact that I've not really used Git, beside the pre-cooked statements that I find in installation procedures. Even the terminology needs a learning curve, e.g. the "branch".

OK, so taking the risk of asking stupid questions.
I submitted:

Code: Select all

git checkout -b dev
which gave me a list of modules, preceded with "M".
Also:

Code: Select all

Switched to a new branch 'dev'
Then what? I can't tell if that brought the dev version down to my Pi...
I tried

Code: Select all

sudo git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

I use these commands all the time when I update, just to be sure that that I am on the right branch.

Code: Select all

git checkout HEAD -- npm-shrinkwrap.json
git fetch
git checkout dev
git pull
And if you want to be 100% sure that you are on the right branch:

Code: Select all

git branch
Sorry for the -b
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

I did as you suggested, with this result:

Code: Select all


pi@Utrecht:/opt/zigbee2mqtt $ git branch
* dev
  master
pi@Utrecht:/opt/zigbee2mqtt $ git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Total 5 (delta 4), reused 4 (delta 4), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/Koenkk/zigbee2mqtt
   56812e78..b08ce534  dev        -> origin/dev
pi@Utrecht:/opt/zigbee2mqtt $ git checkout dev
M       data/configuration.yaml
Already on 'dev'
pi@Utrecht:/opt/zigbee2mqtt $ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> dev

pi@Utrecht:/opt/zigbee2mqtt $ git branch
* dev
  master
pi@Utrecht:/opt/zigbee2mqtt $

Did "npm instsall", and restarted zigbee2mqtt service. Still see this version:

Code: Select all

1.21.2 commit: 44922120
Hans
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

Try:
1. Stop zigbee2mqtt
2. Move the whole /opt/zigbee2mqtt to a save place.
3. Clone the zigbee2mqtt
4. git checkout dev
5. git pull
6. copy the original /opt/zigbee2mqtt/data back to the original place
7. start zigbee2mqtt

B.t.w. seen by the line " 56812e78..b08ce534 dev -> origin/dev" you are on the version of yesterday. So everything went fine.
Did you refresh your browser cache?
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

OK, followed the steps.
After npm start, it ends with:

Code: Select all

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-25T19_51_58_334Z-debug.log
Content of the log file:

Code: Select all

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/zigbee2mqtt/node_modules/.bin:/usr/local/sbin:/usr/local/bin:$
9 verbose lifecycle [email protected]~start: CWD: /opt/zigbee2mqtt
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node index.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1022:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid [email protected]
15 verbose cwd /opt/zigbee2mqtt
16 verbose Linux 5.10.63-v7l+
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.22.7
19 verbose npm  v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node index.js`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I don't feel very lucky today... I've gone back to the main version, with the external adapter for the bulb. Will see how it runs. For now it is OK.
Hans
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

I think I'll stick to the current setup, with the external converter file to support the lamp. I assume that with the next stable version the support will be built in.

here is one thing that puzzles me. The Ikea lamp is working OK, until the moment that I restart Zigbee2MQTT. After that the bulb shows up as "unsupported". I discovered that when I switch the power to the lamp off, and then on again, it re-connects to Z2M and show up as "supported" again.
Although this is not a big deal, I wonder if this is normal? At the moment I only have one single bulb, but when I add more bulbs in the future, it will become a hassle to go around the house and switch power everywhere.

So my question is: is this normal behaviour?

I also have five smoke detectors, and they drop connection as well. But at some point in time they connect back, probably because they report the status periodically.
A light bulb doesn't do this on its own, unless the power is switched...
Hans
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

manjh wrote: Tuesday 26 October 2021 17:07 I think I'll stick to the current setup, with the external converter file to support the lamp. I assume that with the next stable version the support will be built in.

But there is one thing that puzzles me. The Ikea lamp is working OK, until the moment that I restart Zigbee2MQTT. After that the bulb shows up as "unsupported". I discovered that when I switch the lamp-power off, and then on again, it re-connects to Z2M and shows up as "supported" again.
Although this is not a big deal, I wonder if this is normal? At the moment I only have one single bulb, but when I add more bulbs in the future, it will become a hassle to go around the house and switch power everywhere.

So my question is: is this normal behaviour?

I also have five smoke detectors, and they drop connection as well. But at some point in time they connect back, probably because they report the status periodically.
A light bulb doesn't do this on its own, unless the power is switched...
Hans
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by heggink »

I haven't read your entire thread but allow me to provide some comments:
1) I strongly suggest to run zigbee2mqtt with the official docker container. It comes in a stable and a dev version
2) zigbee devices should not just drop off. There can be a couple of reasons: a) the usb adapter (memory, range) and b) network interference: this was a big issue for me until I figured out which wifi 2,4ghz overlap with zigbee. I then switched zigbee to a different channel and everything was smooth.

I hardly ever restart zigbee2mqtt. It just runs.

Sent from my SM-G980F using Tapatalk


Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
manjh
Posts: 748
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by manjh »

heggink wrote: Tuesday 26 October 2021 17:17 I haven't read your entire thread but allow me to provide some comments:
1) I strongly suggest to run zigbee2mqtt with the official docker container. It comes in a stable and a dev version
2) zigbee devices should not just drop off. There can be a couple of reasons: a) the usb adapter (memory, range) and b) network interference: this was a big issue for me until I figured out which wifi 2,4ghz overlap with zigbee. I then switched zigbee to a different channel and everything was smooth.

I hardly ever restart zigbee2mqtt. It just runs.

Sent from my SM-G980F using Tapatalk
I have no experience using docker, will look into it.
Dropping devices: this happens when ZIgbee2MQTT has been restarted for whatever reason. This afternoon I restarted after making a few changes to the configuration.yaml file (debug setting, and allow-join). But it could also happen when I restart the Pi. So the device doesn't drop by itself, it is simply thrown off and then doesn't re-connect automatically.
Hans
fvdp80
Posts: 70
Joined: Tuesday 14 August 2018 8:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10303
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by fvdp80 »

Any idea where these errors come from?

Code: Select all

2021-11-08 13:40:02.755 Error: SQL Query("INSERT INTO Temperature (DeviceRowID, Temperature, Chill, Humidity, Barometer, DewPoint, SetPoint) VALUES ('80', '11.90', '0.00', '69', '10231', '6.39', '0.00')") : no more rows available
Same errors are also mentioned in this topic, but no solution is mentioned.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

heggink wrote: Tuesday 26 October 2021 17:17 1) I strongly suggest to run zigbee2mqtt with the official docker container. It comes in a stable and a dev version
Are you sure there is a dev version on docker? I see only a regular stable (master) version.
User avatar
waltervl
Posts: 5770
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by waltervl »

EddyG wrote: Monday 08 November 2021 18:47
heggink wrote: Tuesday 26 October 2021 17:17 1) I strongly suggest to run zigbee2mqtt with the official docker container. It comes in a stable and a dev version
Are you sure there is a dev version on docker? I see only a regular stable (master) version.
https://hub.docker.com/r/koenkk/zigbee2mqtt/tags latest-dev
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

Oeps. :oops: I looked here because I have a raspberry armv7 https://hub.docker.com/r/zigbee2mqtt/zi ... armv7/tags
Strange that that is not synchronized.
purch
Posts: 4
Joined: Saturday 16 November 2013 17:03
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by purch »

z2m plugin crashes domoticz. Only start status messages looping in Domoticz log window and in Windows (Win 11) event viewer shows following error with all tested versions. Crashing stops if I disable z2m plugin in hardware section.

Code: Select all

Fault bucket 1290729138380626289, type 5
Event Name: BEX
Response: Not available
Cab Id: 0

Problem signature:
P1: domoticz.exe
P2: 2021.1.0.13875
P3: 61a3c354
P4: StackHash_2beb
P5: 0.0.0.0
P6: 00000000
P7: PCH_2B_FROM_ntdll+0x00074C6C
P8: c0000005
P9: 00000008
P10: 
  • z2m works - I can use frontend to trigger devices (tested 3 latest versions)
  • MQTT Explorer can connect Mosquito and show info
  • plugin z2m (tested 3 latest version)
  • domoticz (tested beta and latest)
  • zzh - CC2652R Stick (2 new ones tested with latest fw and after error red'ish' light blinks)
What to debug and test next or how to get this thing working? :)
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by samourai47 »

Hello
Some help please
I tried to use a MOES BHT-002-GCLZB with deconz and that dosen't work prefectly
I try with mqtt and zigbee2mqtt plugin
That work only in domoticz beta and the 3.1 plugins, but i have a little problem

My problem
The BHT seem's to ahave a little bug
Stop message flooding

This unit has a bug that makes it send multiple messages when updating. To stop this from flooding your MQTT Queues, please add the following to your configuration.yaml file:

devices: '0x12345678': friendly_name: thermostat debounce: 1
An when i modify the file configuration.yaml

Code: Select all

sudo nano /opt/zigbee2mqtt/data/configuration.yaml
I restart the pi and no device works, i have no error message in domoticz. If a restore the file all the devices work

Original file:

Code: Select all

evices:
  '0x00158d00023d4a85':
    friendly_name: '0x00158d00023d4a85'
  '0x00158d000302f81f':
    friendly_name: '0x00158d000302f81f'
  '0x9035eafffe6ee770':
    friendly_name: '0x9035eafffe6ee770'
Modify file

Code: Select all

devices:
  '0x00158d00023d4a85':
    friendly_name: '0x00158d00023d4a85'
  '0x00158d000302f81f':
    friendly_name: '0x00158d000302f81f'
  '0x9035eafffe6ee770':
    friendly_name: thermostat debounce: 1
I try many solutions but only the original file work; HAve you some idea?
Thank's for your help
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Nautilus »

I would try specifying the device options with line breaks as shown here:
https://www.zigbee2mqtt.io/guide/config ... ce-options
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by samourai47 »

thank you that work like this
'0x9035eafffe6ee770':
friendly_name: 'thermostat'
debounce: 1
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by samourai47 »

I don't arrive to pair the conbee2 and the smoke detector frient with the sigbee2mqtt plugin
When i press the button, the led flashes a few minutes then stop but nothing is in the mqttplugin

It seem to be possible in zigbee2mqtt

Code: Select all

https://www.zigbee2mqtt.io/devices/SMSZB-120.html
I have this msg

Code: Select all

 2021-12-28 08:16:35.359 Error: Zigbee2mqtt: 0x0015bc003100c892: can not process binary item "alarm"
2021-12-28 08:16:35.359 Error: Zigbee2mqtt: 0x0015bc003100c892: can not process binary item "fault" 
The Temperture dosen't work andd i have no siren device...
I don't understand
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest