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

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

Moderator: leecollings

User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

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

Post by havnegata »

Will have to check tomorrow
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

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

Post by havnegata »

Thorgal789 wrote: Sunday 08 December 2019 16:54 No problem, but just for confirmation, if you remove theses 2 lines, you have again the error message about request lib ? (You are the first one that this solution have worked)
I can confirm that the errors are back when I remove these two lines
Thorgal789
Posts: 851
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 »

Ok, so good to know, there is other plugin with same problem.
Thx ^^.
scheelings
Posts: 11
Joined: Thursday 20 April 2017 12:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by scheelings »

Hi,
First of all thanks for this great plugin.
I have 1 question though. I have 1 group with 4 Ikea lights configured in the Phoson app. These lights + the group are all present in Domoticz. Now when the group dim level is changed, Domoticz is not updated with the group dim value. I have checked the log of the plugin in Domoticz and only the change from on/off of the group is notified + the change in dim level of the individual lights.

Is there a way to get the dim level of the group notified to Domoticz, so my group device is being updated accordingly?

Thanks,
Danny

Below a part of the log in Domoticz:

Code: Select all

2019-12-10 08:25:54.600 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:54.600 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '65520', 'r': 'groups', 'state': {'all_on': True, 'any_on': True}, 't': 'event'}
2019-12-10 08:25:54.600 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - All) : {'nValue': 1, 'sValue': 'on'}
2019-12-10 08:25:54.618 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:54.618 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '1', 'r': 'groups', 'state': {'all_on': True, 'any_on': True}, 't': 'event'}
2019-12-10 08:25:54.618 (deCONZ Zigbee) ### Update device (Lampen - keuken - plafond) : {'nValue': 1, 'sValue': 'on'}
2019-12-10 08:25:55.505 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.505 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '1', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:1e:78-01'}
2019-12-10 08:25:55.505 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keueken - plafond - lamp 1) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:55.521 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.521 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '3', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': 'd0:cf:5e:ff:fe:ea:6b:9a-01'}
2019-12-10 08:25:55.521 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 3) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:55.543 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.543 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '4', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:90:b1-01'}
2019-12-10 08:25:55.543 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keuken - plafond - lamp 4) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:55.574 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.574 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '2', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:22:d8-01'}
2019-12-10 08:25:55.574 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 2) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:55.582 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.582 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '4', 'r': 'lights', 'state': {'alert': None, 'bri': 56, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:90:b1-01'}
2019-12-10 08:25:55.582 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keuken - plafond - lamp 4) : {'nValue': 1, 'sValue': '21'}
2019-12-10 08:25:55.662 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.662 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '3', 'r': 'lights', 'state': {'alert': None, 'bri': 56, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': 'd0:cf:5e:ff:fe:ea:6b:9a-01'}
2019-12-10 08:25:55.662 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 3) : {'nValue': 1, 'sValue': '21'}
2019-12-10 08:25:55.677 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:55.677 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '1', 'r': 'lights', 'state': {'alert': None, 'bri': 56, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:1e:78-01'}
2019-12-10 08:25:55.677 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keueken - plafond - lamp 1) : {'nValue': 1, 'sValue': '21'}
2019-12-10 08:25:55.693 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '2', 'r': 'lights', 'state': {'alert': None, 'bri': 56, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:22:d8-01'}
2019-12-10 08:25:55.693 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 2) : {'nValue': 1, 'sValue': '21'}
2019-12-10 08:25:56.530 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:56.531 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '4', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:90:b1-01'}
2019-12-10 08:25:56.531 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keuken - plafond - lamp 4) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:56.617 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:56.617 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '1', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:1e:78-01'}
2019-12-10 08:25:56.617 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Keueken - plafond - lamp 1) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:56.633 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:56.633 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '2', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': '00:0b:57:ff:fe:d9:22:d8-01'}
2019-12-10 08:25:56.633 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 2) : {'nValue': 1, 'sValue': '48'}
2019-12-10 08:25:56.648 (deCONZ Zigbee) onMessage called
2019-12-10 08:25:56.648 (deCONZ Zigbee) ### WebSocket Data : {'e': 'changed', 'id': '3', 'r': 'lights', 'state': {'alert': None, 'bri': 123, 'on': True, 'reachable': True}, 't': 'event', 'uniqueid': 'd0:cf:5e:ff:fe:ea:6b:9a-01'}
2019-12-10 08:25:56.648 (deCONZ Zigbee) ### Update device (deCONZ Zigbee - Dimmable light 3) : {'nValue': 1, 'sValue': '48'}
Thorgal789
Posts: 851
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,
Sadly, It's not possible for group.
You can send an order to a bulb group, but you can't receive a group state, even the on/off state can't be reliable.
On the same group you can have 2 bulbs on and 2 bulbs off, because you can send too command to individual bulb. A bulb can be in 2 groups in same time, with a group in on state and the other in off state.
nicoleburdal
Posts: 1
Joined: Monday 23 December 2019 21:21
Target OS: Windows
Domoticz version:
Contact:

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

Post by nicoleburdal »

Plantje wrote: Monday 14 October 2019 19:55 Yes, created API key and everything is running! Nice!

I've jotted everything down in a manual. If people are interested I'm willing to share
Hi Plantje
I am interesed to share your manual please.
I have a conbee 2 usb dongle on Windows.
It's ok with deCONZ and Phoscon App
But, I can't see my lights neither my Conbee in Domoticz !
Thanks
Thorgal789
Posts: 851
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 »

nicoleburdal wrote: Monday 23 December 2019 21:28 Hi Plantje
I am interesed to share your manual please.
I have a conbee 2 usb dongle on Windows.
It's ok with deCONZ and Phoscon App
But, I can't see my lights neither my Conbee in Domoticz !
Thanks
Hello, where are you blocked ? Have you set the api key ? error messages ?
User avatar
Sjonnie2017
Posts: 365
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 »

Well, I just read the 20 pages in this thread as a preparation for when I get home and can tinker with my Conbee 2 I just bought. I can only say: Kudos to @Thorgal789 for his relentless support for this plugin. I now know I will get this to work! For one: I got a straightforward setup (Rπ3, all software installed on it) and if all else fails I think I will find the answer to my question/problem in this thread!

Tx!

EDIT: Got the ConBee2 and the attached devices (TRADFRI) configured and found in Domoticz without any (real) problems. Happy camper :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: 851
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 »

New version Online 1.0.12
Correction for some Philips hue.
Correction for thermostat devices.
Change consumption widget for some devices.
Remove domoticz batterie alert if device have bad return for battery level.
Patch for group with UniqueId.
You don't need to update your version if you don't need last modifications, no significant change on core.
User avatar
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

Hello i have some problems with the api key.

When i put in the command:

/home/pi/domoticz/plugins/Domoticz-deCONZ$ python3 API_KEY.py

I get This:

Exemples of use
python3 API_KEY.py <ip>:<port> <command> <Api key> <data>

python3 API_KEY.py 127.0.0.1:80 create
python3 API_KEY.py 127.0.0.1:80 info B4B018AA61
python3 API_KEY.py 127.0.0.1:80 list B4B018AA61
python3 API_KEY.py 127.0.0.1:80 delete B4B018AA61 CA606DA036
python3 API_KEY.py 127.0.0.1:80 clean B4B018AA61

When i put in this command:

/home/pi/domoticz/plugins/Domoticz-deCONZ$ python3 API.py 127.0.0.1:80 create

I get this:

python3: can't open file 'API.py': [Errno 2] No such file or directory

Can someone put me in the right direction???

Ps.
I have already done
sudo -H pip3 install requests
sudo -H pip install requests
User avatar
Sjonnie2017
Posts: 365
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 »

DieHappy wrote: Wednesday 12 February 2020 19:37 Hello i have some problems with the api key.

When i put in the command:

/home/pi/domoticz/plugins/Domoticz-deCONZ$ python3 API_KEY.py

I get This:

Exemples of use
python3 API_KEY.py <ip>:<port> <command> <Api key> <data>

python3 API_KEY.py 127.0.0.1:80 create
python3 API_KEY.py 127.0.0.1:80 info B4B018AA61
python3 API_KEY.py 127.0.0.1:80 list B4B018AA61
python3 API_KEY.py 127.0.0.1:80 delete B4B018AA61 CA606DA036
python3 API_KEY.py 127.0.0.1:80 clean B4B018AA61

When i put in this command:

/home/pi/domoticz/plugins/Domoticz-deCONZ$ python3 API.py 127.0.0.1:80 create

I get this:

python3: can't open file 'API.py': [Errno 2] No such file or directory

Can someone put me in the right direction???

Ps.
I have already done
sudo -H pip3 install requests
sudo -H pip install requests
Did you have a look at this: https://dresden-elektronik.github.io/de ... uireapikey

Not sure if it will resolve your issue but worth a look ;)
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
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

I really have no idea what to do with it?
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

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

Post by salopette »

python3 API_KEY.py 127.0.0.1:80 create


python3 API.py 127.0.0.1:80 create


I think your command was misspelled
User avatar
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

Oke Thanks.

I get one step further:


raceback (most recent call last):
File "/usr/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/usr/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/usr/lib/python3.7/http/client.py", line 928, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "API_KEY.py", line 25, in <module>
response = request.urlopen(req,timeout=3).read()
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "API_KEY.py", line 33, in <module>
elif e.code == 403:
AttributeError: 'URLError' object has no attribute 'code'
Thorgal789
Posts: 851
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, are you sure deconz is running when you make the request ?
To use the ip 127.0.0.1 (localhost) you need to type it on the same machine than deconz is running.

Are you sure deconz is using the 80 port on your machine, to be sure, use a web browser and go to http://127.0.0.1:80, you need to see phoscon.
User avatar
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

I think it is not running.
When i browse to http://127.0.0.1:80 i get no connection.

How do i start it?

I read in this forum:
pi@raspberrypi:~ $ sudo systemctl enable deconz

but then i get:

Failed to enable unit: Unit file deconz.service does not exist.
User avatar
Sjonnie2017
Posts: 365
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 »

Try this on your Pi to see if it is on another port:

Code: Select all

sudo netstat -nltup
HTH
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: 851
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 »

@ DieHappy
Have you installed deconz ?

And sudo systemctl enable deconz is for the headless version , if you have a desktop it's the other one, and on correct install, you don't need them at all.
User avatar
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

I think i have:

i did:

/home/pi/domoticz/plugins$ git clone https://github.com/Smanar/Domoticz-deCONZ.git

in the folder i do git pull, i get

/home/pi/domoticz/plugins/Domoticz-deCONZ$ git pull
From https://github.com/Smanar/Domoticz-deCONZ
aa59cc3..4b58e45 beta -> origin/beta
Already up to date.

So i think it is installed.

in the folder /home/pi/domoticz/plugins/Domoticz-deCONZ
plugin.py is met rechten chmod 777

I have it on a pi 3B+
User avatar
DieHappy
Posts: 10
Joined: Wednesday 10 January 2018 18:57
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Netherlands
Contact:

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

Post by DieHappy »

sudo netstat -nltup

gives me:

pi@raspberrypi:~ $ sudo netstat -nltup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 441/sshd
tcp6 0 0 :::443 :::* LISTEN 463/domoticz
tcp6 0 0 :::6144 :::* LISTEN 463/domoticz
tcp6 0 0 :::8080 :::* LISTEN 463/domoticz
tcp6 0 0 :::22 :::* LISTEN 441/sshd
udp 0 0 0.0.0.0:45557 0.0.0.0:* 311/avahi-daemon: r
udp 0 0 0.0.0.0:68 0.0.0.0:* 384/dhcpcd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 311/avahi-daemon: r
udp 0 0 0.0.0.0:37737 0.0.0.0:* 463/domoticz
udp6 0 0 :::546 :::* 384/dhcpcd
udp6 0 0 :::50747 :::* 311/avahi-daemon: r
udp6 0 0 :::5353 :::* 311/avahi-daemon: r
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest