Page 35 of 48
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 13 December 2019 16:13
by peerkersezuuker
Hi,
@dressie When you enable Accept new Hardware Devices and go to the Hardware page, klik the Ikea Tradfri Hardware en klik update ?
@moroen, yust moved from the "old" plugin with the service to the new pycoap version.
Installed perfect (after installing the go compiler) only had to recreate my devices in domoticz (as suggested to dressie).
Nice work
Regards,
Peer
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 13 December 2019 19:32
by dressie
peerkersezuuker wrote: ↑Friday 13 December 2019 16:13
Hi,
@dressie When you enable Accept new Hardware Devices and go to the Hardware page, klik the Ikea Tradfri Hardware en klik update ?
@moroen, yust moved from the "old" plugin with the service to the new pycoap version.
Installed perfect (after installing the go compiler) only had to recreate my devices in domoticz (as suggested to dressie).
Nice work
Regards,
Peer
I tried that, but nothing works. So, to make sure my domoticz isn't broken, I added Hue as hardware. And devices are being created.
I do not see antyhing in the logs, so I'll go and check that out.
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Friday 13 December 2019 21:41
by dressie
Had to fix my logging, no idea why that messed up. But here is the log when I enable the hardware:
2019-12-13 21:40:21.356 Status: (IKEA) Started.
2019-12-13 21:40:21.632 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-12-13 21:40:21.632 Error: (IKEA) Module Import failed, exception: 'ImportError'
2019-12-13 21:40:21.632 Error: (IKEA) Module Import failed: ' Name: appdirs'
2019-12-13 21:40:21.632 Error: (IKEA) Error Line details not available
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 17 December 2019 13:59
by kvessen
Hey guys,
I'm trying to make the plugin work for my install but I think I'm missing something. I'm really... really... not into linux, so I'm trying the best I can, but I can't get it to work. I've managed to make domoticz work and I have a readout of my smart-meter, but I want to expand the functionalities to Tradfri as well.
I've followed your manual which is it pretty clear I think, and I think I have a working connection with my Tradfri hub as you can see here:
(env) pi@raspberrypi:~ $ tradfri list
Lights:
Sockets:
65537: TRADFRI outlet (TRADFRI control outlet) - True
Devices:
65536: TRADFRI on/off switch (TRADFRI on/off switch) - 100
Groups:
131073: TRADFRI group - False:0 - None
The only thing is, I can't find the new type of hardware in the hardware page of Domoticz. I can see a large list of all hardware I can add, but not the IKEA-tradfri type.
What am I missing here?
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 17 December 2019 14:08
by moroen
kvessen wrote: ↑Tuesday 17 December 2019 13:59
Hey guys,
I'm trying to make the plugin work for my install but I think I'm missing something. I'm really... really... not into linux, so I'm trying the best I can, but I can't get it to work. I've managed to make domoticz work and I have a readout of my smart-meter, but I want to expand the functionalities to Tradfri as well.
I've followed your manual which is it pretty clear I think, and I think I have a working connection with my Tradfri hub as you can see here:
(env) pi@raspberrypi:~ $ tradfri list
Lights:
Sockets:
65537: TRADFRI outlet (TRADFRI control outlet) - True
Devices:
65536: TRADFRI on/off switch (TRADFRI on/off switch) - 100
Groups:
131073: TRADFRI group - False:0 - None
The only thing is, I can't find the new type of hardware in the hardware page of Domoticz. I can see a large list of all hardware I can add, but not the IKEA-tradfri type.
What am I missing here?
It would appear that you haven't installed the plugin? The tradfri command line utility is one part of the (old) solution, you also need to install the
plugin (
https://github.com/moroen/IKEA-Tradfri-plugin). If you're starting from scratch, I would recommed the new solution (
https://github.com/moroen/IKEA-Tradfri- ... ree/pycoap) as the new solution doesn't require running tradfri as a service. Might I ask what kind of hardware you're running this on and if it's not a raspberry pi, which linux distro you're using?
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 17 December 2019 14:52
by kvessen
moroen wrote: ↑Tuesday 17 December 2019 14:08
kvessen wrote: ↑Tuesday 17 December 2019 13:59
Hey guys,
I'm trying to make the plugin work for my install but I think I'm missing something. I'm really... really... not into linux, so I'm trying the best I can, but I can't get it to work. I've managed to make domoticz work and I have a readout of my smart-meter, but I want to expand the functionalities to Tradfri as well.
I've followed your manual which is it pretty clear I think, and I think I have a working connection with my Tradfri hub as you can see here:
(env) pi@raspberrypi:~ $ tradfri list
Lights:
Sockets:
65537: TRADFRI outlet (TRADFRI control outlet) - True
Devices:
65536: TRADFRI on/off switch (TRADFRI on/off switch) - 100
Groups:
131073: TRADFRI group - False:0 - None
The only thing is, I can't find the new type of hardware in the hardware page of Domoticz. I can see a large list of all hardware I can add, but not the IKEA-tradfri type.
What am I missing here?
It would appear that you haven't installed the plugin? The tradfri command line utility is one part of the (old) solution, you also need to install the
plugin (
https://github.com/moroen/IKEA-Tradfri-plugin). If you're starting from scratch, I would recommed the new solution (
https://github.com/moroen/IKEA-Tradfri- ... ree/pycoap) as the new solution doesn't require running tradfri as a service. Might I ask what kind of hardware you're running this on and if it's not a raspberry pi, which linux distro you're using?
Regards,
M
That's it... I was looking at the old instructions, sorry about that. It worked like a charm with the instructions you posted. Thanks a lot for your effort!
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Wednesday 18 December 2019 22:53
by meneerbroekhuis
Hi Moroen,
I keep getting stuck at the same point as dressie:
python3 tradfricoap.py list
Traceback (most recent call last):
File "tradfricoap.py", line 11, in <module>
import pycoap
File "/usr/local/lib/python3.7/dist-packages/pycoap/__init__.py", line 1, in <module>
from .pycoap import Request, setDebugLevel, GET, PUT, POST
File "/usr/local/lib/python3.7/dist-packages/pycoap/pycoap.py", line 1, in <module>
import _pycoap
ImportError: dynamic module does not define module export function (PyInit__pycoap)
I did al the updates and reinstalling off pycoap as you recommended to him but i can't seem to get past this error. Any idea's what the next step shouold be?..... i'm running this on a pi3 - and i followed your latest instruction for the an install on a pi. Thanks
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 19 December 2019 9:50
by moroen
meneerbroekhuis wrote: ↑Wednesday 18 December 2019 22:53
Hi Moroen,
I keep getting stuck at the same point as dressie:
python3 tradfricoap.py list
Traceback (most recent call last):
File "tradfricoap.py", line 11, in <module>
import pycoap
File "/usr/local/lib/python3.7/dist-packages/pycoap/__init__.py", line 1, in <module>
from .pycoap import Request, setDebugLevel, GET, PUT, POST
File "/usr/local/lib/python3.7/dist-packages/pycoap/pycoap.py", line 1, in <module>
import _pycoap
ImportError: dynamic module does not define module export function (PyInit__pycoap)
I did al the updates and reinstalling off pycoap as you recommended to him but i can't seem to get past this error. Any idea's what the next step shouold be?..... i'm running this on a pi3 - and i followed your latest instruction for the an install on a pi. Thanks
Which raspbian version are you using?
Check versions and dependencies:
And try to install pycoap manually:
Code: Select all
$ git clone https://github.com/moroen/pycoap.git
$ cd pycoap
$ sudo -H python3 setup.py install
Please post the full output of the commands if it still doesn't work. I've verified the raspberry pi installation on a pi3 using the latest Raspbian Buster Lite-image...
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Saturday 21 December 2019 22:38
by Basssment
Hello Moroen,
I had the wheel error when installing the requirements.
after reading other posts in did the following:
Code: Select all
sudo apt install golang
pip3 install -r requirements.txt
Then the error was solved, but when i go to the next step:
Code: Select all
python3 tradfricoap.py config IP KEY
I get the following:
Code: Select all
2019/12/21 22:30:20 COAP DTLS Error: Handshake timeout
CRITICAL:root:Create_ident: No data from gateway
Maybe good to know is that I am runnig the plugin v1.1 on an other rpi at the moment where it still works at the moment, could that bring any conflict maybe?
Bas
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Sunday 22 December 2019 19:39
by moroen
Basssment wrote: ↑Saturday 21 December 2019 22:38
Code: Select all
2019/12/21 22:30:20 COAP DTLS Error: Handshake timeout
CRITICAL:root:Create_ident: No data from gateway
Maybe good to know is that I am runnig the plugin v1.1 on an other rpi at the moment where it still works at the moment, could that bring any conflict maybe?
Bas
The DTLS Handshake error shows that pycoap is installed and working, it just can't connect to the gateway. The most common reason is either wrong IP or KEY... If that's not the reason, can you reach the ikea-gateway with ping? And running the old plugin i parallel on another Pi shouldn't be a problem!
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Sunday 22 December 2019 20:13
by Basssment
moroen wrote: ↑Sunday 22 December 2019 19:39
Basssment wrote: ↑Saturday 21 December 2019 22:38
Code: Select all
2019/12/21 22:30:20 COAP DTLS Error: Handshake timeout
CRITICAL:root:Create_ident: No data from gateway
Maybe good to know is that I am runnig the plugin v1.1 on an other rpi at the moment where it still works at the moment, could that bring any conflict maybe?
Bas
The DTLS Handshake error shows that pycoap is installed and working, it just can't connect to the gateway. The most common reason is either wrong IP or KEY... If that's not the reason, can you reach the ikea-gateway with ping? And running the old plugin i parallel on another Pi shouldn't be a problem!
Regards,
M
Thank you,
After looking again I used the security id instead of the gatewayid.
Now it works for me!!
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Sunday 22 December 2019 22:06
by moroen
Basssment wrote: ↑Sunday 22 December 2019 20:13
moroen wrote: ↑Sunday 22 December 2019 19:39
Basssment wrote: ↑Saturday 21 December 2019 22:38
Code: Select all
2019/12/21 22:30:20 COAP DTLS Error: Handshake timeout
CRITICAL:root:Create_ident: No data from gateway
Maybe good to know is that I am runnig the plugin v1.1 on an other rpi at the moment where it still works at the moment, could that bring any conflict maybe?
Bas
The DTLS Handshake error shows that pycoap is installed and working, it just can't connect to the gateway. The most common reason is either wrong IP or KEY... If that's not the reason, can you reach the ikea-gateway with ping? And running the old plugin i parallel on another Pi shouldn't be a problem!
Regards,
M
Thank you,
After looking again I used the security id instead of the gatewayid.
Now it works for me!!
Easy mistake to make!
Glad i worked out!
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 24 December 2019 12:57
by trusky77
Hi, I'm new here and my English is very bad... I use the translator.
First, thank you for the effort to make this pluguin work. I have some doubts as to how it works:
1º If the house electricity goes out, when it comes again, the bulbs lights up alone. Is there any way this does not happen?
2º If i turn on the lights by the Ikea switch or turn off them, the changes don't update it in domoticz. It is right? (If I only use the dummy of each bulb in domoticz it works correctly)
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Tuesday 24 December 2019 23:50
by moroen
trusky77 wrote: ↑Tuesday 24 December 2019 12:57
Hi, I'm new here and my English is very bad... I use the translator.
First, thank you for the effort to make this pluguin work. I have some doubts as to how it works:
1º If the house electricity goes out, when it comes again, the bulbs lights up alone. Is there any way this does not happen?
This is by design from IKEA, when the power is turned on, the bulb will turn on. This has nothing to do with the plugin, and as far as I know, there is no way to change this behaviour.
trusky77 wrote: ↑Tuesday 24 December 2019 12:57
2º If i turn on the lights by the Ikea switch or turn off them, the changes don't update it in domoticz. It is right? (If I only use the dummy of each bulb in domoticz it works correctly)
If you use an IKEA switch to turn on or off a bulb, you need to set "Observe changes" to yes, and specify how often the plugin should check for an altered state (polling interval) You should avoid checking too often, as this will freeze the gateway. If you physically turn a bulb on/off by switching on/off the power to the bulb, the gateway has no way of knowing the state, and the plugin can't update to reflect the correct state.
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 11:40
by trusky77
moroen wrote: ↑Tuesday 24 December 2019 23:50
trusky77 wrote: ↑Tuesday 24 December 2019 12:57
Hi, I'm new here and my English is very bad... I use the translator.
First, thank you for the effort to make this pluguin work. I have some doubts as to how it works:
1º If the house electricity goes out, when it comes again, the bulbs lights up alone. Is there any way this does not happen?
This is by design from IKEA, when the power is turned on, the bulb will turn on. This has nothing to do with the plugin, and as far as I know, there is no way to change this behaviour.
trusky77 wrote: ↑Tuesday 24 December 2019 12:57
2º If i turn on the lights by the Ikea switch or turn off them, the changes don't update it in domoticz. It is right? (If I only use the dummy of each bulb in domoticz it works correctly)
If you use an IKEA switch to turn on or off a bulb, you need to set "Observe changes" to yes, and specify how often the plugin should check for an altered state (polling interval) You should avoid checking too often, as this will freeze the gateway. If you physically turn a bulb on/off by switching on/off the power to the bulb, the gateway has no way of knowing the state, and the plugin can't update to reflect the correct state.
Regards,
M
I understand. Perfect, it is already solved. My time to review changes was 300 and I have not had so much patience ... Now I have lowered the time to 30. Is it a prudent time? Thank you
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 15:39
by gschmidt
moroen wrote: ↑Tuesday 17 December 2019 14:08
kvessen wrote: ↑Tuesday 17 December 2019 13:59
Hey guys,
I'm trying to make the plugin work for my install but I think I'm missing something. I'm really... really... not into linux, so I'm trying the best I can, but I can't get it to work. I've managed to make domoticz work and I have a readout of my smart-meter, but I want to expand the functionalities to Tradfri as well.
I've followed your manual which is it pretty clear I think, and I think I have a working connection with my Tradfri hub as you can see here:
(env) pi@raspberrypi:~ $ tradfri list
Lights:
Sockets:
65537: TRADFRI outlet (TRADFRI control outlet) - True
Devices:
65536: TRADFRI on/off switch (TRADFRI on/off switch) - 100
Groups:
131073: TRADFRI group - False:0 - None
The only thing is, I can't find the new type of hardware in the hardware page of Domoticz. I can see a large list of all hardware I can add, but not the IKEA-tradfri type.
What am I missing here?
It would appear that you haven't installed the plugin? The tradfri command line utility is one part of the (old) solution, you also need to install the
plugin (
https://github.com/moroen/IKEA-Tradfri-plugin). If you're starting from scratch, I would recommed the new solution (
https://github.com/moroen/IKEA-Tradfri- ... ree/pycoap) as the new solution doesn't require running tradfri as a service. Might I ask what kind of hardware you're running this on and if it's not a raspberry pi, which linux distro you're using?
Regards,
M
Hi Moroen,
I want to install the IKEA tradfri plugin on a raspberry pi (Stretch) first time.
Is your new pycoap (raspberry version) plugin sufficient?
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 19:27
by iTDB
Two weeks ago I installed it an it works until I did a reboot.
If I do now a new install on Buster, the install works but not in Domoticz
Code: Select all
pi@raspbian:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfricoap.py list
65539: Slaapkamer lamp (0 - None)
65537: Living lamp (1 - 0)
65536: Living bediening (None - None)
65538: Slaapkamer bediening (None - None)
65540: TRADFRI motion sensor (None - None)
pi@raspbian:~/domoticz/plugins/IKEA-Tradfri $
Hardware:
Devices is still 'Loading...'
Log:
2019-12-26 19:06:16.308 Active notification Subsystems: gcm, http (2/13)
2019-12-26 19:06:16.317 Starting shared server on: :::6144
2019-12-26 19:06:16.153 Status: Domoticz V4.10717 (c)2012-2019 GizMoCuz
2019-12-26 19:06:16.153 Status: Build Hash: b38b49e5, Date: 2019-05-09 13:04:08
2019-12-26 19:06:16.153 Status: Startup Path: /home/pi/domoticz/
2019-12-26 19:06:16.302 Status: PluginSystem: Started, Python version '3.7.3'.
2019-12-26 19:06:16.310 Status: WebServer(HTTP) started on address: :: with port 8080
2019-12-26 19:06:16.314 Status: WebServer(SSL) started on address: :: with port 443
2019-12-26 19:06:16.318 Status: RxQueue: queue worker started...
2019-12-26 19:06:16.317 Status: TCPServer: shared server started...
2019-12-26 19:06:18.318 Status: EventSystem: reset all events...
2019-12-26 19:06:18.319 Status: EventSystem: reset all device statuses...
2019-12-26 19:06:18.462 Status: Python EventSystem: Initalizing event module.
2019-12-26 19:06:18.462 Status: EventSystem: Started
2019-12-26 19:06:18.462 Status: EventSystem: Queue thread started...
2019-12-26 19:06:18.698 Status: PluginSystem: Entering work loop.
2019-12-26 19:06:32.842 Status: (Ikea) Started.
2019-12-26 19:06:33.195 Status: (Ikea) Initialized version 0.5.2, author 'moroen'
2019-12-26 19:06:33.196 Status: (Ikea) Entering work loop.
2019-12-26 19:06:33.469 Error: (Ikea) 'onStart' failed 'NameError'.
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 348 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 249 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 231 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 21:42
by moroen
iTDB wrote: ↑Thursday 26 December 2019 19:27
Two weeks ago I installed it an it works until I did a reboot.
If I do now a new install on Buster, the install works but not in Domoticz
Code: Select all
pi@raspbian:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfricoap.py list
65539: Slaapkamer lamp (0 - None)
65537: Living lamp (1 - 0)
65536: Living bediening (None - None)
65538: Slaapkamer bediening (None - None)
65540: TRADFRI motion sensor (None - None)
pi@raspbian:~/domoticz/plugins/IKEA-Tradfri $
Hardware:
Devices is still 'Loading...'
Log:
2019-12-26 19:06:16.308 Active notification Subsystems: gcm, http (2/13)
2019-12-26 19:06:33.469 Error: (Ikea) 'onStart' failed 'NameError'.
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 348 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 249 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
2019-12-26 19:06:33.469 Error: (Ikea) ----> Line 231 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py'
You need to update to a newer version of pycoap... On a pi:
Code: Select all
$ cd domoticz/plugins/IKEA-Tradfri
$ sudo -H pip3 uninstall pycoap
$ sudo -H pip3 install -r requirements-pi.txt
Verify that the installed version is 0.6.2:
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 21:47
by moroen
gschmidt wrote: ↑Thursday 26 December 2019 15:39
I want to install the IKEA tradfri plugin on a raspberry pi (Stretch) first time.
Is your new pycoap (raspberry version) plugin sufficient?
Installing the pycoap version is recommended for all new installations, the old plugin-service solution is about to be retired...
A potential stumbling block when installing on stretch is that you need at least version 1.5 of the go compiler. Find the current version of go with:
If it's to old, you need to install a newer version of the compiler AND make sure that the root user also uses a newer version:
Take a look at the following issue for more information:
https://github.com/moroen/IKEA-Tradfri-plugin/issues/87
Regards,
M
Re: [REQUEST] Ikea Trådfri Gateway (smart lights hub controller) plugin?
Posted: Thursday 26 December 2019 21:49
by moroen
trusky77 wrote: ↑Thursday 26 December 2019 11:40
I understand. Perfect, it is already solved. My time to review changes was 300 and I have not had so much patience ... Now I have lowered the time to 30. Is it a prudent time? Thank you
You could try polling with an interval of 30, and see what happens. If your gateway suddenly stops responding, cycle the power to the gateway and try increasing the poll interval a bit...
Regards,
M