Conbee 2 and deCONZ plugin not cooperating

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

Moderator: leecollings

Post Reply
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

Greetings
First time here, I've mostly managed to solve things myself but this time I'm stuck solid.
Domoticz is version 4.11485 on Raspverry Pi 3. Conbee 2 is connected to the same PI. The plugin is installed as per https://github.com/Smanar/Domoticz-deCO ... /README.md.
I can surf to the PI on the assigned port 8088 in the deCONZ start script and control my Philips light bulb in the Phoscon App. I've set up an API key and I can make POSTs and GET using Postman using the key. Debug logs from deCONZ show my actions from my PC.

I believe I'm stuck on the plugin. I've added it to Domoticz and given it the API key, web port 8088 and 127.0.0.1 as IP. I've seen posts where there is also a web socket port configurable in Domoticz for the plugin, I don't have that option.

When I enable the plugin Domoticz freezes up and I see no logs from the deCONZ indicating any connection attempts. Only way back into Domoticz is a service restart and to be quick in disabling the plugin.

I need some pointers as this has got me lost. Also I'm not to good at digging up Domoticz logs, I thought I had enabled loglevel 0 but nothing in particular is sent to syslog appart from the message that zigbee is enabled.

Regards
Fredrik
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

Hello, the websocket have disapear, now the plugin directly read the websocket port from deconz config.

Wich one python version have you ?

Code: Select all

python3 --version
You have domoticz and deconz on same machine ?

If you know a little python, can you edit the code and edit the line 53 "import requests" and replace it by "import json" for exemple, your plugin will not work, you will have error message but it's to find the freeezing function.

You realy don't have no logs from domoticz, even with enabling a better error log level, it frezze and you can change tab to error log ?
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

Hello
Thank you for the quick answer. My python is 3.4.2. I made the code change at after enabling the plugin in Domoticz I got this log from Domoticz
2019-11-14 17:48:26.382 (RFX433) Wind (Hustaket)
2019-11-14 17:48:27.570 Status: (Zigbee) Started.
2019-11-14 17:48:28.040 (Zigbee) Domoticz and deCONZ are on same machine
2019-11-14 17:48:28.040 (Zigbee) Debug logging mask set to: PYTHON
2019-11-14 17:48:28.033 Status: (Zigbee) Entering work loop.
2019-11-14 17:48:28.035 Status: (Zigbee) Initialized version 1.0.11, author 'Smanar'
2019-11-14 17:48:38.070 (Zigbee) onHeartbeat called
2019-11-14 17:48:38.071 (Zigbee) ### Initialisation > config
2019-11-14 17:48:38.071 (Zigbee) ### Request config
2019-11-14 17:48:38.071 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:48:38.072 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:48:38.072 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:48:48.043 (Zigbee) onHeartbeat called
2019-11-14 17:48:48.044 (Zigbee) ### Initialisation > config
2019-11-14 17:48:48.044 (Zigbee) ### Request config
2019-11-14 17:48:48.044 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:48:48.045 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:48:48.045 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:48:58.067 (Zigbee) onHeartbeat called
2019-11-14 17:48:58.067 (Zigbee) ### Initialisation > config
2019-11-14 17:48:58.068 (Zigbee) ### Request config
2019-11-14 17:48:58.068 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:48:58.068 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:48:58.068 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:49:08.091 (Zigbee) onHeartbeat called
2019-11-14 17:49:08.092 (Zigbee) ### Initialisation > config
2019-11-14 17:49:08.092 (Zigbee) ### Request config
2019-11-14 17:49:08.092 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:49:08.093 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:49:08.093 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:49:18.066 (Zigbee) onHeartbeat called
2019-11-14 17:49:18.067 (Zigbee) ### Initialisation > config
2019-11-14 17:49:18.067 (Zigbee) ### Request config
2019-11-14 17:49:18.068 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:49:18.068 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:49:18.068 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:49:28.091 (Zigbee) onHeartbeat called
2019-11-14 17:49:28.091 (Zigbee) ### Initialisation > config
2019-11-14 17:49:28.092 (Zigbee) ### Request config
2019-11-14 17:49:28.092 (Zigbee) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-14 17:49:28.092 (Zigbee) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-14 17:49:28.093 Error: (Zigbee) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
2019-11-14 17:49:34.358 (Zigbee) onStop called
2019-11-14 17:49:34.355 Status: (Zigbee) Stop directive received.
2019-11-14 17:49:34.356 Status: (Zigbee) Exiting work loop.
2019-11-14 17:49:34.456 Status: (Zigbee) Stopping threads.
2019-11-14 17:49:34.457 Status: (Zigbee) Stopped.

This is really weird since the same API key allows me to make http request using a browser.

/Fredrik
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

Ok, so like usual the problem is from the python request library and its integration in domoticz ...

On my side I have the Python 3.5.3.

Can you check your requests intall, pls ?

Code: Select all

sudo -H pip3 install requests
And try to update it ?
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

I guess it's a mess with all these different underlying dependencies. I went on a hunch and activated the Philips Hue bridge plugin and got it authenticated to the deCONZ. After that my devices went live in Domoticz.

I've been digging most of the day with this issue and really feel like I've got where I want, even though we didn't solve the exact issue.
Again. Thank you for the support. Great product by the way.

/Fredrik
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

But, you will not have all the device supported by deconz if you are using just the Hue bridge plugin !

The request lib is used a lot in domoticz plugins, like for the chromecast one.
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

I understand. Any thoughts on how I can proceed with the investigation?

/Fredrik
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

The problem is from the python lib request and how domoticz use it in its framework. there is lot of different bug with this lib, and a lot without solution other than complete reinstall.

So the first thing is check version I think.

- Domoticz , you have last beta.
- python 3.4.2
- Requests lib ?
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

Python 2.7.9
Python3 3.4.2
Requests python lib 2.4.3
Requests python3 lib 2.22.0

Domoticz still gives me
2019-11-16 18:25:22.796 (ZIG) ### Request config
2019-11-16 18:25:22.797 (ZIG) Send Command /api/DAE42D0A1F/config/ with None (0 in buffer)
2019-11-16 18:25:22.797 (ZIG) Making Request : http://127.0.0.1:8088/api/DAE42D0A1F/config/ with params None
2019-11-16 18:25:22.797 Error: (ZIG) Connexion problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

For error in plugin, it's normal, you need to reverse the modification

Code: Select all

can you edit the code and edit the line 53 "import requests" and replace it by "import json" for exemple
but you will have freeze again (except if you have changed something)

I have make test on my side.
I still have request 2.21 (impossible to update to your version).
Python 3.5.3, have you check in domoticz logs, at startup if domoticz use the same version than your system (3.4.2 for you) ?
Domoticz V4.11488
On raspberry with raspbain Stretch

You realy need the python version 3.4 ?
TheHoff
Posts: 7
Joined: Thursday 14 November 2019 15:32
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by TheHoff »

Hi all
After some fiddling I decided to move the deConz/domoticz setup to a fresh Raspberry Pi3 and after installing python with pip and requests fresh I got the latest version of everything and the plugin is working great. Much more detail than I got using the Philips Hue plugin.
I guess my battle was with python all along that was launching an older instance of python that also had an older version of the requests library.

/Fredrik
Thorgal789
Posts: 851
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: Conbee 2 and deCONZ plugin not cooperating

Post by Thorgal789 »

Happy new year ^^.

And happy it works now, after 2 months, you are not the only one that have problem with request lib and python, and most of them make like you. Python integration in the framework is a little bit sensible.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest