moroen / IKEA-Tradfri-plugin

A Python plugin for Domoticz to controll IKEA Gateway
68 stars 23 forks source link

Py3Coap error #122

Closed PetrusVetrov closed 3 years ago

PetrusVetrov commented 3 years ago

Hello, i am newbie here, but the job you did is awesome

i did everything step by step, but when i try to config py3coap - i got below error. if i switch to coapcmd everything works perfectly. any idea what i am doing wrong? thanks a milion Petr

C:\Program Files (x86)\Domoticz\plugins\Ikea-Tradfri>python plugin.py config api py3coap

C:\Program Files (x86)\Domoticz\plugins\Ikea-Tradfri>python plugin.py config gw 10.0.0.4 xxxxxxxx Traceback (most recent call last): File "C:\Program Files (x86)\Python38-32\lib\site-packages\tradfricoap\cli.py", line 149, in set_config create_ident(args.IP, args.KEY, conf_object) File "C:\Program Files (x86)\Python38-32\lib\site-packages\tradfricoap\pycoap_api.py", line 69, in create_ident result = Request( NameError: name 'Request' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "plugin.py", line 128, in process_args(args) File "C:\Program Files (x86)\Python38-32\lib\site-packages\tradfricoap\cli.py", line 78, in process_args set_config(args) File "C:\Program Files (x86)\Python38-32\lib\site-packages\tradfricoap\cli.py", line 150, in set_config except HandshakeError:

if i do version command i got this

C:\Program Files (x86)\Domoticz\plugins\Ikea-Tradfri>python plugin.py version IKEA Tradfri Plugin: 0.10.1 Tradfricoap: 0.0.11 Py3coap: 0.9.1 coapcmd: (C:\Program Files (x86)\Domoticz\plugins\Ikea-Tradfri/bin/coapcmd.exe) 0.1.6

but list command tells me that py3coap not found

C:\Program Files (x86)\Domoticz\plugins\Ikea-Tradfri>python plugin.py list py3coap not found

any major functional difference between py3coap and coapcmd?

thanks a lot

moroen commented 3 years ago

Pycoap3 is probably not installed correctly. What is your system and OS?

The only difference between py3coap and coapcmd is speed, py3coap is quite a bit faster in some areas (notably getting info from all devices) and in others (like switching devices) the difference is negligible.

PetrusVetrov commented 3 years ago

Hi, thanks for reply you did amazing job on this

what confuse me is when i try to install py3coap it tells me the bellow message..

C:\Program Files (x86)\Python38-32\Scripts>pip3 install py3coap Requirement already satisfied: py3coap in c:\program files (x86)\python38-32\lib\site-packages (0.9.1)

if i uninstall and install back - C:\Program Files (x86)\Python38-32\Scripts>pip3 install py3coap Collecting py3coap Using cached py3coap-0.9.1-cp38-cp38-win32.whl (1.8 MB) Installing collected packages: py3coap Successfully installed py3coap-0.9.1

is says all is ok..

do i need to have Ikea-TRADFRI folder with capital letters?

any idea what i am doing wrong?

many thanks....

moroen commented 3 years ago

Py3coap doesn't work on windows, due to incompatibilities between gcc (used by the golang compiler) and MSVC (used by the official python distributions on windows), so on windows 10 you need to use coapcmd. I plan to change the readme to reflect this, but haven't gotten around to it yet...

PetrusVetrov commented 3 years ago

thanks - issue solved - all the rest works perfectly ! Again you did good job? Btw any way to read status of the Ikea motin sensor, so movement can trigger some scene/group? Same for ikea buttons? Now i see their battery status only?

thanks and regards

moroen commented 3 years ago

Glad it worked out!

Support for motion sensors and remotes are being planned, but I haven't been able to make stable observations, so no promises...