Page 11 of 34

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

Posted: Wednesday 31 July 2019 18:02
by Thorgal789
So try

Code: Select all

python3 API_KEY.py 192.168.178.93:80 create
I think it's the only one you haven't tried ^^.

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

Posted: Thursday 01 August 2019 17:42
by salopette
Thank you! You are great!

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

Posted: Thursday 01 August 2019 18:29
by Thorgal789
And you can take the opportunity to clean the config.

Code: Select all

python3 API_KEY.py 192.168.178.93:80 clean 3CFE614B74
This command will delete all key with "deCONZ WebApp" or "Phoscon#" in name, the previous one will be keeped because it have "domoticz" as name.

Code: Select all

python3 API_KEY.py 192.168.178.93:80 list 3CFE614B74

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

Posted: Thursday 01 August 2019 19:00
by salopette
Merci!!!

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

Posted: Sunday 04 August 2019 12:55
by salopette
Hi, I have added some lamps today, and now come constantly errors.
I do not know why that is, everything has restarted, but that does not help.

https://pastebin.com/Cjj74Tkq


2019-08-04 13:02:19.442 Status: (deconz) Firmware version : 0x26490700
2019-08-04 13:02:19.442 Status: (deconz) Websocketnotifyall : True
2019-08-04 13:02:19.588 Status: (deconz) Launching websocket on port 443
2019-08-04 13:02:19.535 Error: (deconz) 'onHeartbeat' failed 'ZeroDivisionError':'float division by zero'.
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 327 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function onHeartbeat
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 381 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 696 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 737 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 509 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 583 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ReadConfig
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 381 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function ManageInit
2019-08-04 13:02:19.535 Error: (deconz) ----> Line 696 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function SendCommand
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 737 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function UpdateBuffer
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 515 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function NormalConnexion
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 413 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/plugin.py', function InitDomoticzDB
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 261 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/fonctions.py', function ProcessAllState
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 366 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/fonctions.py', function ReturnUpdateValue
2019-08-04 13:02:19.536 Error: (deconz) ----> Line 140 in '/home/pi/domoticz/plugins/Domoticz-deCONZ/fonctions.py', function xy_to_rgb
2019-08-04 13:02:29.357 (deconz) ### Request lights
2019-08-04 13:02:29.413 (deconz) ### Device > 22 Name:5 Type:Dimmable light Details:{'bri': 15, 'reachable': True, 'alert': 'none', 'on': False}

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

Posted: Sunday 04 August 2019 13:29
by Thorgal789
2019-08-04 12:53:22.657 (deconz) ### Device > 54 Name:Lampe Juli-2 Type:Color light Details:{'sat': 0, 'bri': 236, 'xy': [0, 0], 'on': False, 'hue': 0, 'alert': 'none', 'reachable': False, 'effect': 'none', 'colormode': 'xy'}
What is this lamp ? Does she support RGB color ? there is something wrong, she have [0,0] as value for xy.
You have another one (If it's the same) but this one is working.
2019-08-04 12:53:32.683 (deconz) ### Device > 55 Name:Lampe Juli-3 Type:Color light Details:{'sat': 0, 'bri': 248, 'xy': [0.458, 0.41], 'on': False, 'hue': 0, 'alert': 'none', 'reachable': False, 'effect': 'none', 'colormode': 'xy'}
I have make a patch > https://github.com/Smanar/Domoticz-deCO ... 49d4e6dc92
Your bulb will have black color (0,0,0) up you change it, and (I hope) correct the value in the deconz API. The problem is from 'xy': [0, 0], it's something not possible.

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

Posted: Sunday 04 August 2019 15:00
by salopette
Thanks, everything works now.

I have several of these RGB lamps from IKEA.
And so far there was no problem.
Only today was something lazy!?

Thank you again! And see you soon!

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

Posted: Sunday 04 August 2019 17:04
by Thorgal789
Thx to you ^^, I realy need tester.

IDK what happened, perhaps the bulb have a problem and deconz have set 0 value by defaut, or if it was a new bulb, a problem during pairing (when asking for information), but after a color command, theses values was corrected.

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

Posted: Monday 05 August 2019 18:21
by salopette
Thorgal789 wrote: Saturday 27 July 2019 15:28 What is yout line 37 ?
You have the same name "colorloop" ?
Can you show me your code, I m using it in a LUA file in LUA directory.
Hi, is it possible to use Colorloop without api key?

Because if api key changes, Lua Script does not work anymore. You have to change the key there too.

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

Posted: Monday 05 August 2019 20:22
by Thorgal789
Nope, you always need api key.
But it's not a problem, the one you have created with the tool api_key.py, never change. In case of problem, deconz can make new key, but it never delete olds one.

Code: Select all

python3 API_KEY.py 192.168.178.93:80 list 3CFE614B74
You will have all api key registred (with date of creation), and the last one have "domoticz" as name, so esay to reconize it.

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

Posted: Thursday 08 August 2019 21:21
by salopette
Hi, could you show me where and how to use Colorloopspeed in the Lua script?

Thank you

Code: Select all

-- Color loop test

commandArray = {}

function SendJson(url,json)
	local curl = "/usr/bin/curl"
	local cmd = curl .. ' -X PUT -d '..json..' '..url
	local vac = os.execute(cmd)
	if vac ~= true then
		print('Send JSON Error')
	end
end

--color loop switch
if devicechanged['colorloop'] then
    if devicechanged['colorloop'] == 'On' then
        print('Start colorloop')
        SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"colorloop","on":true}\'')
    else
        print('Stop colorloop')
        SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"15","on":false}\'')
    end
end

return commandArray

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

Posted: Thursday 08 August 2019 21:59
by smr1hm
Hi guys,

is there an instructions for newbie how to install domoticz on RPI3 with all needed plugins to get Conbee working?

thx

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

Posted: Friday 09 August 2019 18:55
by Thorgal789
salopette wrote: Thursday 08 August 2019 21:21 Hi, could you show me where and how to use Colorloopspeed in the Lua script?
Try using

Code: Select all

SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"colorloop","on":true,"colorloopspeed":255}\'')
Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop.

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

Posted: Friday 09 August 2019 19:02
by Thorgal789
smr1hm wrote: Thursday 08 August 2019 21:59 is there an instructions for newbie how to install domoticz on RPI3 with all needed plugins to get Conbee working?
Not a complete tutorial but I can try to find somes instructions.

1 - install domoticz > https://www.domoticz.com/wiki/Raspberry_Pi take the "easy way" ^^.
2- install deconz, there is lot of way, it's the part where you can encounter the more problem, on my side, I just download the archive, and click on it on raspberry GUI to overwrite the previous one. But you have others installations mode here > https://www.phoscon.de/en/conbee2/install Take your time, it's not the same install for raspbee and conbee, with GUI or without GUI, I advises you taking with GUI and with conbee.
3 - install the plugin > https://github.com/Smanar/Domoticz-deCONZ (installation part)

Tell me if you need more explanation !

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

Posted: Friday 09 August 2019 19:13
by salopette
Thorgal789 wrote: Friday 09 August 2019 18:55
salopette wrote: Thursday 08 August 2019 21:21 Hi, could you show me where and how to use Colorloopspeed in the Lua script?
Try using

Code: Select all

SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"colorloop","on":true,"colorloopspeed":255}\'')
Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop.
Thanks, it works great!

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

Posted: Sunday 11 August 2019 21:49
by Hilus
I can't get the plugin to work. Has anyone an idea what goes wrong here? Have tried it with the 1.0.9 plugin too.

Running latest beta under Windows 10.
. 2019-08-11 21:26:48.860 Error: (deCONZ) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\Domoticz-
deCONZ-1.0.8\;C:\Program Files (x86)\Python38-32\python38.zip\C:\Program Files (x86)\Python38-32\Lib\\C:\Program Files (x86)\Python38-32\DLLs\\C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python38-32;C:\Program Files (x86)\Python38-32\lib\site-packages'.
2019-08-11 21:26:48.860 Error: (deCONZ) Module Import failed, exception: 'ModuleNotFoundError'
2019-08-11 21:26:48.860 Error: (deCONZ) Module Import failed: ' Name: json'
2019-08-11 21:26:48.860 Error: (deCONZ) Error Line details not available.

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

Posted: Monday 12 August 2019 17:13
by Thorgal789
It's strange, it's like you haven't json lib on python 3.8, try to install it with

Code: Select all

pip3 install json
If you already have it, pls take a look on the path. It's perhaps an environnement/path probblem, if you miss the requests lib I can understanf but the json lib ...

BTW, you are the first one I see with a 3.8 version.

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

Posted: Monday 12 August 2019 19:16
by Hilus
BTW, you are the first one I see with a 3.8 version.
Don't know exactly what the problem was, but possibly something with python 3.8 beta version? I've installed an older version and it seems to work now.

Great fun to tinker around with some zigbee lights in Domoticz! 8-)

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

Posted: Monday 12 August 2019 20:28
by Thorgal789
And was not possible to install the json lib on python 3.8 ? For me it's another problem because this lib is "fundamental", not possible for me having a python version without it. I have made a fast check on google, and haven't see special modification on it for 3.8.

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

Posted: Monday 12 August 2019 20:39
by Hilus
'pip3 install json' command was not working, so i installed simplejson with 'pip3 install simplejson'. That didn't solve the problem, though.

I'm a total python-noob, so i'm afraid I haven't got a clue what the background problem may be.