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

Python and python framework

Moderator: leecollings

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 »

Varazir wrote: Friday 10 May 2019 22:48
moroen wrote: Friday 10 May 2019 21:56
Varazir wrote: Friday 10 May 2019 13:22

I get nothing when running that command, just a blank line

Code: Select all

pi@zwave2:~/domoticz/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.8.8 started (command line)!

I have symlinked the folder into the plugin folder so domoticz can see it but it shouldn't matter when running this command.
The adapter is running and waiting for a connection from domoticz. What does the domoticz log show?

Regards,
M

I didn't get it I should enable the plugin well here is logs with debug

Code: Select all

2019-05-10 22:49:15.522 (IKEA) Transport set to: 'TCP/IP', 172.0.0.1:1234.

The shell still shows nothing.
Are you sure you have entered the correct IP on the plugin-configuration page in domoticz? It should be the IP of the machine running the adapter. If the adapter is running on the same machine as domoticz, it's normally 127.0.0.1, yours is set to 172.0.0.1...

Regards,
M
User avatar
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post by Varazir »

moroen wrote:
Varazir wrote: Friday 10 May 2019 22:48
moroen wrote: Friday 10 May 2019 21:56 The adapter is running and waiting for a connection from domoticz. What does the domoticz log show?

Regards,
M

I didn't get it I should enable the plugin well here is logs with debug

Code: Select all

2019-05-10 22:49:15.522 (IKEA) Transport set to: 'TCP/IP', 172.0.0.1:1234.

The shell still shows nothing.
Are you sure you have entered the correct IP on the plugin-configuration page in domoticz? It should be the IP of the machine running the adapter. If the adapter is running on the same machine as domoticz, it's normally 127.0.0.1, yours is set to 172.0.0.1...

Regards,
M
Ya, I used default settings and in the haste didn't catch IP. Changed to 127 and it worked. Should have seen that when I was comparing the settings between my 2 installations.

Skickat från min Nokia 7 plus via Tapatalk

Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Alessio78
Posts: 6
Joined: Wednesday 18 October 2017 0:42
Target OS: -
Domoticz version:
Contact:

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

Post by Alessio78 »

moroen wrote: Tuesday 19 March 2019 23:42
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
Hello, I reinstalled pytradfti and python 3.5.3.
For pytradfri if I run

Code: Select all

~/pytradfri $ python3 -i -m pytradfri IP_IKEA
I can control the lights and work correctly.
For python 3.5.3, if I run:

Code: Select all

python
Python 3.4.2 (default, Feb 10 2019, 17:23:02)
[GCC 4.9.2] on linux
and if I run:

Code: Select all

python3
Python 3.5.3 (default, May 12 2019, 02:51:00)
[GCC 4.9.2] on linux
I've installed python 3.5.3:

Code: Select all

 update-alternatives --list python3
/usr/local/bin/python3
but I've also:

Code: Select all

 update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3.4
Do you think that the problem can be this? How I can resolve?

Thanks in advance!
wolfguru
Posts: 6
Joined: Tuesday 27 September 2016 22:25
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by wolfguru »

Hello,

I bought Ikea Trådfri Gateway and lights and I'm trying to get it to run with Domoticz on Synology. I tried to follow the steps in the link (https://github.com/moroen/IKEA-Tradfri-plugin) but it seems that it is for RaspPi only.

I can see some posts where people have succeeded to get it to run on Synology.
Anyone can help with a description on how to get it to work on Synology? I have DS218+ and it is not bootstrapped. Do I need to bootstrap it? I tried to get the docker image to work instead but then it could not run due to missing config.json file.

Please help.
Thanks.
wolfguru
Posts: 6
Joined: Tuesday 27 September 2016 22:25
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by wolfguru »

Hi, is this a dead thread?
Alessio78
Posts: 6
Joined: Wednesday 18 October 2017 0:42
Target OS: -
Domoticz version:
Contact:

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

Post by Alessio78 »

Alessio78 wrote:
moroen wrote: Tuesday 19 March 2019 23:42
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
Hello, I reinstalled pytradfti and python 3.5.3.
For pytradfri if I run

Code: Select all

~/pytradfri $ python3 -i -m pytradfri IP_IKEA
I can control the lights and work correctly.
For python 3.5.3, if I run:

Code: Select all

python
Python 3.4.2 (default, Feb 10 2019, 17:23:02)
[GCC 4.9.2] on linux
and if I run:

Code: Select all

python3
Python 3.5.3 (default, May 12 2019, 02:51:00)
[GCC 4.9.2] on linux
I've installed python 3.5.3:

Code: Select all

 update-alternatives --list python3
/usr/local/bin/python3
but I've also:

Code: Select all

 update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3.4
Do you think that the problem can be this? How I can resolve?

Thanks in advance!
Hello, after a full reinstall of SO with DietPi work correctly

Inviato dal mio ZUK Z2121 utilizzando Tapatalk

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 »

wolfguru wrote: Saturday 25 May 2019 21:23 Hello,

I bought Ikea Trådfri Gateway and lights and I'm trying to get it to run with Domoticz on Synology. I tried to follow the steps in the link (https://github.com/moroen/IKEA-Tradfri-plugin) but it seems that it is for RaspPi only.

I can see some posts where people have succeeded to get it to run on Synology.
Anyone can help with a description on how to get it to work on Synology? I have DS218+ and it is not bootstrapped. Do I need to bootstrap it? I tried to get the docker image to work instead but then it could not run due to missing config.json file.

Please help.
Thanks.
I just made a change to the Dokcerfiles in the repo, hopefully this resolves the missing ikeatradfri library and missing config.json. I know nothing about Synology, and can't help you there.

Regards,
M
schulpr
Posts: 137
Joined: Thursday 01 January 2015 9:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post by schulpr »

Hi,

I have a lot of (dis)connections, more then once per minute. Is this normal behavior or is something wrong?

Code: Select all

(Tradfri) Device has disconnected
(Tradfri) Connected successfully to: 127.0.0.1
I'm on the latest beta of Domoticz and de plugin.

Thanks in advance for the help!

Kind regards, Rob
User avatar
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post by Varazir »

What's the best praxis on to update the plugin ?
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
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 »

schulpr wrote: Friday 07 June 2019 6:37 Hi,

I have a lot of (dis)connections, more then once per minute. Is this normal behavior or is something wrong?

Code: Select all

(Tradfri) Device has disconnected
(Tradfri) Connected successfully to: 127.0.0.1
I'm on the latest beta of Domoticz and de plugin.

Thanks in advance for the help!

Kind regards, Rob
It's not normal behavior, try running the adapter from the command line, and check for/post any errors...

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 »

Varazir wrote: Friday 07 June 2019 9:37 What's the best praxis on to update the plugin ?
If your running the adapter as a service, I would recommend:

Code: Select all

$ sudo systemctl stop domoticz.service
$ sudo systemctl stop ikea-tradfri.service
$ cd plugins/IKEA-Tradfri
$ git pull
$ sudo systemctl start ikea-tradfri.service
$ sudo systemctl start domoticz.service
After domoticz has restarted, you should take a look at the IKEA entry on the hardware page, and make sure that all fields still contains valid entries, just in case something has changed (though this should happen very rarely).

Regards,
M
schulpr
Posts: 137
Joined: Thursday 01 January 2015 9:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post by schulpr »

Hi M,

Thanks for the reaction. It's alright now. I had a wrong user in the configure.py file.

Kind regards, Rob
redfirebrooks
Posts: 40
Joined: Sunday 07 January 2018 15:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by redfirebrooks »

Again the plugin stopped to work.
I have this error :

Code: Select all

2019-06-27 23:36:19.828 (IKEA TRADFRI) Failed to connect to IKEA tradfri COAP-adapter! Status: 111 Description: Connection refused
2019-06-27 23:36:19.828 (IKEA TRADFRI) Device has disconnected
but

Code: Select all

pi@domoticz:~/domoticz/plugins/IKEA-Tradfri $ sudo systemctl status ikea-tradfri.service
● ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/etc/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-06-27 23:37:00 CEST; 2s ago
 Main PID: 9504 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─9504 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfil

juin 27 23:37:00 domoticz systemd[1]: Started IKEA Tradfri COAP-adapter.
So what's wrong !?!
Version: 2024.1
Build Hash: 5279c8261
Compile Date: 2024-01-01 12:59:22
dzVents Version: 3.1.8
Python Version: 3.9.2
Raspbian Bullseye
Raspberry3B+
RFLINK R48.4
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 »

redfirebrooks wrote: Thursday 27 June 2019 23:37 Again the plugin stopped to work.
I have this error :

Code: Select all

2019-06-27 23:36:19.828 (IKEA TRADFRI) Failed to connect to IKEA tradfri COAP-adapter! Status: 111 Description: Connection refused
2019-06-27 23:36:19.828 (IKEA TRADFRI) Device has disconnected
but

Code: Select all

pi@domoticz:~/domoticz/plugins/IKEA-Tradfri $ sudo systemctl status ikea-tradfri.service
● ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/etc/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-06-27 23:37:00 CEST; 2s ago
 Main PID: 9504 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─9504 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfil

juin 27 23:37:00 domoticz systemd[1]: Started IKEA Tradfri COAP-adapter.
So what's wrong !?!
Try to generate a new ident/PSK-pair...

Regards,
M
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 »

Recently, I am seeing twistd errors as follows:

Code: Select all

[stderr#error] ERROR:root:Error in initGateway: Request timeout
Trying to generate a new keypair, I also get a timeout. The Ikea app connects fine, has no issued controlling devices and the bridge is pingable. power cycling the bridge and restarting the ikea-tradfri-pi service then makes it connect again.

Both pytradfri and twisted are upgraded to the latest version. Same with the tradfri plugin. I did notice that the hub firmware was recently upgraded to 1.10.1.

Thoughts?

H
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 »

heggink wrote: Sunday 11 August 2019 10:43 Recently, I am seeing twistd errors as follows:

Code: Select all

[stderr#error] ERROR:root:Error in initGateway: Request timeout
Trying to generate a new keypair, I also get a timeout. The Ikea app connects fine, has no issued controlling devices and the bridge is pingable. power cycling the bridge and restarting the ikea-tradfri-pi service then makes it connect again.

Both pytradfri and twisted are upgraded to the latest version. Same with the tradfri plugin. I did notice that the hub firmware was recently upgraded to 1.10.1.

Thoughts?

H
So the adapter works after a restart, and then fails again? Intermittent network drops aren't handled all that well by the adapter. You might want to try switching to the (soon to be master) aiocoap-branch of the plugin, it handles intermittent network timeouts better than the the coap-client 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 »

It's been a long way coming, but the aiocoap (https://github.com/chrysn/aiocoap) version of the adapter and plugin has finally been pushed to the master branch. The upgrade should be fairly trivial, but some intervention is required. Anyone who updates the plugin to this version is urged to take a look at the readme.

This version removes the dependency on the coap-client command line tool and should be more resilient against network timeouts. It has the same features as the old version. The old coap-client based plugin is still available in the coap-client branch. Any glaring bugs in the coap-client based version might be fixed, but no further features will be implemented, unless someone is willing to fork the plugin and maintain the old version.

Regards,
M
peerkersezuuker
Posts: 70
Joined: Monday 14 December 2015 22:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Mierlo
Contact:

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

Post by peerkersezuuker »

Hi moroen,
Thanks for the hard work.
Is there a nice way to update the plugin from the previous version (coap-client) to this one (aiocoap) ?

Regards
Peter
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 »

peerkersezuuker wrote: Sunday 18 August 2019 15:05 Hi moroen,
Thanks for the hard work.
Is there a nice way to update the plugin from the previous version (coap-client) to this one (aiocoap) ?

Regards
Peter
Just follow the steps outlined in the readme. I'm not very good at writing instructions, so if anything is unclear, let me know and I'll try to explain it better...

Regards,
M
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

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

Post by olleman »

moroen wrote: Saturday 20 October 2018 18:23
Mambobuzzz wrote: Saturday 20 October 2018 18:11 Hi there,

is it worth installing on Windnows Domoticz? Is it stable?
I haven't used Windows for years, so I really don't know. I would guess it should work, at least if you create a docker image with the adapter.

Regards,
M
Somebody tried with windows? I've had my Domoticz installation on windows for years and it would be a major hassle to move to an RPi3 now...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest