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

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

Moderator: leecollings

Thorgal789
Posts: 849
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 »

I m not sure to understant what you are doing but:
- You can't have 2 deconz instance running, so you need to close the headless before launching the GUI version.
- Depend on OS, but some "VNC mode" launch a new session, so service are only executed when you run the VNC session, mean GUI services are not working, but only launch when you start the VNC session.

You can use thoses lines to see deconz services

Code: Select all

sudo systemctl status deconz
sudo systemctl status deconz-gui
You need to have an error on one of them.

Mode Headless :

Code: Select all

    sudo systemctl disable deconz-gui
    sudo systemctl stop deconz-gui
    sudo systemctl enable deconz
Mode with GUI :

Code: Select all

    sudo systemctl disable deconz
    sudo systemctl stop deconz
    sudo systemctl enable deconz-gui


How many time your installation is working ? If its after 1 hour, I think it 's more a zigbee connexion issue, are you using the USB cable extension ?
Have you take a look in phoscon ?

Your problem is not websocket, because you have error when trying to change a switch state (websocket impact only return), this error happen generaly when the device have disconnected, but it's a light ...

If you have access to GUI, you can find deconz log on the application / help / debug view, use flag "error" "error_l2" "info" and "info_l2".
Pacman42
Posts: 19
Joined: Monday 28 December 2015 1:36
Target OS: NAS (Synology & others)
Domoticz version:
Location: Sweden
Contact:

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

Post by Pacman42 »

I am not using VNC, I use RDP to avoid such problems. But maybe these problems do occur with RDP as well?

I have manuall stopped/started the services, so it is not that. I have connectivity for everything else in deConz, but not for setting the state of the switches. Polling the state from deConz plugin is not working, state change from deConz is working.

Based on your list of proposals I would need to use HDMI and keyboard on the Raspberry (no remote login) and see if it works after a reboot then. But as I am not at home this week, I will have to wait with that 'til the weekend. But as I think wrote earlier, headless deConz and and then rebooting was not helping either. But this seems to be the most likely reason.
Thorgal789
Posts: 849
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 »

Based on your list of proposals I would need to use HDMI and keyboard on the Raspberry (no remote login) and see if it works after a reboot then
It s more complex than that, and I m not skilled enought to explain ^^.
On raspbian you can use a desktop environnement, without keyboard and video output, no problem (I have this setup), but the OS run in desktop mode, you can use a VNC to just connect to it.
I have the issue on some linux headless environnement, the OS is headless and when the user run VNC, he go on a new session with graphical stuff.
I have too this issue on Raspbian, the VNC mode need to be enabled with raspi-config, not added on the headless base OS else it's same result.

There is too issue on other VNC clients (for exemple TightVNC ), only the native one included with raspbian is 100% sure.

But it seem the problem is elsewhere
Polling the state from deConz plugin is not working, state change from deConz is working
You have connexion with deconz, when there is configuration issue you have "not connected" instead of a firmware number in phoscon, and the API is working.
You can change the device state using the GUI, but not working using phoscon/domoticz ? (make action, not poll/websocket stuff), it that that trigger this kind of error

Code: Select all

{'error': {'address': '/lights/3/state', 'description': 'resource, /lights/3/state, is not modifiable. Device is not reachable.', 'type': 202}}
On phoscon or the domoticz front end, you can check the device json state, in Phoscon / help / API Information / lights / 3

BTW, what is your deconz version ? (Not asking for firmware)
Pacman42
Posts: 19
Joined: Monday 28 December 2015 1:36
Target OS: NAS (Synology & others)
Domoticz version:
Location: Sweden
Contact:

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

Post by Pacman42 »

I have now identified the problem. The switches are existing in deConz, but not in Phoscon. I will remove them and re-pair them during the weekend and see if that solves the problem. I didn't know that deConz and Phoscon could get out of sync...
Thorgal789
Posts: 849
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 »

Deconz is the application that manage the zigbee network
The API is just a plugin in it, you can have a device in the zigbee network, so visible in deconz, but not reconised by the API, so not usable by third app.

But it's strange, a not reconised device is not in the API at all, you can't have error message like the previous one.

If the device is disconnected, you can see it grayed in deconz (and have this kind of message), and on the device json you will see reachable = false.
If the node name is like 0xXXXX it mean it s in the zigbee network but not in the API.

By curisoity it's not a Legrand device ?
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

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

Post by andersbz »

Thanks for this excellent plugin!! Are there any plans to support the Aqara Roller Shade Driver E1? I have managed to connect it and I can control it with the on/off light switch but not with the Switch type for blinds
Thanks Anders
Thorgal789
Posts: 849
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 »

andersbz wrote: Thursday 03 November 2022 20:54 Thanks for this excellent plugin!! Are there any plans to support the Aqara Roller Shade Driver E1? I have managed to connect it and I can control it with the on/off light switch but not with the Switch type for blinds
Thanks Anders

It's not this one ? https://github.com/dresden-elektronik/d ... ssues/6469

I don't remember all the issue, but if Im right, the motor is working, but still missing sensors (light, temperature, battery, ect ...)
You just need to instal the DDF in the issue to test it.
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

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

Post by andersbz »

Yes the motor is working if you change from suggested Venetian Blinds EU to a on/off switch. So you cant use the stop funktion and there is no value for battery level in the battery level icon. But I'm thankful that the basic function works. Thanks again for the plugin Thorgal789!!
Thorgal789
Posts: 849
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 »

Yes the motor is working if you change from suggested Venetian Blinds EU to a on/off switch
Ha ? I don't know this method, it's the same device than on the previous link ? If yes you need to install the DDF.
Else I don't see why it work better with an on/off than a Venetian Blinds EU, you can't take a look on debug return to see the request differences ?
Thorgal789
Posts: 849
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 »

andersbz wrote: Sunday 06 November 2022 15:36 Yes the motor is working if you change from suggested Venetian Blinds EU to a on/off switch. So you cant use the stop funktion and there is no value for battery level in the battery level icon. But I'm thankful that the basic function works. Thanks again for the plugin Thorgal789!!
@andersbz and other, I have finally understand what you are saying.
The plugin is updated and now widget with covering are working again (no need to use switch widget). They are broken after the last domoticz version.

You can update the plugin going in the plugin folder and making

Code: Select all

git pull
Them restart the plugin using domoticz/setting/hardware/deconz/update.

If you are using the plugin manager, the correction is online.

And if you want more information or if you are on windows and want to download direclty files Plugin zigbee deconz for domoticz
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

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

Post by andersbz »

Thanks Thorgal, I will update as soon as possible.
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

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

Post by andersbz »

Now it works as intended, thank you very much
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 »

I had to reinstall phoscon due to a broken sd card in my raspberry pi. I managed to get the system up and running (fortunately I had recently made a backup). However, I am unable to connect from domoticz (on another PC). If I go to the deconz tab from domoticz and create a new api key under tools, it is neatly displayed. If I then enter this key in the deCONZ plugin, my devices are not retrieved. The logs therefore state: 2022-12-02 09:00:39.062 Error: zigbee dongle: Connection problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2

If I create the API key via postman plugin in Chrome, an API key is also neatly generated. When I then request a list of my lights, I get the following, while there are a lot of lights are present:
"success": {
"/lights": "Searching for new devices",
"/lights/duration": 180
}

Also with this API key in Domotics no connection is made.
Any idea what I've missed?
Thorgal789
Posts: 849
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 »

I don't think the problem is from deconz or domoticz because all seem working, you just miss the connection beetween domoticz and deconz.
Can come from the OS if it's a new OS, have you updated it ?

Check at least the python request lib version (used by the plugin)

Code: Select all

sudo -H pip3 install requests
sudo -H pip install requests
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 »

Thanks for the tip, but unfortunately no difference. Some additional packages have been installed but still no connection is made. Does Phoscon also keep a log file? Any idea what else I can try?
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 »

Log domoticz:

Code: Select all

2022-12-06 20:13:15.080 zigbee dongle: onHeartbeat called
2022-12-06 20:13:15.081 zigbee dongle: ### Initialisation > config
2022-12-06 20:13:15.081 zigbee dongle: ### Request config
2022-12-06 20:13:15.081 zigbee dongle: Send Command /api/702390EF7E/config/ with None (0 in buffer)
2022-12-06 20:13:15.081 zigbee dongle: Making Request: http://192.168.68.120:80/api/702390EF7E/config/ with params None2022-12-06 20:14:46.065 Error: zigbee dongle: Connection problem (3) with Gateway, check your API key, or Use Request lib > V2.4.2
Thorgal789
Posts: 849
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 »

Sure the plugin try to connect to this url

Code: Select all

http://192.168.68.120:80/api/702390EF7E/config/
You can try it in a browser, you need to see a json file.
This url need to work, even with a bad api key, you will just have less information.

If the url is working, will try to test the python Request library, wich one version have you ?

Code: Select all

pi@raspberrypi:~ $ sudo -H pip3 install requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)

BTW if you have deconz and domoticz in the same machine, better to use the local host 127.0.0.1
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 »

When i open in a browser (made a new api key):

Code: Select all

http://192.168.68.120/api/7804402877/config/
I get:

Code: Select all

UTC	"2022-12-07T21:19:52"
apiversion	"1.16.0"
backup	
errorcode	0
status	"idle"
bridgeid	"00212EFFFF05CDBD"
datastoreversion	"93"
devicename	"ConBee II"
dhcp	true
disablePermitJoinAutoOff	false
factorynew	false
fwversion	"0x26720700"
gateway	"192.168.68.1"
internetservices	
internet	"connected"
remoteaccess	"disconnected"
swupdate	"connected"
time	"connected"
ipaddress	"192.168.68.120"
lightlastseeninterval	60
linkbutton	false
localtime	"2022-12-07T21:19:52"
mac	"40:a5:ef:06:19:db"
modelid	"deCONZ"
name	"Phoscon-GW2"
netmask	"255.255.255.0"
networkopenduration	180
ntp	"synced"
panid	27358
portalconnection	"disconnected"
portalservices	false
portalstate	
communication	"disconnected"
incoming	false
outgoing	false
signedon	false
proxyaddress	"none"
proxyport	0
replacesbridgeid	null
rfconnected	true
starterkitid	""
swupdate	
checkforupdate	false
devicetypes	
bridge	false
lights	[]
sensors	[]
notify	false
text	""
updatestate	0
url	""
swupdate2	
autoinstall	
on	false
updatetime	""
bridge	
lastinstall	"2022-12-02T18:30:54"
state	"noupdates"
checkforupdate	false
lastchange	""
state	"noupdates"
swversion	"2.19.3"
timeformat	"24h"
timezone	"Europe/London"
uuid	"1c45c16d-3e69-4d17-a6a5-01ebddda18b0"
websocketnotifyall	true
websocketport	443
whitelist	
I have version 2.21.0 installed

Code: Select all

sudo -H pip3 install requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Thorgal789
Posts: 849
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 »

All seem fine ...
Can try if python is working

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.
>>>
Then

Code: Select all

>>> import requests
>>> requests.get('https://api.github.com')
<Response [200]>

Code: Select all

exit()
to exit.

Can try too with

Code: Select all

http://192.168.68.120/api/7804402877/config/
Can you try if the plugin is still not working ?

Do you know why you have not the same ip here

Code: Select all

gateway	"192.168.68.1"
ipaddress	"192.168.68.120"
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 »

The Domoticz controller is on the wired network, The deConz bridge on a Deco wifi network. I forwarded port 80 and Dooticz came alive for a moment. After I removed the configuration of the deConz plugin in Domoticz and set it up again, the zigbee devices became visible in Domoticz. However, I am still unable to control most of the devices. Some lights respond but the switches do not. I get the following messages in the logs:

Code: Select all

2022-12-13 19:58:10.069 Error: zigbee dongle: WebSocket Disconnected, reconnecting...
2022-12-13 19:58:10.069 Error: zigbee dongle: CConnection_connect, connect request from 'zigbee dongle' ignored. Transport is connecting.
this message is repeated every 10 seconds.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest