Page 27 of 48

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Tuesday 19 March 2019 16:03
by pgielen
Would it not be simpler to control Tradfri lights without the gateway, just using a Raspberry Pi and an XBee board?

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Tuesday 19 March 2019 20:29
by Alessio78
Hello, someone can helpme plz?
I run

Code: Select all

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ ./configure.py 192.168.0.201 PSW
usage: configure.py [-h] {config,service} ...
configure.py: error: argument command: invalid choice: '192.168.0.201' (choose from 'config', 'service')
else if I run

Code: Select all

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ ./configure.py config 192.168.0.201 PSW
Error: Unable to import pytradfri. Please check your installation!
How I can proceed?
Thanks

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Tuesday 19 March 2019 23:42
by moroen
Alessio78 wrote: Tuesday 19 March 2019 20:29 Hello, someone can helpme plz?
I run

Code: Select all

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ ./configure.py 192.168.0.201 PSW
usage: configure.py [-h] {config,service} ...
configure.py: error: argument command: invalid choice: '192.168.0.201' (choose from 'config', 'service')
else if I run

Code: Select all

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ ./configure.py config 192.168.0.201 PSW
Error: Unable to import pytradfri. Please check your installation!
How I can proceed?
Thanks
You're missing the pytradfri library. If you've installed it with pip3, make sure that you have only one python3 interpreter installed...

Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 17:35
by schulpr
Hi,

I have the same error "configure.py: error: argument command: invalid choice: '192.168.2.1' (choose from 'config', 'service')". How can I check if there are more interpreters installed? (And remove them.)

I build Domoticzfrom scratch and right after this I tried to install the Tradfri plugin.

Thanks for the help!

Kind regards, Rob

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 18:18
by moroen
schulpr wrote: Friday 22 March 2019 17:35 Hi,

I have the same error "configure.py: error: argument command: invalid choice: '192.168.2.1' (choose from 'config', 'service')". How can I check if there are more interpreters installed? (And remove them.)

I build Domoticzfrom scratch and right after this I tried to install the Tradfri plugin.

Thanks for the help!

Kind regards, Rob
Please check the command, the syntax has changed in the latest version:

Code: Select all

$ ./configure.py config 192.168.2.1 PSK
Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 18:40
by schulpr
Hi M,

Thanks for your fast response! I used this description:

...
12. ./configure.py --debug <IP adres tradfri hub> <security KEY on rear of hub>
13. python3 tradfri.tac
14. ./configure.py –-skip-config –-create-service
15. sudo cp ikea-tradfri.service /etc/systemd/system
16. sudo systemctl daemon-reload
...

Is step 14 also changed? Edit: Yes, ./configure.py service create

Kind regards, Rob

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 19:29
by moroen
schulpr wrote: Friday 22 March 2019 18:40 Hi M,

Thanks for your fast response! I used this description:

...
12. ./configure.py --debug <IP adres tradfri hub> <security KEY on rear of hub>
13. python3 tradfri.tac
14. ./configure.py –-skip-config –-create-service
15. sudo cp ikea-tradfri.service /etc/systemd/system
16. sudo systemctl daemon-reload
...

Is step 14 also changed?

Kind regards, Rob
Yes, it is... Please check the updated readme, but in short:

Code: Select all

12. ./configure.py config <IP address tradfri hub> <security KEY on rear of hub>
13. python3 tradfri.tac
14. ./configure.py service create
15. sudo cp ikea-tradfri.service /etc/systemd/system
16. sudo systemctl daemon-reload
Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 19:40
by schulpr
Hi M,

Thanks again. I was unaware of a description and just followed the explanation in this thread. Sorry for this.

Rgards, Rob

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 21:00
by moroen
schulpr wrote: Friday 22 March 2019 19:40 Hi M,

Thanks again. I was unaware of a description and just followed the explanation in this thread. Sorry for this.

Rgards, Rob
No problem, hopefully you've gotten it to work?

Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 22 March 2019 21:01
by schulpr
Yes, it's fine now!


Verzonden vanaf mijn iPhone met Tapatalk

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Thursday 28 March 2019 17:20
by axello2
moroen wrote: Thursday 07 February 2019 12:49
fotogen wrote: Tuesday 05 February 2019 1:04 Hi
Kind of desperate since im stuck in one of the first steps :oops:

I could read that another user had the same problem but no solution. When running the ./configure.py i get error message that there is no module named "pytradfri". But i can clearly see that it is there when cheching pip3 list. I have been uninstalling/re-installing python and the different scripts. Do any one have any clue? Please make my day :D

Code: Select all

$ /usr/bin/env python3 -m pip list
I have the same problem. I tried these suggestions already:

Code: Select all

/usr/bin/env python3 -m pip list
returns among the needed modules:
cryptography (0.6.1)
pytradfri (6.0.1)
Twisted (18.9.0)
So, even thought the python3 list includes it, and when I start the configure script using python3 explicitely:

Code: Select all

python3 configure.py config 192.168.1.x xxxx
Error: Unable to import pytradfri. Please check your installation!
I tried setting the PYTHONHOME and PYTHONPATH variables, but that lead to weirder errors and python would not even start.
Running on a standard raspbian system.

Another error I get, which is probably caused by the same euh, cause: when I start tradfri.tac, it cannot find the cryptography module:

Code: Select all

python3 tradfri.tac
'No module named 'cryptography.x509''
Last update:
When I reinstall pytradfri, I get the following SyntaxError, even thought pip3 afterwards claims it is installed succesfully:

Code: Select all

Installing collected packages: pytradfri
  Found existing installation: pytradfri 6.0.1
    Uninstalling pytradfri:
      Successfully uninstalled pytradfri
  Running setup.py install for pytradfri
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
      File "/usr/local/lib/python3.4/dist-packages/pytradfri/api/aiocoap_api.py", line 67
        async def _get_protocol(self):
                ^
    SyntaxError: invalid syntax
    
    
Successfully installed pytradfri
Cleaning up...
I installed coap using the install-coap-client.sh script from pytradfri-ggravlingen.


Is there anything else I can check?

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Thursday 28 March 2019 18:44
by moroen
@axello2,

I reread your output a couple of times before I spotted this:
axello2 wrote: Thursday 28 March 2019 17:20

Code: Select all

    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
You need at least python 3.5.3 in order to use pytradfri and thus the Tradfri-plugin...

I would recommend upgrading to latest 3.6.x (3.6.8) or 3.7.x (3.7.3) but any version from 3.5.3 and higher should work!

Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Friday 29 March 2019 9:31
by axello2
Oh flup, I remember reading that somewhere in the beginning, so I apt upgraded everything, but that was not good enough. I guess I have to update my linux distribution as well. Pity, that's for another time.

Thanks for your swift answer!


Axel

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Saturday 30 March 2019 19:23
by jojo26
Hi, I am pretty new to all of this but when I put in all the commands I got finally no errors. But when I submit the Tradfri to my Domoticz Hardware i do not get the option of an Identity or to fill in the key. What do i do wrong? Also I get the logfile saying "failed to connect to IKEA tradfri COAP-adapter! Status: 111 "

In python i have this
"ikea-tradfri.service created:
[Unit]
Description=IKEA Tradfri COAP-adapter

[Service]
Type=simple
ExecStart=/usr/local/bin/twistd --nodaemon \
--rundir=/home/pi/domoticz/plugins/IKEA-Tradfri \
--pidfile=/home/pi/domoticz/plugins/IKEA-Tradfri/twistd.pid \
--python=/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac

User=pi
Group=pi

Restart=always

[Install]
WantedBy=multi-user.target"


Where do I go wrong?

Jojo

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Saturday 30 March 2019 22:14
by axello2
Hi Moroen,
Thanks for your help. After updating to Stretch and re-installing all the dependencies again, I got it working. Apart from the update polling, but that's a known issue I guess.

issue: When I switch the Trådfri bulbs On with Domotics, the status given to the event system is correct, but when I switch On with the Trådfri remote or the Trådfri app it is still reported as Off, and vice-versa]

Cheers,

Axel

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Sunday 31 March 2019 8:25
by schulpr
Good morning,

Unfortunately I had do re-install my Domoticz from scratch. I have all the python plug-ins working again except the Tradfri. I get this message:

Code: Select all

2019-03-31 08:13:32.339 Error: (IKEA-Tradfri) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/IKEA-Tradfri/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-03-31 08:13:32.339 Error: (Tradfri) Module Import failed, exception: 'ImportError'
2019-03-31 08:13:32.339 Error: (Tradfri) Module Import failed: ' Name: colors'
2019-03-31 08:13:32.339 Error: (Tradfri) Error Line details not available.
I removed python v2.7, re-installed 3.5.3. I'm on the latest beta of Domoticz. Does anyone has an idea what goes wrong?

Thanks for the suggestions!

Kind regards, Rob

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Sunday 31 March 2019 18:54
by moroen
schulpr wrote: Sunday 31 March 2019 8:25 Good morning,

Unfortunately I had do re-install my Domoticz from scratch. I have all the python plug-ins working again except the Tradfri. I get this message:

Code: Select all

2019-03-31 08:13:32.339 Error: (IKEA-Tradfri) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/IKEA-Tradfri/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-03-31 08:13:32.339 Error: (Tradfri) Module Import failed, exception: 'ImportError'
2019-03-31 08:13:32.339 Error: (Tradfri) Module Import failed: ' Name: colors'
2019-03-31 08:13:32.339 Error: (Tradfri) Error Line details not available.
I removed python v2.7, re-installed 3.5.3. I'm on the latest beta of Domoticz. Does anyone has an idea what goes wrong?

Thanks for the suggestions!

Kind regards, Rob
That's my fault... I've been doing some restructuring in preparation for a coming major change (ditching coap-client), and managed to mess up the master branch. If you pull the latest commit, it should be fixed now... Sorry for the inconvenience! :?

Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Sunday 31 March 2019 20:11
by schulpr
Hi M,

No problem, it's a hobby :-).

git pull didn't do the trick. I removed everything and started all over. When I install " pip3 install service-identity" I get this error:

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksul_5ak/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-s7qsqisb-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-ksul_5ak/cryptography/

When I continue the ressult is the same.

Kind regards, Rob

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Sunday 31 March 2019 20:34
by moroen
schulpr wrote: Sunday 31 March 2019 20:11 Hi M,

No problem, it's a hobby :-).

git pull didn't do the trick. I removed everything and started all over. When I install " pip3 install service-identity" I get this error:

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksul_5ak/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-s7qsqisb-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-ksul_5ak/cryptography/

When I continue the ressult is the same.

Kind regards, Rob
This isn't a tradfri issue, but I would guess you're lacking the libssl-dev package?

Regards,
M

Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?

Posted: Sunday 31 March 2019 21:33
by schulpr
Hello M,

Your suggestion brought me a bit further. Next error:

pi@raspberrypi3:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.7 started (command line)!
Couldn't listen on any:1234: [Errno 98] Address already in use.


Even killed the complete Domoticz directory and started all over.

Kind regards, Rob