Page 20 of 35

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

Posted: Sunday 08 December 2019 21:53
by havnegata
Will have to check tomorrow

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

Posted: Monday 09 December 2019 14:56
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

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

Posted: Monday 09 December 2019 17:55
by Thorgal789
Ok, so good to know, there is other plugin with same problem.
Thx ^^.

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

Posted: Tuesday 10 December 2019 8:45
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'}

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

Posted: Tuesday 10 December 2019 17:12
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.

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

Posted: Monday 23 December 2019 21:28
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

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

Posted: Tuesday 24 December 2019 14:08
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 ?

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

Posted: Tuesday 24 December 2019 15:25
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:

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

Posted: Monday 27 January 2020 11:55
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.

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

Posted: Wednesday 12 February 2020 19:37
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

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

Posted: Wednesday 12 February 2020 20:05
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 ;)

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

Posted: Wednesday 12 February 2020 20:43
by DieHappy
I really have no idea what to do with it?

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

Posted: Wednesday 12 February 2020 20:48
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

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

Posted: Wednesday 12 February 2020 22:38
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'

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

Posted: Thursday 13 February 2020 16:36
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.

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

Posted: Thursday 13 February 2020 19:08
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.

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

Posted: Thursday 13 February 2020 19:16
by Sjonnie2017
Try this on your Pi to see if it is on another port:

Code: Select all

sudo netstat -nltup
HTH

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

Posted: Thursday 13 February 2020 19:25
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.

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

Posted: Thursday 13 February 2020 20:09
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+

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

Posted: Thursday 13 February 2020 20:10
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