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

Python and python framework

Moderator: leecollings

iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

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

Post by iTDB »

moroen wrote: Thursday 26 December 2019 21:42 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:

Code: Select all

$ pip3 list | grep pycoap
Regards,
M
It's the same errors I have.
pi@mydomoticz:~/domoticz/plugins/IKEA-Tradfri $ pip3 list | grep pycoap
pycoap 0.6.3
moroen
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?

Post by moroen »

iTDB wrote: Friday 27 December 2019 13:34
moroen wrote: Thursday 26 December 2019 21:42 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:

Code: Select all

$ pip3 list | grep pycoap
Regards,
M
It's the same errors I have.
pi@mydomoticz:~/domoticz/plugins/IKEA-Tradfri $ pip3 list | grep pycoap
pycoap 0.6.3
Sorry, there was an error in the commit to the repo, should be fixed now. Pull the latest version (plugin version 0.5.5, pycoap version 0.6.3) and it should work...

Regards,
M
iTDB
Posts: 29
Joined: Friday 29 November 2019 18:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Gent
Contact:

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

Post by iTDB »

moroen wrote: Saturday 28 December 2019 20:34
Sorry, there was an error in the commit to the repo, should be fixed now. Pull the latest version (plugin version 0.5.5, pycoap version 0.6.3) and it should work...

Regards,
M
Yep it's working
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post by heggink »

Finally managed to get it to work. Installing an up to date go release (for root) proved a challenge.
Great plugin, muuuch more responsive! Thanks for the awesome work.

Sent from phone.

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
wvdweerd
Posts: 22
Joined: Saturday 20 October 2018 18:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: The Netherlands
Contact:

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

Post by wvdweerd »

moroen wrote: Friday 13 December 2019 9:53 Thank's!

I'm pretty confident that the error is due to intermittent timeouts when the plugin requests an updated state from the gateway. The lack of a logical pattern to when the errors occur, support that theory. Glad it is, as you say, a bit more faulterant! I'm currently working on handling timeouts better, but it also requires changes to the underlying pycoap library, so it takes some time... I'll let you know when an updated version is available! :)

Regards,
M

P.S: And you're probably right that the same problem happened with the old plugin, but that the old solution handled it even worse. If the new version works out as hoped, the old version will be retired, and any new features only added to the new plugin...
Hi Moroen,

Just to let you know:
A few days ago I installed the latest version, 0.5.5, and everything is still running fine :)
Except for (the same) error messages in the log. These are the errors for one day:

Code: Select all

 2020-01-01 00:23:20.940 Error: (IKEA Tradfri) Error updating device 65552: Connection time out
2020-01-01 02:48:22.605 Error: (IKEA Tradfri) Error updating device 65551: Connection time out
2020-01-01 05:08:27.322 Error: (IKEA Tradfri) Error updating device 65554: Connection time out
2020-01-01 05:33:30.407 Error: (IKEA Tradfri) Error updating device 65550: Connection time out
2020-01-01 09:18:32.768 Error: (IKEA Tradfri) Error updating device 65554: Connection time out
2020-01-01 09:58:33.306 Error: (IKEA Tradfri) Error updating device 65547: Connection time out
2020-01-01 10:08:36.895 Error: (IKEA Tradfri) Error updating device 65538: Connection time out
2020-01-01 10:28:39.882 Error: (IKEA Tradfri) Error updating device 65554: Connection time out
2020-01-01 11:18:43.504 Error: (IKEA Tradfri) Error updating device 65538: Connection time out
2020-01-01 14:03:45.180 Error: (IKEA Tradfri) Error updating device 65551: Connection time out
2020-01-01 14:38:48.785 Error: (IKEA Tradfri) Error updating device 65537: Connection time out
2020-01-01 15:48:52.535 Error: (IKEA Tradfri) Error updating device 65538: Connection time out
2020-01-01 17:43:56.611 Error: (IKEA Tradfri) Error updating device 65548: Connection time out
2020-01-01 19:04:00.413 Error: (IKEA Tradfri) Error updating device 65552: Connection time out
2020-01-01 20:49:04.804 Error: (IKEA Tradfri) Error updating device 65551: Connection time out
2020-01-01 22:04:05.433 Error: (IKEA Tradfri) Error updating device 65554: Connection time out 
Like you said: intermittent time outs.
Maybe you should not consider this as errors but as expected behaviour for Ikea Tradfri ?! :twisted:

Regards, Wouter
moroen
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?

Post by moroen »

Just a heads up, that from this point forward, the pycoap version of the plugin is the default. The master branch of the repo has been updated to reflect this. Anyone who wants to use the old version, will find it in the legacy branch. There are no further updates planed for the legacy version.

Regards,
M
moroen
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?

Post by moroen »

heggink wrote: Thursday 02 January 2020 9:13 Finally managed to get it to work. Installing an up to date go release (for root) proved a challenge.
Great plugin, muuuch more responsive! Thanks for the awesome work. Image

Sent from phone.
Glad it worked out! It should be possible to compile the pycoap module as a regular user, and just use sudo for the installation step! I'll take a look into it and update the readme if I figure out a way to do this! I would recommend updating to Buster, though... ;)

Regards,
M
trusky77
Posts: 18
Joined: Tuesday 24 December 2019 12:44
Target OS: -
Domoticz version:

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

Post by trusky77 »

moroen wrote: Thursday 26 December 2019 21:49
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

Hello again. I installed the pluguin a few days ago. Everything seems to work correctly but randomly this appears in the log:

2020-01-03 16:11:01.315 Error: (IKEA Tradfri) 'onHeartbeat' failed 'AttributeError':''device' object has no attribute 'device''.
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 347 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 303 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 65 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function indexRegisteredDevices
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 83 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function updateDevice
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 169 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Level
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 289 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Members
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 117 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function DeviceID
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post by heggink »

moroen wrote: Friday 03 January 2020 1:50
heggink wrote: Thursday 02 January 2020 9:13 Finally managed to get it to work. Installing an up to date go release (for root) proved a challenge.
Great plugin, muuuch more responsive! Thanks for the awesome work. Image

Sent from phone.
Glad it worked out! It should be possible to compile the pycoap module as a regular user, and just use sudo for the installation step! I'll take a look into it and update the readme if I figure out a way to do this! I would recommend updating to Buster, though... ;)

Regards,
M
Agree BUT my stretch is already an 'non-recommended' upgrade from Jessie. Doing it again requires some careful planning. There's too much stuff installed to start from scratch with a new image :roll: ...
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
moroen
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?

Post by moroen »

trusky77 wrote: Friday 03 January 2020 19:26
moroen wrote: Thursday 26 December 2019 21:49
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

Hello again. I installed the pluguin a few days ago. Everything seems to work correctly but randomly this appears in the log:

2020-01-03 16:11:01.315 Error: (IKEA Tradfri) 'onHeartbeat' failed 'AttributeError':''device' object has no attribute 'device''.
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 347 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 303 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 65 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function indexRegisteredDevices
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 83 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function updateDevice
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 169 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Level
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 289 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Members
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 117 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function DeviceID
This is probably due to intermittent connection timeouts, but the plugin should handle it with a more proper error message. Which version of the plugin are you using? The latest version (0.5.5) should fix this.

After the pycoap version became the default, you need to switch to the master branch before pulling the latest changes:

Code: Select all

$ sudo systemctl stop domoticz.service
$ cd domoticz/plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ sudo systemctl start domoticz.service
Regards,
M
trusky77
Posts: 18
Joined: Tuesday 24 December 2019 12:44
Target OS: -
Domoticz version:

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

Post by trusky77 »

moroen wrote: Friday 03 January 2020 21:14
trusky77 wrote: Friday 03 January 2020 19:26
moroen wrote: Thursday 26 December 2019 21:49

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

Hello again. I installed the pluguin a few days ago. Everything seems to work correctly but randomly this appears in the log:

2020-01-03 16:11:01.315 Error: (IKEA Tradfri) 'onHeartbeat' failed 'AttributeError':''device' object has no attribute 'device''.
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 347 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 303 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 65 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function indexRegisteredDevices
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 83 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function updateDevice
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 169 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Level
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 289 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Members
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 117 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function DeviceID
This is probably due to intermittent connection timeouts, but the plugin should handle it with a more proper error message. Which version of the plugin are you using? The latest version (0.5.5) should fix this.

After the pycoap version became the default, you need to switch to the master branch before pulling the latest changes:

Code: Select all

$ sudo systemctl stop domoticz.service
$ cd domoticz/plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ sudo systemctl start domoticz.service
Regards,
M

I do not remember which version I installed. I did it on December 22 and imagine that I installed the last one. I have done the steps you have indicated and now I get these errors and it has stopped working.

2020-01-04 15:26:51.691 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'.
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Module Import failed, exception: 'NameError'
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Error Line details not available.
2020-01-04 15:27:38.601 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:27:52.612 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:28:06.632 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
moroen
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?

Post by moroen »

trusky77 wrote: Saturday 04 January 2020 15:31
moroen wrote: Friday 03 January 2020 21:14
trusky77 wrote: Friday 03 January 2020 19:26


Hello again. I installed the pluguin a few days ago. Everything seems to work correctly but randomly this appears in the log:

2020-01-03 16:11:01.315 Error: (IKEA Tradfri) 'onHeartbeat' failed 'AttributeError':''device' object has no attribute 'device''.
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 347 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 303 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function onHeartbeat
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 65 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function indexRegisteredDevices
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 83 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py', function updateDevice
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 169 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Level
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 289 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function Members
2020-01-03 16:11:01.316 Error: (IKEA Tradfri) ----> Line 117 in '/home/pi/domoticz/plugins/IKEA-Tradfri/tradfricoap.py', function DeviceID
This is probably due to intermittent connection timeouts, but the plugin should handle it with a more proper error message. Which version of the plugin are you using? The latest version (0.5.5) should fix this.

After the pycoap version became the default, you need to switch to the master branch before pulling the latest changes:

Code: Select all

$ sudo systemctl stop domoticz.service
$ cd domoticz/plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ sudo systemctl start domoticz.service
Regards,
M

I do not remember which version I installed. I did it on December 22 and imagine that I installed the last one. I have done the steps you have indicated and now I get these errors and it has stopped working.

2020-01-04 15:26:51.691 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'.
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Module Import failed, exception: 'NameError'
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Error Line details not available.
2020-01-04 15:27:38.601 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:27:52.612 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:28:06.632 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
The plugin is a constant work in progress... ;)

Does the list command still work after you pulled the latest changes?

Code: Select all

$ python3 tradfricoap.py list
Regards,
M
trusky77
Posts: 18
Joined: Tuesday 24 December 2019 12:44
Target OS: -
Domoticz version:

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

Post by trusky77 »

moroen wrote: Saturday 04 January 2020 21:50
trusky77 wrote: Saturday 04 January 2020 15:31
moroen wrote: Friday 03 January 2020 21:14

This is probably due to intermittent connection timeouts, but the plugin should handle it with a more proper error message. Which version of the plugin are you using? The latest version (0.5.5) should fix this.

After the pycoap version became the default, you need to switch to the master branch before pulling the latest changes:

Code: Select all

$ sudo systemctl stop domoticz.service
$ cd domoticz/plugins/IKEA-Tradfri
$ git checkout master
$ git pull
$ sudo systemctl start domoticz.service
Regards,
M

I do not remember which version I installed. I did it on December 22 and imagine that I installed the last one. I have done the steps you have indicated and now I get these errors and it has stopped working.

2020-01-04 15:26:51.691 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'.
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Module Import failed, exception: 'NameError'
2020-01-04 15:26:51.691 Error: (IKEA Tradfri) Error Line details not available.
2020-01-04 15:27:38.601 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:27:52.612 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
2020-01-04 15:28:06.632 Error: IKEA Tradfri hardware (14) thread seems to have ended unexpectedly
The plugin is a constant work in progress... ;)

Does the list command still work after you pulled the latest changes?

Code: Select all

$ python3 tradfricoap.py list
Regards,
M

Good morning. Since nothing of Ikea was working yesterday, I decided to restore to a previous .img and thus be able to continue working. I tried the List command without having done the update you told me yesterday and I get this.

pi@raspberrypi:~ $ python3 tradfricoap.py list
python3: can't open file 'tradfricoap.py': [Errno 2] No such file or directory
moroen
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?

Post by moroen »

trusky77 wrote: Sunday 05 January 2020 13:00 Good morning. Since nothing of Ikea was working yesterday, I decided to restore to a previous .img and thus be able to continue working. I tried the List command without having done the update you told me yesterday and I get this.

pi@raspberrypi:~ $ python3 tradfricoap.py list
python3: can't open file 'tradfricoap.py': [Errno 2] No such file or directory
This needs to be run from the plugin/IKEA-Tradfri directory

Regards,
M
trusky77
Posts: 18
Joined: Tuesday 24 December 2019 12:44
Target OS: -
Domoticz version:

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

Post by trusky77 »

moroen wrote: Sunday 05 January 2020 14:31
trusky77 wrote: Sunday 05 January 2020 13:00 Good morning. Since nothing of Ikea was working yesterday, I decided to restore to a previous .img and thus be able to continue working. I tried the List command without having done the update you told me yesterday and I get this.

pi@raspberrypi:~ $ python3 tradfricoap.py list
python3: can't open file 'tradfricoap.py': [Errno 2] No such file or directory
This needs to be run from the plugin/IKEA-Tradfri directory

Regards,
M
Ups sorry...
I have updated again and I show you what appears on the screen.

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfricoap.py list
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri/pycoap_api.py", line 4, in <module>
from pycoap import setDebugLevel, Request, __version__, POST, PUT, GET
ImportError: cannot import name '__version__'

During handling of the above exception, another exception occurred:
moroen
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?

Post by moroen »

trusky77 wrote: Sunday 05 January 2020 15:37
moroen wrote: Sunday 05 January 2020 14:31
trusky77 wrote: Sunday 05 January 2020 13:00 Good morning. Since nothing of Ikea was working yesterday, I decided to restore to a previous .img and thus be able to continue working. I tried the List command without having done the update you told me yesterday and I get this.

pi@raspberrypi:~ $ python3 tradfricoap.py list
python3: can't open file 'tradfricoap.py': [Errno 2] No such file or directory
This needs to be run from the plugin/IKEA-Tradfri directory

Regards,
M
Ups sorry...
I have updated again and I show you what appears on the screen.

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfricoap.py list
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri/pycoap_api.py", line 4, in <module>
from pycoap import setDebugLevel, Request, __version__, POST, PUT, GET
ImportError: cannot import name '__version__'

During handling of the above exception, another exception occurred:
You probably have a old version of pycoap installed, update to the latest version with:

Code: Select all

$ sudo -H pip3 install -U -i https://test.pypi.org/simple/ pycoap
This should update pycoap to version 0.6.3

Regards,
M
trusky77
Posts: 18
Joined: Tuesday 24 December 2019 12:44
Target OS: -
Domoticz version:

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

Post by trusky77 »

moroen wrote: Sunday 05 January 2020 22:06
trusky77 wrote: Sunday 05 January 2020 15:37
moroen wrote: Sunday 05 January 2020 14:31

This needs to be run from the plugin/IKEA-Tradfri directory

Regards,
M
Ups sorry...
I have updated again and I show you what appears on the screen.

pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfricoap.py list
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri/pycoap_api.py", line 4, in <module>
from pycoap import setDebugLevel, Request, __version__, POST, PUT, GET
ImportError: cannot import name '__version__'

During handling of the above exception, another exception occurred:
You probably have a old version of pycoap installed, update to the latest version with:

Code: Select all

$ sudo -H pip3 install -U -i https://test.pypi.org/simple/ pycoap
This should update pycoap to version 0.6.3

Regards,
M
Good night. I just installed the update and it seems to work again. I've left it for a while and now I get this in the log.

2020-01-06 19:58:32.564 Error: (IKEA Tradfri) Error updating device 65539: Connection time out
2020-01-06 20:03:22.514 Error: (IKEA Tradfri) Error updating device 65547: Connection time out
2020-01-06 20:16:05.782 Error: (IKEA Tradfri) Error updating device 65546: Connection time out
2020-01-06 20:24:05.503 Error: (IKEA Tradfri) Error updating device 65546: Connection time out
2020-01-06 20:26:19.088 Error: Error parsing http request.
Sandy
Posts: 8
Joined: Monday 11 December 2017 21:17
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Location: Nijmegen (NL)
Contact:

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

Post by Sandy »

Moroen,

Just a quick reply to thank you for this plugin.
At first it didnt seem to work, but i was following the wrong steps (non raspberry one).
So i deleted the folder of IKEA-Tradfri and i redid everystep of the right procedure.

It works now, thanks a lot for this, finally can dim my BESTA-closet lights now.
Thanks again.

One question. The plug (outlet/socket).. is it able to monitor usage?
moroen
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?

Post by moroen »

trusky77 wrote: Monday 06 January 2020 20:47
Good night. I just installed the update and it seems to work again. I've left it for a while and now I get this in the log.

2020-01-06 19:58:32.564 Error: (IKEA Tradfri) Error updating device 65539: Connection time out
2020-01-06 20:03:22.514 Error: (IKEA Tradfri) Error updating device 65547: Connection time out
2020-01-06 20:16:05.782 Error: (IKEA Tradfri) Error updating device 65546: Connection time out
2020-01-06 20:24:05.503 Error: (IKEA Tradfri) Error updating device 65546: Connection time out
Glad it worked out! The plugin should handle intermittent connection timeouts, it just waits 10 seconds and then try to connect again. Since the requests to the gateway are blocking the domoticz plugin thread, the timeout are deliberately short, so only a small amount of network latency will trigger this error.

Are your raspberry and the gateway connected via WiFi? I'm running domoticz on an old MacMini, with both the gateway and server connected via wired ethernet, and on this setup, timeouts are extremely rare... But as long as you're able to control the devices, it should be all right!

Regards,
M
moroen
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?

Post by moroen »

Sandy wrote: Monday 06 January 2020 21:00 Moroen,

Just a quick reply to thank you for this plugin.
At first it didnt seem to work, but i was following the wrong steps (non raspberry one).
So i deleted the folder of IKEA-Tradfri and i redid everystep of the right procedure.

It works now, thanks a lot for this, finally can dim my BESTA-closet lights now.
Thanks again.

One question. The plug (outlet/socket).. is it able to monitor usage?
Thank you for the feedback! ;)

I don't think the plugs are able to monitor usage, as least I'm not able to identify anything that looks like usage information in the data returned from the gateway...

Regards,
M
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests