[REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Moderator: leecollings
-
- Posts: 29
- Joined: Sunday 22 November 2015 22:11
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.01
- Location: Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Hi Moroen,
I just deleted the Plugins/IKEA-Tradfri directory and started over with the instructions.
One thing that comes to my attention is that this command does not work.
cd domoticz/plugins/
Instead i have to manually switch to: /usr/local/domoticz/var/plugins/
Could that have something to do with some issues?
Kr,
Axel
I just deleted the Plugins/IKEA-Tradfri directory and started over with the instructions.
One thing that comes to my attention is that this command does not work.
cd domoticz/plugins/
Instead i have to manually switch to: /usr/local/domoticz/var/plugins/
Could that have something to do with some issues?
Kr,
Axel
-
- Posts: 29
- Joined: Sunday 22 November 2015 22:11
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.01
- Location: Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Just to answer my own question, it does notAxelvanH wrote: ↑Friday 02 October 2020 10:59 Hi Moroen,
I just deleted the Plugins/IKEA-Tradfri directory and started over with the instructions.
One thing that comes to my attention is that this command does not work.
cd domoticz/plugins/
Instead i have to manually switch to: /usr/local/domoticz/var/plugins/
Could that have something to do with some issues?
Kr,
Axel
The only 'handicap' is that you need to move to this location yourself.
#problem solved.
-
- Posts: 29
- Joined: Sunday 22 November 2015 22:11
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.01
- Location: Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Hi Moroen,moroen wrote: ↑Monday 21 September 2020 0:35I'm still pretty sure that the error is a permission error when the plugin tries to run coapcmd, the error seems to occur atAxelvanH wrote: ↑Saturday 19 September 2020 21:02 Please help!
python3 plugin.py config 1.1.1.1 code
Traceback (most recent call last):
File "plugin.py", line 177, in <module>
create_ident(args.IP, args.KEY, CONFIGFILE)
File "/volume1/@appstore/domoticz/var/plugins/IKEA-Tradfri/tradfricoap/coapcmd_api.py", line 81, in create_ident
result = json.loads(subprocess.run([_coapCMD, "post", "--ident", "Client_identity", "--key", key, uri, payload], stdout=subprocess.PIPE).stdout.decode('utf-8'))
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 696, in run
with Popen(*popenargs, **kwargs) as process:
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
Again gives still the same error. chmod 777 on config.json did not make any difference.
My config.json file:
vi config.json
{"Gateway": null, "Identity": null, "Api": "Coapcmd", "Transition_time": 10, "Passkey": null, "Verbosity": 0}
Any suggestion is welcome on how to proceed.
Thanks,
AxelHave you tried to set permission on coapcmd?Code: Select all
result = json.loads(subprocess.run([_coapCMD, "post", "--ident", "Client_identity", "--key", key, uri, payload],
Reagards,Code: Select all
chmod gou+rwx bin/coapcmd
M
I deleted the whole TIKEA-Tradfri directory and started over again from scratch reading every line meticulously...
Keeping a log off all the messages in the progress. Now everything (except from chaning to the plugins directory differently) worked fine!
Connection is established and all devices are reported.
My appologies for taking your time, I hope the below will help other users.
Thank you for the great work, answers and patience!
Kr, Axel
On the question, where things went wrong, I guess in the switching between installs.
https://github.com/moroen/IKEA-Tradfri- ... /README.md
Point 1 is easy.
Point 2 can be skipped as explained.
At point 3, I go mistaken by the first paragraph. At the link towards coapcmd, I emidattely clicked that.
But the steps for synology should be:
1. Get Golang envirionment:
Download right version xxx
tar -C /usr/local -xzf go1.15.2.linux-xxxx.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
2. Goto pugins-dir
cd /volume1/@appstore/domoticz/var/plugins
3. Get Coapcmd
plugins/IKEA-Tradfri# git clone https://github.com/moroen/coapcmd.git
plugins/IKEA-Tradfri# cd coapcmd
4. Execute install
plugins/IKEA-Tradfri# bash install_coapcmd.sh
5. Select coapcmd
/plugins/IKEA-Tradfri# python3 plugin.py api coapcmd
6. Configure coapcmd
plugins/IKEA-Tradfri# python3 plugin.py config 192.168.2.71 Key12345678
step 6 only works with the proper IP address of the gateway, else it will fail with:
{'Result': '', 'Status': 'HandshakeError'}
Connection timed out
7. python3 plugin.py list
Listing all connections.
8. Restarting Domoticz and adding the plugin.
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
There is a new version of the plugin available, 0.10.0. Unfortunately this update brings a couple of breaking changes, and I urge everyone planing to update to check out the updated readme.
Tradfricoap (the API for controlling the gateway) has been separated out into it's own module, available on pypi (https://pypi.org/project/tradfricoap/). On well configured systems where the interactive interpreter is the same as the one used by domoticz, the upgrade should be simple:
On systems where domoticz is unable to find or use system modules, tradfricoap can still be installed into the plugin directory with git:
For systems using coapcmd, there is a new version of this as well:
or download the latest prebuild binaries.
To check installed versions:
The syntax for configuring the gateway connection and selecting an api for coaps has changes slightly:
For updating the plugin:
If tradfricoap has been installed into the plugin dirctory, update with git:
Regards,
M
Tradfricoap (the API for controlling the gateway) has been separated out into it's own module, available on pypi (https://pypi.org/project/tradfricoap/). On well configured systems where the interactive interpreter is the same as the one used by domoticz, the upgrade should be simple:
Code: Select all
$ cd plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ rm -rf tradfricoap
$ sudo -H pip3 install tradfricoap
Code: Select all
$ cd plugins/IKEA-Tradfri
$ git clone https://github.com/moroen/tradfricoap.git
Code: Select all
$ cd plugins/IEKA-Tradfri
$ sh ./install_coapcmd.sh
To check installed versions:
Code: Select all
$ python3 plugin.py version
Code: Select all
$ python3 plugin.py config gw IP KEY
$ python3 plugin.py config api py3coap # for py3coap
$ python3 plugin.py config api coapcmd # for py3coap
Code: Select all
$ cd plugins/IKEA-Tradfri
$ git pull
$ sudo -H python3 -m pip install -U tradfricoap py3coap
Code: Select all
$ cd plugins/IKEA-Tradfri/tradfricoap
$ git pull
M
Last edited by moroen on Tuesday 27 October 2020 23:57, edited 1 time in total.
-
- Posts: 156
- Joined: Monday 25 May 2015 22:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2020.2
- Location: Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
First I want to thank you for all your great work Moroen!
I followed your steps, but after a restart of Domoticz it still shows version 0.9.17.
Any thought?
With kind regards,
Andrès
I followed your steps, but after a restart of Domoticz it still shows version 0.9.17.
Any thought?
With kind regards,
Andrès
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
There was an error in my instructions, you need to checkout and pull the master branch. The original post has been corrected:
Code: Select all
$ cd plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ rm -rf tradfricoap
$ sudo -H pip3 install tradfricoap
Regards,
M
-
- Posts: 156
- Joined: Monday 25 May 2015 22:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2020.2
- Location: Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Yes! That seems to work! Thanks!
-
- Posts: 85
- Joined: Sunday 26 July 2020 8:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: The Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
when entering checkout master this is the right reply right?
and later on I get this
Code: Select all
Already on 'master'
Your branch is up to date with 'origin/master'.
Code: Select all
WARNING: You are using pip version 20.1.1; however, version 20.2.4 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ /usr/bin/python3 -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pip
Downloading pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
|################################| 1.5 MB 2.4 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-20.2.4
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Hi Moroen,
I thought about updating my windows machine, so i downloaded the latest 32bit wheel (py3coap-0.8.0-cp37-cp37m-win32.whl) and installed it.
pip list shows: py3coap 0.8.0
Is it correct there is no 32bit version of the py3coap 0.9.0 ?
Do i need to go to a 64bit python? I dont think Domoticz works with a 64bit Python... not sure to...
I then updated the plugin to 0.10.0 and tried:
python plugin.py list
The response is: py3coap not found
Is this because i need py3coap 0.9.0? Did i mis something?
I thought about updating my windows machine, so i downloaded the latest 32bit wheel (py3coap-0.8.0-cp37-cp37m-win32.whl) and installed it.
pip list shows: py3coap 0.8.0
Is it correct there is no 32bit version of the py3coap 0.9.0 ?
Do i need to go to a 64bit python? I dont think Domoticz works with a 64bit Python... not sure to...
I then updated the plugin to 0.10.0 and tried:
python plugin.py list
The response is: py3coap not found
Is this because i need py3coap 0.9.0? Did i mis something?
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
The win32 version of py3coap is missing in the latest build on pypi, I'll look into it!JimmyH1969 wrote: ↑Thursday 29 October 2020 13:23 Hi Moroen,
I thought about updating my windows machine, so i downloaded the latest 32bit wheel (py3coap-0.8.0-cp37-cp37m-win32.whl) and installed it.
pip list shows: py3coap 0.8.0
Is it correct there is no 32bit version of the py3coap 0.9.0 ?
Do i need to go to a 64bit python? I dont think Domoticz works with a 64bit Python... not sure to...
I then updated the plugin to 0.10.0 and tried:
python plugin.py list
The response is: py3coap not found
Is this because i need py3coap 0.9.0? Did i mis something?
Regards,
M
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
I just installed Python 3.7.9 64bit on a Domoticz test virtual machine.
Installed the plugin version 0.10.0
Installed py3coap 0.9.0
Installed tradfricoap 0.0.11
And....
python plugin.py list
Lights:
65537: lamp keuken (State: 0 - Level: 71 - Hex: None)
65538: keuken verlichting (State: 0 - Level: 0 - Hex: None)
65540: buitenverlichting voor (State: 0 - Level: 2 - Hex: None)
65541: Woonkamer (State: 0 - Level: 2 - Hex: efd275)
65544: aanbouw 1 (State: 1 - Level: 91 - Hex: None)
65545: aanbouw 2 (State: 1 - Level: 5 - Hex: None)
Domoticz says: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
This is because of the 64bit version of Python ofcourse.
Thanks in advance
Installed the plugin version 0.10.0
Installed py3coap 0.9.0
Installed tradfricoap 0.0.11
And....
python plugin.py list
Lights:
65537: lamp keuken (State: 0 - Level: 71 - Hex: None)
65538: keuken verlichting (State: 0 - Level: 0 - Hex: None)
65540: buitenverlichting voor (State: 0 - Level: 2 - Hex: None)
65541: Woonkamer (State: 0 - Level: 2 - Hex: efd275)
65544: aanbouw 1 (State: 1 - Level: 91 - Hex: None)
65545: aanbouw 2 (State: 1 - Level: 5 - Hex: None)
Domoticz says: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
This is because of the 64bit version of Python ofcourse.
Thanks in advance
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
If you compile domoticz yourself, it's possible to support 64 bits python, but it's probably not worth the hassle...JimmyH1969 wrote: ↑Thursday 29 October 2020 15:42 I just installed Python 3.7.9 64bit on a Domoticz test virtual machine.
Installed the plugin version 0.10.0
Installed py3coap 0.9.0
Installed tradfricoap 0.0.11
And....
python plugin.py list
Lights:
65537: lamp keuken (State: 0 - Level: 71 - Hex: None)
65538: keuken verlichting (State: 0 - Level: 0 - Hex: None)
65540: buitenverlichting voor (State: 0 - Level: 2 - Hex: None)
65541: Woonkamer (State: 0 - Level: 2 - Hex: efd275)
65544: aanbouw 1 (State: 1 - Level: 91 - Hex: None)
65545: aanbouw 2 (State: 1 - Level: 5 - Hex: None)
Domoticz says: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
This is because of the 64bit version of Python ofcourse.
Thanks in advance
py3coap version 0.9.1 just released on pypi. This version is the same as 0.9.0, but with wheels for win32 included, support for python3.5 has been removed.
Regards,
M
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Mhhh.... i installed py3coap version 0.9.1
Pip list:
py3coap 0.9.1
Copied the plugin to the Domoticz plugin folder.
Executed: python.exe plugin.py list
Result: py3coap not found
On my 64bit python machine the same configuration works without problems. Did i miss something?
Pip list:
py3coap 0.9.1
Copied the plugin to the Domoticz plugin folder.
Executed: python.exe plugin.py list
Result: py3coap not found
On my 64bit python machine the same configuration works without problems. Did i miss something?
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Removed py3coap-0.9.1 and installed py3coap-0.8.0
Removed plugin 0.10.0 and installed plugin 0.9.1
Everything works again, but there is a pause between switching 2 lights, that's why i wanted to update
Removed plugin 0.10.0 and installed plugin 0.9.1
Everything works again, but there is a pause between switching 2 lights, that's why i wanted to update
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
I'll see if I can dig out a copy of Windows and do some testing. If it's any consolation, the 0.9.1 version doesn't solve the delay between switching lights, that's due to a workaround for a recent firmware update...JimmyH1969 wrote: ↑Thursday 29 October 2020 23:11 Removed py3coap-0.9.1 and installed py3coap-0.8.0
Removed plugin 0.10.0 and installed plugin 0.9.1
Everything works again, but there is a pause between switching 2 lights, that's why i wanted to update
Regards,
M
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Oke, to solve my problems for now i went back to the stone age ....
Removed py3coap completely
Installed pycoap-0.7.0-cp37-cp37m-win32
Installed Plugin 0.7.3
I think thats the last possibe combination of pycoap and the plugin
Everything works fine. No delays in switching lights.
I think i missed the why and when going from pycoap to py3coap...
Anyway, for now it works!
Removed py3coap completely
Installed pycoap-0.7.0-cp37-cp37m-win32
Installed Plugin 0.7.3
I think thats the last possibe combination of pycoap and the plugin
Everything works fine. No delays in switching lights.
I think i missed the why and when going from pycoap to py3coap...
Anyway, for now it works!
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Hm, that's interresting, what is the firmware version of your IKEA gateway?JimmyH1969 wrote: ↑Friday 30 October 2020 13:34 Oke, to solve my problems for now i went back to the stone age ....
Removed py3coap completely
Installed pycoap-0.7.0-cp37-cp37m-win32
Installed Plugin 0.7.3
I think thats the last possibe combination of pycoap and the plugin
Everything works fine. No delays in switching lights.
I think i missed the why and when going from pycoap to py3coap...
Anyway, for now it works!
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Hi,
The IKEA App says it's on the latest version... not sure ofcourse
The HUB says: version 1.11.51
Is that the latest?
The IKEA App says it's on the latest version... not sure ofcourse
The HUB says: version 1.11.51
Is that the latest?
-
- Posts: 85
- Joined: Sunday 26 July 2020 8:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: The Netherlands
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
FYI 1.11.51 also latest version number on my set up.
Don't know if someone already looked at the question I posted earlier?
Don't know if someone already looked at the question I posted earlier?
-
- Posts: 408
- Joined: Sunday 15 January 2017 11:06
- Target OS: Linux
- Domoticz version: beta
- Location: Norway
- Contact:
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
You should always do a git pull after checking out a branch, but yes, this looks correct!Jasper79 wrote: ↑Thursday 29 October 2020 11:26 when entering checkout master this is the right reply right?and later on I get thisCode: Select all
Already on 'master' Your branch is up to date with 'origin/master'.
Code: Select all
WARNING: You are using pip version 20.1.1; however, version 20.2.4 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command. pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ /usr/bin/python3 -m pip install --upgrade pip Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pip Downloading pip-20.2.4-py2.py3-none-any.whl (1.5 MB) |################################| 1.5 MB 2.4 MB/s Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 20.2.3 Uninstalling pip-20.2.3: Successfully uninstalled pip-20.2.3 Successfully installed pip-20.2.4
Regards,
M
Who is online
Users browsing this forum: Bing [Bot] and 1 guest