Python Plugin: Zigbee2Mqtt Topic is solved

Python and python framework

Moderator: leecollings

fvdp80
Posts: 69
Joined: Tuesday 14 August 2018 8:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10303
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by fvdp80 »

I'm getting errors regarding an Aqara Opple switch (WXCJKG11LM).
First it seemed like it was caused by an empty battery, but after replacement and also reconnecting to the netwerk I keep
getting the following errors:

Code: Select all

2022-01-10 08:02:18.317 Error: Zigbee2MQTT: 'onMessage' failed 'TypeError':'unsupported operand type(s) for /: 'NoneType' and 'int''.
2022-01-10 08:02:18.317 Error: Zigbee2MQTT: Exception traceback:
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 298 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 137 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 167 in '/home/pi/domoticz/plugins/zigbee2mqtt/mqtt.py', function onMessage
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 214 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMQTTPublish
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 61 in '/home/pi/domoticz/plugins/zigbee2mqtt/devices_manager.py', function handle_mqtt_message
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 41 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapters/lumi/aqara_opple_switch.py', function handle_mqtt_message
2022-01-10 08:02:18.318 Error: Zigbee2MQTT: ----> Line 31 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapters/adapter_with_battery.py', function convert_message
Anybody else experiencing these errors?
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 »

fvdp80 wrote: Monday 10 January 2022 8:45 Anybody else experiencing these errors?
Yeah, same here. Stas knows about it: https://github.com/stas-demydiuk/domoti ... -987894256
fvdp80
Posts: 69
Joined: Tuesday 14 August 2018 8:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10303
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by fvdp80 »

Ah, missed that one as it is marked as a closed issue.
Creo2005
Posts: 25
Joined: Wednesday 26 February 2020 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Creo2005 »

Now, after update on Version: 2021.1 (build 14081)
In the Custom menu gone missing Zigbee2mqtt, only Plugins-Manager.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by waltervl »

Creo2005 wrote: Monday 17 January 2022 17:13 Now, after update on Version: 2021.1 (build 14081)
In the Custom menu gone missing Zigbee2mqtt, only Plugins-Manager.
Add the device "api_transport" in 'Setup -> Devices'. The device can be hidden by adding a "$" in front of the name.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Creo2005
Posts: 25
Joined: Wednesday 26 February 2020 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Creo2005 »

Add MQTT auto discovery-MQTT Auto Discovery Client Gateway with LAN interface
and in log:

Code: Select all

2022-01-17 22:14:48.222 Error: CC2652P: 'onMessage' failed 'TypeError':''<' not supported between instances of 'NoneType' and 'int''.
2022-01-17 22:14:48.222 Error: CC2652P: Exception traceback:
2022-01-17 22:14:48.222 Error: CC2652P: ----> Line 298 in '/home/creo/domoticz/plugins/zigbee2mqtt/plugin.py'
2022-01-17 22:14:48.222 Error: CC2652P: ----> Line 137 in '/home/creo/domoticz/plugins/zigbee2mqtt/plugin.py'
2022-01-17 22:14:48.222 Error: CC2652P: ----> Line 167 in '/home/creo/domoticz/plugins/zigbee2mqtt/mqtt.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 214 in '/home/creo/domoticz/plugins/zigbee2mqtt/plugin.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 61 in '/home/creo/domoticz/plugins/zigbee2mqtt/devices_manager.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 64 in '/home/creo/domoticz/plugins/zigbee2mqtt/adapters/base_adapter.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 193 in '/home/creo/domoticz/plugins/zigbee2mqtt/devices/device.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 172 in '/home/creo/domoticz/plugins/zigbee2mqtt/devices/device.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 33 in '/home/creo/domoticz/plugins/zigbee2mqtt/devices/temperature_humidity_barometer_sensor.py'
2022-01-17 22:14:48.223 Error: CC2652P: ----> Line 39 in '/home/creo/domoticz/plugins/zigbee2mqtt/devices/temperature_humidity_barometer_sensor.py'
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by waltervl »

Creo2005 wrote: Monday 17 January 2022 21:21 Add MQTT auto discovery-MQTT Auto Discovery Client Gateway with LAN interface
That is not in the instructions to do that.....
Either use to plugin or use "MQTT Auto Discovery Client Gateway with LAN interface". This topic is about the plugin.
See for more info https://www.domoticz.com/wiki/Zigbee2MQTT
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Creo2005
Posts: 25
Joined: Wednesday 26 February 2020 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Creo2005 »

waltervl wrote: Monday 17 January 2022 21:36 That is not in the instructions to do that.....
Either use to plugin or use "MQTT Auto Discovery Client Gateway with LAN interface". This topic is about the plugin.
See for more info https://www.domoticz.com/wiki/Zigbee2MQTT
It's not forbidden, so I'm asking the question because Zigbee2Mqtt plugin and MQTT Auto Discovery can work together.
But after install MQTT Auto Discovery I see errors Zigbee2Mqtt plugin in log Domoticz.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

It's normal that you either use the zigbee2mqtt plugin OR MQTT Auto discovery, otherwise you get all zigbee devices double.
MQTT Auto discovery is the way to go for the future.
Creo2005
Posts: 25
Joined: Wednesday 26 February 2020 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Creo2005 »

EddyG wrote: Tuesday 18 January 2022 10:43 all zigbee devices double.
MQTT Auto discovery is the way to go for the future.
Not all - for example, my CO2 (DIYRuZ_AirSense Air quality sensor https://modkam.ru/?p=1715)) at this moment not working in Domoticz with zigbee2mqtt plugin and Auto discovery:
8 devices

Code: Select all

CC2652P	0x00124b001ec6c625 3 CO2 - (Pressure) General	Pressure 0.0 Bar
CC2652P 0x00124b001ec6c625 4 CO2 (Temperature + Humidity) Temp + Humidity THGN122/123/132, THGR122/228/238/268 0.0 C, 0 %
CC2652P 0x00124b001ec6c625 1 CO2 - (Temperature)	Temp LaCrosse TX3 0.0 C
CC2652P 0x00124b001ec6c625 2 CO2 - (Humidity) Humidity LaCrosse TX3 Humidity 0 %
CC2652P 0x00124b001ec6c625 7 CO2 - (led_feedback) Light/Switch Switch	Off. ---------------- 
CC2652P 0x00124b001ec6c625 5 CO2 (Temperature + Humidity + Barometer) Temp + Humidity + Baro	Weather Station 0,
CC2652P 0x00124b001ec6c625 6 CO2 - (co2) Air Quality Voltcraft CO-20 0 ppm
CC2652P 0x00124b001ec6c625 8 CO2 - (Link Quality)	General Custom Sensor 0 lqi
+ MQTT auto discovery
add 2 devices:

Code: Select all

MQTT auto discovery 0x00124b001ec6c625_switch_enable_abc_zigbee2mqtt 1 CO2 - enable_abc Light/Switch Switch On
MQTT auto discovery 0x00124b001ec6c625_switch_led_feedback_zigbee2mqtt 1 CO2 - led_feedback Light/Switch Switch On  ------------
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jvdz »

When things aren't working it would help when it is reported and you supply the MQTT CONFIG & STATE update TOPICS & PAYLOADS, so it can be looked at!
PS: The sensors device only gets created after an update is received.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

Probably you did not notice that there is a stable an a beta branch.
MQTT AD is currently only in the beta branch, so it is under development.
That could mean that there is still something missing which should and will be addressed.
If you have some serious issues about a device -> open an issue on github.
But still the statement is Zigbee2mqqt plugin OR MQTT AD

Edit and OFFtopic:
Creo2005 wrote: Tuesday 18 January 2022 11:27 Not all - for example, my CO2 (DIYRuZ_AirSense Air quality sensor https://modkam.ru/?p=1715)) at this moment not working in Domoticz with zigbee2mqtt plugin and Auto discovery:
The first sentence of the text of that link is totally INcorrect. CO2 is NOT carcinogen, he mixed things up with CO.
Last edited by EddyG on Tuesday 18 January 2022 11:47, edited 1 time in total.
Creo2005
Posts: 25
Joined: Wednesday 26 February 2020 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Creo2005 »

jvdz wrote: Tuesday 18 January 2022 11:34 When things aren't working it would help when it is reported and you supply the MQTT CONFIG & STATE update TOPICS & PAYLOADS, so it can be looked at!
PS: The sensors device only gets created after an update is received.
What "sensors update is received"? What do you mean i'm new to this.
I am in beta:
Version: 2021.1 (build 14081)
Build Hash: 24e7b76a0
Compile Date: 2022-01-17 16:17:46
dzVents Version: 3.1.8
Python Version: 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0]
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jvdz »

When using the new MQTT AutoDiscovery available in the current Beta version, the Config MQTT payload is received and some devices are created at that stage like Lights/Switches. Sensor type devices are only created after the first data is received for that device via MQTT, as at time we are able to determine what type of Sensor it is by check the "unit_of_measurement" e.g. C/W/kWh.

Maybe a good start is to read up on MQTT and AutoDiscovery in the Wiki https://www.domoticz.com/wiki/MQTT#Add_ ... Gateway.22

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Hann1BaL
Posts: 23
Joined: Sunday 11 March 2018 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Hann1BaL »

Since I had to replace my coordinator I did a clean sheet and removed the old database. Changed the configuration and paired all devices again.

Also that was the best moment to update Zigbee2MQTT, and the plugin.
That was not a great idea as the most recent version of the plugin is not supported in the stable release of Domoticz.

The result now is: Running on somewhat of an older branch made it work.
The web interface in Domoticz is not working. I worked around that by using the cli to pair the devices etc..

THe main problem I now still have:
groups with names ending on _ct and _dimmer are not imported and don't create devices. The group is functional as I also have a physical switch connected to the group, which works fine.

Have tried many different checkouts of the plugin and restarted domoticz, but I cant get it to work :(
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by sammyke007 »

Hann1BaL wrote: Sunday 23 January 2022 19:51 Since I had to replace my coordinator I did a clean sheet and removed the old database. Changed the configuration and paired all devices again.

Also that was the best moment to update Zigbee2MQTT, and the plugin.
That was not a great idea as the most recent version of the plugin is not supported in the stable release of Domoticz.

The result now is: Running on somewhat of an older branch made it work.
The web interface in Domoticz is not working. I worked around that by using the cli to pair the devices etc..

THe main problem I now still have:
groups with names ending on _ct and _dimmer are not imported and don't create devices. The group is functional as I also have a physical switch connected to the group, which works fine.

Have tried many different checkouts of the plugin and restarted domoticz, but I cant get it to work :(
Release https://github.com/stas-demydiuk/domoti ... 8e3a492306 worked for me when I was still on stable. Any reason to not update to beta? I was always afraid to update my table Domoticz to beta, but it's rock solid since a few months on an older beta build 13872 (with the new framework supported).

Use

Code: Select all

cd domoticz/plugins/zigbee2mqtt
git reset --hard f8c22fc330229b39f06ff11bbfcea38e3a492306
Hann1BaL
Posts: 23
Joined: Sunday 11 March 2018 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Hann1BaL »

sammyke007 wrote: Sunday 23 January 2022 20:11
Hann1BaL wrote: Sunday 23 January 2022 19:51
Release https://github.com/stas-demydiuk/domoti ... 8e3a492306 worked for me when I was still on stable. Any reason to not update to beta? I was always afraid to update my table Domoticz to beta, but it's rock solid since a few months on an older beta build 13872 (with the new framework supported).

Use

Code: Select all

cd domoticz/plugins/zigbee2mqtt
git reset --hard f8c22fc330229b39f06ff11bbfcea38e3a492306
I did go for beta. Reason not to do it: General risk of breaking things that are working.
So backup and go.
Upgraded the plugin to latest version as well, and domoticz to latest beta build. (using the updatebeta.sh )

I know have the join device tickbox in the Zigbee2MQTT menu. However, still the devices dont load.

The groups loaded but dont work.
There is a device 0 and device 1 in the list, based on the groups, but the groups have a friendly name.

Code: Select all

groups:

  '901':
    friendly_name: DinnerTable_ct
    retain: false
    transition: 0
    optimistic: true
    devices:
      - '0x680ae2fffe92ae2d'
      - '0x680ae2fffe819f83'
      - '0x680ae2fffe85c033'
      - '0x680ae2fffe3b5e05'

'1':
    friendly_name: Woonkamer_dimmer
    retain: false
    transition: 0
    optimistic: true
    devices:
      - '0x000b57fffe9beca6'
      - '0xec1bbdfffebcdf6c'
      - '0x680ae2fffe40db06'
      
I would expect 2 devices:
Woonkamer
Dinnertable
Hann1BaL
Posts: 23
Joined: Sunday 11 March 2018 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by Hann1BaL »

Ok, I have enabled the frontend of zigbee2MQTT itself to edit groups etc.

Created groups through the GUI. Now I see those groups imported into Domoticz.
Also the correct devices are created based on _dimmer and _ct
However, the slider of the brightness levels of those devices are broken. The do switch ON and OFF but the slider always states 0
Also the dimmer of this device: TRADFRI bulb E27 W opal 1000lm is broken and shows 0 and jumps back to 0.

Oh, and the webpage within Domoticz of the Zigbee2MQTT plugin is still completely broken.

What I did:
1. Updated Domoticz to BETA
2. Git checkout MASTER on the zigbee2mqtt plugin
3. Removed Zigbee2MQTT from the Hardware in Domoticz
4. Restarted Domoticz
5. Added the ZIgbee2MQTT hardware back to Domoticz (now the groups came in)


Had to refer to my Stable backup:
The mobile page layout turned into a big disaster. So couldnt use it on mobile.
Reverting back to stable made it work on all my mobile devices. Guess what: my desktop browsers (cleared cache and everything) now failing to load the devices.

Can't believe I cant get it to work anymore :(
Last edited by Hann1BaL on Monday 24 January 2022 20:21, edited 2 times in total.
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by sammyke007 »

Did you already add the device "api_transport" in Domoticz --> Settings --> Devices? You need to add it (green arrow). You can put a $ in front of the name to make it hidden. This fixes the custom Z2M menu in Domoticz normally.
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by darrepac »

Hello

I have updated to latest stable (2022.1) and latest zigbee2mqtt ( I should have not as everything was working well before) and I have the following error in the log:
Error: Zigbee2MQTT: 'onCommand' failed 'TypeError':''NoneType' object is not subscriptable'.
2022-02-02 22:23:04.923 Error: Zigbee2MQTT: Exception traceback:
2022-02-02 22:23:04.924 Error: Zigbee2MQTT: ----> Line 302 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onCommand
2022-02-02 22:23:04.924 Error: Zigbee2MQTT: ----> Line 104 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onCommand
2022-02-02 22:24:01.300 Error: Zigbee2MQTT: 'onCommand' failed 'TypeError':''NoneType' object is not subscriptable'.
None of my devices are now working...
Any hint?
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest