Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee) Topic is solved

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

Moderator: leecollings

hanszel
Posts: 6
Joined: Friday 02 December 2022 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by hanszel »

hmm, forwarding port 443 dit the trick, thanks for the help Thorgal789, all seems to work now!
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

hanszel wrote: Wednesday 14 December 2022 9:12 forwarding port 443 dit the trick
Ha ? Can you explain what you have done ?
Why the fowarding is needed ? The problem is from deconz, domoticz or your network setting ?
arjan93
Posts: 21
Joined: Friday 16 November 2018 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by arjan93 »

Hii all,

I have been using Tuya roller blind motor for a year now. This is controlled by a Conbee2 controller, but since a few weeks this no longer works.
Before that there where no connection problems at all.
When I try to activate the blind domoticz give me this error in the log:

Error: Zigbee: Connection problem (1) with Gateway : 400

I`ve searched on google for this but haven`t found a solution. Other devices wich are working
with the conbee stick are working great.

Is there anyone who can help me solve this problem?

I`m running deConz on my Raspberry pi 4.
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

Hello, I think there is a problem in the request made by the plugin.
What is your plugin version ? The last one is 1.0.26.

If you are using the last one. Can you share the logs when making the request ? On the hardware page enable "debug info only".

There was a recent change for covering on the plugin, I can have break something.
arjan93
Posts: 21
Joined: Friday 16 November 2018 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by arjan93 »

Thorgal789 wrote: Saturday 24 December 2022 10:27 Hello, I think there is a problem in the request made by the plugin.
What is your plugin version ? The last one is 1.0.26.

If you are using the last one. Can you share the logs when making the request ? On the hardware page enable "debug info only".

There was a recent change for covering on the plugin, I can have break something.
Thanks for the reply :)
I`ve checked the version and this was 1.0.18. After updating to 1.0.26 it works again :)

Thanks for your help!
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Sjonnie2017 »

Criky! Something went wrong today. Yesterday I re-instated my old server after discovering that the new server would not work reliably with the Conbee II stick. Since this evening I get this:

Code: Select all

 2023-02-06 19:59:05.058 ConBee2: Making Request: http://192.168.16.185:8080/api/FF949D1257/config/ with params None
2023-02-06 19:59:05.058 Error: ConBee2: Your python version is missing the requests library
2023-02-06 19:59:05.058 Error: ConBee2: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests
2023-02-06 19:59:15.075 ConBee2: onHeartbeat called
2023-02-06 19:59:15.075 ConBee2: ### Initialisation > config
2023-02-06 19:59:15.075 ConBee2: ### Request config
2023-02-06 19:59:15.075 ConBee2: Send Command /api/FF949D1257/config/ with None (0 in buffer)
2023-02-06 19:59:15.075 ConBee2: Making Request: http://192.168.16.185:8080/api/FF949D1257/config/ with params None
2023-02-06 19:59:15.075 Error: ConBee2: Your python version is missing the requests library
2023-02-06 19:59:15.075 Error: ConBee2: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests 
I have Domoticz and DeCONZ in a container and the plugin from Thorgal 789 is installed in a persistent volume outside the Domoticz container.

Where am I supposed to do the pip trick?

@Thorgal789: This has no relation with the github request.
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Thorgal888
Posts: 1
Joined: Tuesday 07 February 2023 17:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal888 »

Hello, it's Thorgal789, sorry but I was away for some days and I never remember my passwords.
This message just mean your python installation miss the "Requests" lib. This one need to be in the domoticz docker. But this library is classic, strange you can miss it, you are using a new docker version for the Domoticz one ?

It was working previoulsy ? Using pip will be useless, as docker are not persistent, you can usevthe pip command on the domoticz docker to have some informations, like the actual version, but you can miss too the pip command.

This error message appear if the simple command "import requests" fail on python.

But if you miss it, I realy have no clue how to add it on the container ...
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Sjonnie2017 »

Thanks for your reply Thorgal! It turned out that my server disk had run 100% full due to a failing script. Killed the script, cleared the space and rebooted the machine. Now all is working as expected.

Sorry for the inconvenience!
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Sjonnie2017 »

Hmmm.... Today my DeCONZ container updated with (at least) a PR for my 3 gang wall switch. Now I get the "dreaded" error:

Code: Select all

 2023-03-06 18:35:55.407 Error: ConBee2: Unknow MAJ: {'capabilities': {'alerts': ['none', 'select', 'lselect'], 'color': {'ct': {'max': 65279, 'min': 0}, 'modes': []}}, 'e': 'changed', 'id': '3', 'r': 'lights', 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:9e:8c:c3-01'}
2023-03-06 18:36:04.777 Error: ConBee2: Unknow MAJ: {'capabilities': {'alerts': ['none', 'select', 'lselect'], 'color': {'ct': {'max': 65279, 'min': 0}, 'modes': []}}, 'e': 'changed', 'id': '27', 'r': 'lights', 't': 'event', 'uniqueid': '14:b4:57:ff:fe:4d:bc:d5-01'}
2023-03-06 18:36:14.383 Error: ConBee2: Unknow MAJ: {'capabilities': {'alerts': ['none', 'select', 'lselect'], 'color': {'ct': {'max': 65279, 'min': 0}, 'modes': []}}, 'e': 'changed', 'id': '44', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:32:86:2d-01'}
2023-03-06 18:36:26.677 Error: ConBee2: Unknow MAJ: {'capabilities': {'alerts': ['none', 'select', 'lselect'], 'color': {'ct': {'max': 454, 'min': 250}, 'modes': ['ct']}}, 'e': 'changed', 'id': '22', 'r': 'lights', 't': 'event', 'uniqueid': '50:32:5f:ff:fe:ee:b9:62-01'}
2023-03-06 18:50:11.353 Error: ConBee2: Websocket error, unknown device > 77 (sensors) Asking for information
2023-03-06 18:58:34.542 Error: ConBee2: Websocket error, unknown device > 79 (sensors) Asking for information
2023-03-06 19:05:26.265 Error: ConBee2: CConnection_disconnect, disconnection request from 'ConBee2' ignored. Transport does not exist.
2023-03-06 19:05:36.068 Error: ConBee2: Your python version is missing the requests library
2023-03-06 19:05:36.068 Error: ConBee2: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests
2023-03-06 19:05:46.067 Error: ConBee2: Your python version is missing the requests library
2023-03-06 19:05:46.067 Error: ConBee2: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests
2023-03-06 19:05:56.070 Error: ConBee2: Your python version is missing the requests library 
I tried installing the missing requests with the following code:

Code: Select all

root@239d214dbaae:/opt/domoticz/userdata/plugins/Domoticz-deCONZ# pip install requests
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (2.28.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests) (2022.12.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests) (3.1.0)
root@239d214dbaae:/opt/domoticz/userdata/plugins/Domoticz-deCONZ# 
So it seams al requirements are satisfied but I still keep the error.

Any tips more than welcome!
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

Error: ConBee2: Unknow MAJ: {'capabilities':
I think you can use a more recent version of the domoticz plugin.

I have an user with the same issue previsouly, he have just restart the domoticz docker. Else to check the problem, you can test

Code: Select all

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
> >>> import requests
> >>> result=requests.get("http://192.168.1.1/api/47C64ADD4/config", headers={'Content-Type': 'application/json' }, timeout=1)
> >>> print (result)
> <Response [200]> 
But you need to be on the domoticz docker. It's the command line he have tested but can use a classic url.
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Sjonnie2017 »

Tx, Thorgal! That was the clue I needed!

For (my own) future reference:
I had a merge conflict on plugin.py. I had to correct that with the following sequence of commands:

Code: Select all

sudo git fetch --all
sudo git reset --hard origin/master
sudo git pull
Restarted the Domoticz container and I have control over my Zigbee devices again :mrgreen:
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

Ha yep, you need thoses lines, if you have edited the python file on your side.

About the error message

Code: Select all

2023-03-06 19:05:46.067 Error: ConBee2: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests
2023-03-06 19:05:56.070 Error: ConBee2: Your python version is missing the requests library
I had it too recently, and I m using raspian, just after a reboot, most of python plugin have worked, but not the deconz one (other don't use this lib), it have worked after a plugin restart, just the plugin, using hardware/deconz/update.
And I realy have no clue where it from, it's like domoticz have loaded the plugin too fast, before the python engine was set.
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Hencor »

With update to domoticz 2023.1 the temperature readings of danfoss ally thermostats are incorrect.
Python Version: 3.7.3 (default, Oct 31 2022, 14:04:00) [GCC 8.3.0]

The are the room tempature reading from the thermostat and not the setpoint value. In phoscon the value are correct.
Ally.PNG
Ally.PNG (79.05 KiB) Viewed 1494 times
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

It don't make 224 °C in your home ?
Seriously, you are sure it's from domoticz update ? You haven't updated deconz or the plugin itself in same time ?

Values need to be / 10, but I don't see what have moved. You have this issue only for thoses TRV not other temperature sensor ?
Can you check the raw value ? it's state/temperature, you can found the complete json in the front end (custom/deconz/sensor) or in phoscon/help/API Information / sensors.

Do you know wich one plugin version you have ATM ?
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Hencor »

In fact I don‘t really know if it appears just with the domoticz update or I‘ve updated also the plug-in. :roll: But for testing I set up a second Testsystem with the newest versions and only deconz plugin as hardware with same results.

Very good hint to check the API. I have the issue only on the TRVs and found the origin of the value. It’s not only multiplied but a whole different one.
On them I‘m running a custom deconz DDF to have functionality not yet implemented proberly. I recycled a existing item and the plugin takes this state/pm2_5 and not the state/temperature. But I‘m running this DDF since month and never faced that issue.
So how the plugin pick the right state/temperature?
007A4F4D-A23C-4837-B99F-5D6ADB385D79.jpeg
007A4F4D-A23C-4837-B99F-5D6ADB385D79.jpeg (274.67 KiB) Viewed 1480 times
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

Ha yes, so I think I have understand.
This is an order for state, so the plugin update first the temperature (and / 100) and the value will be 21.80°C , but just after it update the widget with pm2.5 (there is only 3 widget for TRV, a temperature one, a mode one, and a setheatpoint one), so you will have as value 271 °C.

I probably can do something on plugin side, but wich one value you try to get with this "hack" ? pm2.5 are more for ZHAAirquality, what is the missing one for you ?
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Hencor »

But why the plugin takes now the pm2.5 and not the temperature anymore and the value seems not to be divided at all? Is the plugin just locking for the 5th state attribute?
Can you may give me a hint in which line in the python script I can find this, so I can have a look by myself?

I‘m using this pm2.5 just because it is defined to be used on a deconz DDF and not used by TRVs usually. The ally TRVs have a Load Balancing feature that allows to balance the radiators heating load when there are more than one in a room. With the pm2.5 I make the estimated load which is calculated by each TRV available in the API.
My goal is not to have this value available in domoticz via the plugin, I just pull this value through a API call in my Dzvents scripts, but nevertheless it would be useful. But I think it is better to wait that this estimated load is properly introduced to deconz later.
I just want the right temperature readings back. :D
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

But why the plugin takes now the pm2.5 and not the temperature anymore and the value seems not to be divided at all? Is the plugin just locking for the 5th state attribute?
The plugin is moving, pm2.5 was probably not managed previously, there is some evolution time to time ^^, like the support for zigbee keypad for exemple Add zigbee keypad to domoticz
And values are not divided for pm2.5.

As fast patch, we can just change the order in the fonction.py, just need to put "temperature" after "pm2_5" in the fonction

Code: Select all

def ProcessAllState(data,model,option):
Can give full code if needed ?


I can use something better in the code, but in reality TRV will never have "pm2.5", so will be not used a lot.
Can you give me the attribute used on your DDF and how you want to call it "config/XXXXX" I can make a PR to have it offcialy ? will be better than use pm2_5.
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Hencor »

Yeah, software is moving, it’s totally okay. :lol:

I just want to understand why the update broke the temperature readings with my DDF. I understood that the issue appear because the pm2.5 is now supported. Why the temperature value is replaced by the pm2.5? How is the API state linked to the domoticz device?
I‘m just interested how this works.

I already gave my input to this GitHub issue:
https://github.com/dresden-elektronik/d ... /issues/13

And we discussed also in the deconz forum.
Thorgal789
Posts: 815
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python Zigbee plugin, deCONZ bridge (Using Conbee or Raspbee)

Post by Thorgal789 »

Yeah, almost impossible having all devs agree with a change (and can take months). But making a small PR with only 1 field have more chance to be valided, if I have understand you need "state/LoadEstimateOnThisRadiator" ?
It's realy usefull for you ? because on my side I don't see what to do with this value.
Why the temperature value is replaced by the pm2.5? How is the API state linked to the domoticz device?
Realy simple, at start the plugin create 1 or more widget by device, 3 for TRVs, 1 temperature (1), a mode (2) and a Setheatpoint (3).
When deconz send a websocket return, the contain is parsed, config part is managed by (2) and (3), and state by (1), there is no check in this part because on TRV only temperature is used, TRV don't have pm2.5 at base. In your situation pm2.5 overwrite the temperature value.

To solve the problem we can :
- add a check to use only tmperature and not pm2.5, but this situation need don't happen.
- use temperature after pm2.5, I think I will do that but I need to be sure there is no other widget impacted by this change.
- make something to avoid this hack in deconz ^^. An official PR.
- use a field other than "pm2.5" not used by the plugin (but can be used later)

Honnestly I think we can try the third solution and if they don't validate the PR, I will make the second.
You can make the second solution waiting for something official to have good temperature.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests