Python Plugin: Zigbee2Mqtt Topic is solved

Python and python framework

Moderator: leecollings

peerkersezuuker
Posts: 70
Joined: Monday 14 December 2015 22:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Mierlo
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by peerkersezuuker »

Hello Gemas,
I have a similar problem, only with a Gledopto GL-B-001ZS
https://www.domoticz.com/forum/viewtopi ... 2#p252712
I also have several IKEA GU10, but they work flawless.
I had this question also reported on the github page from Koenkk the creator of the zigbee2mqtt software, but still no response.
https://github.com/Koenkk/zigbee2mqtt/issues/3376

[EDIT]
Saw your resolution, unfortunaly did not work for me.
jvrr
Posts: 16
Joined: Monday 27 April 2020 12:53
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jvrr »

This device is just added to Zigbee2mqtt:
https://www.zigbee2mqtt.io/devices/NAS-AB02B0.html

Where can I ask to support it in this plugin also?

Thanks!!!
StasDemydiuk
Posts: 59
Joined: Saturday 14 January 2017 21:37
Target OS: Linux
Domoticz version: Beta
Location: Ukraine
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by StasDemydiuk »

Please create a ticket for support there
https://github.com/stas-demydiuk/domoti ... gin/issues
eddieb
Posts: 279
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by eddieb »

hmm, just did a git pull on the plugin and now I get :

2020-08-16 11:24:48.076 Error: (Zigbee2MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/zigbee2mqtt/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-08-16 11:24:48.076 Error: (zigbee2mqtt) Module Import failed, exception: 'ModuleNotFoundError'
2020-08-16 11:24:48.076 Error: (zigbee2mqtt) Module Import failed: ' Name: adapters.lumi.WXKG07LM'
2020-08-16 11:24:48.076 Error: (zigbee2mqtt) Error Line details not available.

running latest raspbian on rpi3+ and latest beta domoticz

any suggestions ?
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by EdwinK »

Same problem
2020-08-16 12:12:22.676 Status: (Zigbee2MQTT) Started.
2020-08-16 12:12:23.364 Error: (Zigbee2MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/zigbee2mqtt/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-08-16 12:12:23.364 Error: (Zigbee2MQTT) Module Import failed, exception: 'ModuleNotFoundError'
2020-08-16 12:12:23.364 Error: (Zigbee2MQTT) Module Import failed: ' Name: adapters.lumi.WXKG07LM'
2020-08-16 12:12:23.364 Error: (Zigbee2MQTT) Error Line details not available.
2020-08-16 12:13:35.627 Error: Zigbee2MQTT hardware (41) thread seems to have ended unexpectedly
2020-08-16 12:13:49.630 Error: Zigbee2MQTT hardware (41) thread seems to have ended unexpectedly
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
eddieb
Posts: 279
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by eddieb »

tnx @EdwinK, glad that I am not the only one ...
I allready created an issue on github for this problem
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 279
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by eddieb »

see github issue https://github.com/stas-demydiuk/domoti ... issues/386

Tn the mean time I might have found the problem :
The file WXKG07LM.PY has an UPPERCASE extention PY while it should be py ...

problem is fixed in latest version !
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
_chris
Posts: 3
Joined: Tuesday 17 December 2013 21:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by _chris »

madradrakie wrote: Tuesday 09 June 2020 20:18 it is working now after some changes in devices.js file. The model which was recognized was ZG2835RAC. In de devices.js file this model number was assigned to

{ zigbeeModel: ['Micro Smart Dimmer'], model: 'ZG2835RAC', vendor: 'Sunricher', description: 'ZigBee knob smart dimmer', extend: generic.light_onoff_brightness, },

i know changed this one to:

{ zigbeeModel: ['Micro Smart Dimmer'], model: 'ZG2835RAC', vendor: 'ROBB', description: 'ZigBee AC phase-cut rotary dimmer', extend: generic.light_onoff_brightness, meta: {configureKey: 1}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']); await configureReporting.onOff(endpoint); }, },
I also added the following in init.py file:

'ZG2835RAC': DimmableBulbAdapter, # ROBB ZigBee AC phase-cut rotary dimmer

Now the dimmer is also recognized in Domoticz so i can add the dimmer as a device.
Thanx. helped me a lot!
I have the Yphix version (https://www.leddirect.nl/yphix-muurdimmer-zigbee-230v) but instead of add a record in /home/pi/domoticz/plugins/zigbee2mqtt/adapters/__init__.py
I changed the model in /opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices.js from ZG2835RAC to ROB_200-014-0
Not all functions (watt, voltage, amps) but it's dimmable via Domoticz
snieuwen
Posts: 5
Joined: Sunday 20 December 2015 21:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by snieuwen »

I've got Zigbee2MQTT running fine, connected to Domoticz. But I have a devices, "TS0044" (Tuya) which does not seem to be recognized by the Domoticz plugin. Did anyone manage to add this to the plugin code? I guess it should not be too difficult to modify TS0041 (TuYa Wireless switch with 1 button
) to TS0044 (the same with 4 buttons) but time and Python skills are lacking.
This is the MQTT message that is published one I push button "left_top_single" (i.e. single press), you can imagine the messages by modifying left/right, top/bottom and single/double.
zigbee2mqtt/0xbc33acfffe28bd72 {"action":"left_top_single","battery":100,"linkquality":15,"voltage":3000}
gschmidt
Posts: 200
Joined: Thursday 20 December 2018 11:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by gschmidt »

Hi,

I have installed "domoticz-zigbee2mqtt-plugin" version 0.2.1.
In Domoticz, the plug-in has automatically created a dimmer switch "Tuin_Licht_ct" of the zigbee2mqtt group "Tuin_Licht_ct".
The dimmer switch always remembers the last dimLevel when turned ON.
How can I set an initial dimLevel (e.g. 78) each time "Tuin_Licht_ct" is turned from OFF to ON?

Greetzzz,

Gerben
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by qwerk »

Hi,

I connected a zigbee remote with zigbee2mqtt. It can adjust a few innr lightbulbs via the use of groups.
That works perfect.

But the changes are not seen in domoticz, my dashticz dashboard shows the wrong state. Even domoticz does not know if a bulb is on or off.
Is it possible to let zigbee2mqtt inform domoticz after a group action?

@gschmidt I can not find any answer to your question, did you solve your issue yet?


thanks in advance
Qwerk

meinname wrote: Sunday 24 February 2019 14:38 Hi, i'm new to Domoticz and to this Plugin.
I just got a Philips Set with a RWL021 Dimmer Switch and a LWB010 E27 Dimmable Bulb.

I set up Domoticz and zigbee2mqtt and this plugin and got the Lamp in Domoticz working within Minutes. - Really impressive.
(Cause i tried it with NodeRed and Homebridge and with the first one it was very complicated and Homebridge doesn't Philips stuff yet with the native Plugin.)

But:
when i change the status with the Dimmer Switch Domoticz doesn't update the status.
Like when i turn on the Lamp via Domoticz and turn it off via the Switch i and i want to turn it on again with Domoticz i have to switch it off and on there.
Is there a way around this like polling the status of the lamp every few seconds?
gschmidt
Posts: 200
Joined: Thursday 20 December 2018 11:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by gschmidt »

qwerk wrote: Tuesday 17 November 2020 10:30 @gschmidt I can not find any answer to your question, did you solve your issue yet?
Nope, but I have opened an issue at the GitHub site to implement the Z2M Scene option in the plug-in.
Maybe this option is a possibility to set a default state for all types of dimmer switches.

https://www.zigbee2mqtt.io/information/scenes.html
johansson
Posts: 75
Joined: Sunday 27 September 2015 15:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by johansson »

I've been a happy user for few years already, running obviously quite an old version ("Initialized version 0.0.18")... Not sure if the issue is in the plugin or somewhere else, but seems that approx 20 devices are working properly with my Domoticz setup; after some time some of the devices get lost and not seen anymore in Domoticz. They are still connected in the zigbee network map, but e.g Xiaomi buttons fail to start a script, Ikea bulb is unresponsive or a temp gauge is not sending data anymore.

So, two issues
A) tried to update the plugin to latest version, but got an error message I could not solve:
"error: Your local changes to the following files would be overwritten by merge:
adapters/__init__.py
Please commit your changes or stash them before you merge.
Aborting"
Can't recall I've fiddled with the file (possible though), but any ideas how to overcome this?

B) Assuming the update doesn't solve my problem, how to add more than 20 devices in Domoticz? This time two devices are not working, shown and connected in zigbee map, but completely unresponsive in Domoticz. Marked blue on the attachment below.

Thanks in advance for any pointers.
zigbee network map.png
zigbee network map.png (216.06 KiB) Viewed 3519 times
johansson
Posts: 75
Joined: Sunday 27 September 2015 15:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by johansson »

The updating issue was solved: git checkout adapters/__init__.py did the trick. Let's see if updating helped with missing devices as well.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Python Plugin: Zigbee2Mqtt

Post by EddyG »

I have a few mains powered devices which become unresponsive after 1 or more months.
What helps is to make the device totally powerless and connect that device to mains again.
For battery devices it just helps to activate the inclusion button once, no need to include again but just 1 press of the button.
jefft
Posts: 75
Joined: Monday 23 January 2017 23:30
Target OS: Linux
Domoticz version: 2023.1
Location: UK
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jefft »

Hi All,

I seem to have the domoticz-UI-not-updating issue that @qwerk and @gschmidt reported back in November and @johansson thought was solved. Can anyone help with why it might still be happening, please?

I've just made a new install of the plugin and added 4 tunable white bulbs (as RGBWW) to it. I had to fix the handler for them (Innr RB278T was set as dimmable, not RGBWW), which was a one-word change.

They work okay, but the status in the domoticz UI and in the domoticz database is not reliably updated when something changes. I've used a little dzVents code to confirm what I see in the UI is also what's in the domoticz engine - screenshots below are the state of things just after I switched a bulb on and set its colour temperature & brightness.

There are no errors in the domoticz or z2mqtt logs to suggest a problem and the bulb reports a good link, yet we can clearly see the bulb being sent a 'ON' state and colour temp, which it responds to, but the UI and database do not reflect this change.
Innr1.jpg
Innr1.jpg (11.74 KiB) Viewed 3489 times
Innr2.jpg
Innr2.jpg (17.32 KiB) Viewed 3489 times
Innr3.jpg
Innr3.jpg (65.06 KiB) Viewed 3489 times
I've cleared the browser cache, tried another browser, restarted domoticz (which is latest beta 12697); nothing obvious fixed it. The fact that the dzVents code shows the same status as the UI suggests to me that the domoticz engine has not been updated with the latest status for the device.

Has anyone solved this? If not, I'll raise an issue on the plugin's github...
Last edited by jefft on Thursday 26 November 2020 0:07, edited 1 time in total.
Domoticz, Z-Stick Gen.5, zzh Zigbee, rxftrx433XL on Ubuntu 22.04, HP 290 G1.
Node Red, MQTT, 80+ Z-wave, ESP8266 & Shelly, handful of Zigbee bulbs. EMS-ESP gateway for Bosch boiler. Controlicz, until it dies :-(
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jeroenkl »

EddyG wrote: Wednesday 25 November 2020 17:16 I have a few mains powered devices which become unresponsive after 1 or more months.
What helps is to make the device totally powerless and connect that device to mains again.
For battery devices it just helps to activate the inclusion button once, no need to include again but just 1 press of the button.
I can confirm I've experiencing the same issue
johansson
Posts: 75
Joined: Sunday 27 September 2015 15:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by johansson »

jefft wrote: Wednesday 25 November 2020 18:26 I seem to have the domoticz-UI-not-updating issue that @qwerk and @gschmidt reported back in November and @johansson thought was solved. Can anyone help with why it might still be happening, please?
Just to clarify; I was just able to update my plugin but have still the same issue with devices being lost in Domoticz. One of the two missing ones was found, another one is still missing. Annoying.
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by jeroenkl »

snieuwen wrote: Tuesday 20 October 2020 19:08 I've got Zigbee2MQTT running fine, connected to Domoticz. But I have a devices, "TS0044" (Tuya) which does not seem to be recognized by the Domoticz plugin. Did anyone manage to add this to the plugin code? I guess it should not be too difficult to modify TS0041 (TuYa Wireless switch with 1 button
) to TS0044 (the same with 4 buttons) but time and Python skills are lacking.
This is the MQTT message that is published one I push button "left_top_single" (i.e. single press), you can imagine the messages by modifying left/right, top/bottom and single/double.
zigbee2mqtt/0xbc33acfffe28bd72 {"action":"left_top_single","battery":100,"linkquality":15,"voltage":3000}
Works fine for me.
I added the file TS0044.py:

Code: Select all

from adapters.adapter_with_battery import AdapterWithBattery
from devices.switch.selector_switch import SelectorSwitch


class TS0044(AdapterWithBattery):
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'action', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Sw_1 Click', '1_single')
        self.switch.add_level('Sw_1 Double Click', '1_double')
        self.switch.add_level('Sw_1 Hold', '1_hold')
        self.switch.add_level('Sw_2 Click', '2_single')
        self.switch.add_level('Sw_2 Double Click', '2_double')
        self.switch.add_level('Sw_2 Hold', '2_hold')
        self.switch.add_level('Sw_3 Click', '3_single')
        self.switch.add_level('Sw_3 Double Click', '3_double')
        self.switch.add_level('Sw_3 Hold', '3_hold')
        self.switch.add_level('Sw_4 Click', '4_single')
        self.switch.add_level('Sw_4 Double Click', '4_double')
        self.switch.add_level('Sw_4 Hold', '4_hold')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)

    def handleCommand(self, alias, device, device_data, command, level, color):
        self.get_device_by_alias(alias).handle_command(device_data, command, level, color)
and add TS0044 in file __init__.py:

Code: Select all

from adapters.on_off_switch_adapter import OnOffSwitchAdapter
from adapters.generic.blind_adapter import BlindAdapter
from adapters.generic.plug import PlugAdapter
from adapters.generic.temp_hum_sensor import TemperatureHumiditySensorAdapter
from adapters.tuya.TS0002 import TS0002
from adapters.tuya.TS0012 import TS0012
from adapters.tuya.TS0013 import TS0013
from adapters.tuya.TS0015 import TS0015
from adapters.tuya.TS0041 import TS0041
from adapters.tuya.TS0044 import TS0044
from adapters.tuya.TS0601 import TS0601


tuya_adapters = {
    'TS0121': OnOffSwitchAdapter,               # TuYa 10A UK or 16A EU smart plug
    'TS0121_plug': PlugAdapter,                 # TuYa 10A UK or 16A EU smart plug
    'TS0121_switch': OnOffSwitchAdapter,        # TuYa Smart light switch module (1 gang)
    'TS0201': TemperatureHumiditySensorAdapter, # TuYa Temperature & humidity sensor with display
    'TS0002': TS0002,                           # TuYa 2 gang switch
    'TS0011': OnOffSwitchAdapter,               # TuYa Smart light switch - 1 gang without neutral wire
    'TS0012': TS0012,                           # TuYa Smart light switch - 2 gang without neutral wire
    'TS0013': TS0013,                           # TuYa Smart light switch - 3 gang without neutral wire
    'TS0015': TS0015,                           # TuYa Multiprise with 4 AC outlets and 2 USB super charging ports (10A or 16A)
    'TS0041': TS0041,                           # TuYa Wireless switch with 1 button
    'TS0044': TS0044,                           # TuYa Wireless switch with 4 button TEST
    'TS0601_curtain': BlindAdapter,             # TuYa Curtain motor
    'TS0601_thermostat': TS0601,                # TuYa Radiator valve with thermostat
    'mcdj3aq': BlindAdapter,                    # TuYa Tubular motor
}
User avatar
felix63
Posts: 244
Joined: Monday 07 December 2015 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Gouda
Contact:

Re: Python Plugin: Zigbee2Mqtt

Post by felix63 »

Zigbee2MQTT Page not loading anymore... Stuck on 'loading ...'
Running Domoticz Version: 2020.2 on a raspberry Pi 3b+
Schermafbeelding 2020-12-06 om 20.20.40.jpg
Schermafbeelding 2020-12-06 om 20.20.40.jpg (99.58 KiB) Viewed 3141 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest