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

bmoons wrote: Thursday 31 May 2018 14:27 everything worked for 30 min afterwards I restarted the PI and it doesn't connect anymore to my devices.
I get an error
Failed to connect to IKEA tradfri COAP-adapter! Status: 111 Description: Connection refused

I really want this to work
The adapter is not running. Are you running the adapter as a service? On a guess, I would say that you ran the adapter from the command line, and after reboot, it didn't restart. See the description of the steps I gave to Mario a couple of posts back... :)

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 »

Mario wrote: Thursday 31 May 2018 21:00
Hi M,

Done as told and I think everything went okay, except the hardware isn't showing anymore. I think plugin doesn't start now, can you try to explain why?
Here is the log from PI and the log from Domoticz

sudo systemctl status ikea-tradfri
● ikea-tradfri.service - IKEA Tradfri COAP-adapter
Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled)
Active: active (running) since Thu 2018-05-31 20:46:48 CEST; 5min ago
Main PID: 433 (twistd)
CGroup: /system.slice/ikea-tradfri.service
└─433 /usr/local/bin/python3.5 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri ...

May 31 20:46:48 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/...tac...
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [-] Loaded.
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] t...ng up.
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] r...actor.
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [-] AdaptorFactory starting on 1234
May 31 20:46:51 raspberrypi twistd[433]: 2018-05-31T20:46:51+0200 [builtins.AdaptorFactory#info] Starting factory <Ad...02b90>
Hint: Some lines were ellipsized, use -l to show in full.

2018-05-31 20:46:54.302 Domoticz V3.9527 (c)2012-2018 GizMoCuz
2018-05-31 20:46:54.302 Build Hash: 2fe4348e, Date: 2018-05-28 14:09:12
2018-05-31 20:46:54.303 Startup Path: /home/pi/domoticz/
2018-05-31 20:46:54.467 EventSystem: reset all events...
2018-05-31 20:46:54.474 PluginSystem: 'IKEA' Registration ignored, Plugins are not enabled.
2018-05-31 20:46:54.507 WebServer(HTTP) started on address: :: with port 8080
2018-05-31 20:46:54.530 WebServer(SSL) started on address: :: with port 443
2018-05-31 20:46:54.532 Proxymanager started.
2018-05-31 20:46:54.533 Camera: settings (re)loaded
2018-05-31 20:46:54.535 TCPServer: shared server started...
2018-05-31 20:46:54.535 RxQueue: queue worker started...
2018-05-31 20:46:55.697 PROXY: Authenticate result: success.
2018-05-31 20:46:56.536 Wunderground: Worker started...
2018-05-31 20:46:56.538 ToonThermostat: Worker started...
The operative line is "2018-05-31 20:46:54.474 PluginSystem: 'IKEA' Registration ignored, Plugins are not enabled." You should see a line confirming the presence of python, like

Code: Select all

2018-06-01 00:04:36.253  PluginSystem: Started, Python version '3.6.5'
Have you installed the python libs and dev?

Code: Select all

$ sudo apt-get install python3 python3-dev
I think the python3 package is installed by default, allowing python3 to run from the command line, but you actually need the libs from the dev-package to run embedded python like in domoticz!

Regards,
M
Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Mario »

Dear M,

See below,

sudo apt-get install python3 python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version.
python3 set to manually installed.
python3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So what else can we try?
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 »

Mario wrote: Friday 01 June 2018 8:15 Dear M,

See below,

sudo apt-get install python3 python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version.
python3 set to manually installed.
python3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So what else can we try?
Ok, let's take a step back: Are you using a precompiled binary or are compiling from source? Beta or stable?

Regards,
M
Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Mario »

moroen wrote: Saturday 02 June 2018 1:12
Mario wrote: Friday 01 June 2018 8:15 Dear M,

See below,

sudo apt-get install python3 python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version.
python3 set to manually installed.
python3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So what else can we try?
Ok, let's take a step back: Are you using a precompiled binary or are compiling from source? Beta or stable?

Regards,
M
Goodmorning M,

First time I used the following:

1. wget https://www.python.org/ftp/python/3.5.2 ... 5.2.tar.xz
2. tar -xvf Python-3.5.2.tar.xz
3. cd Python-3.5.2
4. ./configure
5. make
6 make altinstall

It was not working and I noticed you said something about Python 3.6 and then I installed following:

sudo apt-get update
$ sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
If one of the packages cannot be found, try a newer version number (e.g. libdb5.4-dev instead of libdb5.3-dev).

Download and install Python 3.6. When downloading the source code, select the most recent release of Python 3.6, available on the official site. Adjust the file names accordingly.

$ wget https://www.python.org/ftp/python/3.6.5 ... 6.5.tar.xz
$ tar xf Python-3.6.5.tar.xz
$ cd Python-3.6.5
$ ./configure
$ make
$ sudo make altinstall

I figure this is the stable one. When I need another version can you direct me n where to get it?

Again thanks for the help
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 »

Mario wrote: Saturday 02 June 2018 9:38
moroen wrote: Saturday 02 June 2018 1:12
Mario wrote: Friday 01 June 2018 8:15 Dear M,

See below,

sudo apt-get install python3 python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version.
python3 set to manually installed.
python3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So what else can we try?
Ok, let's take a step back: Are you using a precompiled binary or are compiling from source? Beta or stable?

Regards,
M
Goodmorning M,

First time I used the following:

1. wget https://www.python.org/ftp/python/3.5.2 ... 5.2.tar.xz
2. tar -xvf Python-3.5.2.tar.xz
3. cd Python-3.5.2
4. ./configure
5. make
6 make altinstall

It was not working and I noticed you said something about Python 3.6 and then I installed following:

sudo apt-get update
$ sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
If one of the packages cannot be found, try a newer version number (e.g. libdb5.4-dev instead of libdb5.3-dev).

Download and install Python 3.6. When downloading the source code, select the most recent release of Python 3.6, available on the official site. Adjust the file names accordingly.

$ wget https://www.python.org/ftp/python/3.6.5 ... 6.5.tar.xz
$ tar xf Python-3.6.5.tar.xz
$ cd Python-3.6.5
$ ./configure
$ make
$ sudo make altinstall

I figure this is the stable one. When I need another version can you direct me n where to get it?

Again thanks for the help
Any version of python > 3.4 should work, so 3.6 is great! I figure that either domoticz can't find the pythonX.so (lib-file) or somehow have been compiled without python support.

Regards,
M
Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Mario »

Dear Moroen,

Don't ask me what I did but everything is working now. I would like to thank you for your help and your patience. it is much appreciated.

Kind regards,

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

Mario wrote: Sunday 03 June 2018 22:27 Dear Moroen,

Don't ask me what I did but everything is working now. I would like to thank you for your help and your patience. it is much appreciated.

Kind regards,

Mario
Glad it worked out! :) And no problem!

Regards,
M
Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Mario »

Dear Moroen,

I was too excited. Domoticz will run for a day and then goes offline. After reboot I notice the following error in Domoticz:

2018-05-31 20:46:54.474 PluginSystem: 'IKEA' Registration ignored, Plugins are not enabled.

Something shuts down. Can you figure out what?

Thx, Mario
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 »

Mario wrote: Wednesday 06 June 2018 20:57 Dear Moroen,

I was too excited. Domoticz will run for a day and then goes offline. After reboot I notice the following error in Domoticz:

2018-05-31 20:46:54.474 PluginSystem: 'IKEA' Registration ignored, Plugins are not enabled.

Something shuts down. Can you figure out what?

Thx, Mario
Hm, strange. Are you using any other python-plugins? You're on a raspberry pi, if memory serves me correctly? Have you tried starting from scratch, using a frem download of raspbian.img?

Regards,
M
Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Mario »

Hi,

No other python plugins. Only a rfxcom.
And yes, installation was from scratch. A Jessie raspberry PI image.
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 »

Mario wrote: Wednesday 06 June 2018 21:44 Hi,

No other python plugins. Only a rfxcom.
And yes, installation was from scratch. A Jessie raspberry PI image.
Compiling domoticz from source or using a prebuilt binary?

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

Hello,
just to mention that it looks like the plugin does not work with de v4.9 :

Code: Select all

2018-06-24 22:25:15.879 Error: (IKEA-TRADFRI) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.
2018-06-24 22:25:16.782 Error: (IKEA-TRADFRI) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.
I hope it will be updated soon.
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
User avatar
Kaitsu
Posts: 1
Joined: Monday 01 February 2016 18:13
Target OS: -
Domoticz version:
Contact:

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

Post by Kaitsu »


redfirebrooks wrote:Hello,
just to mention that it looks like the plugin does not work with de v4.9 :

Code: Select all

2018-06-24 22:25:15.879 Error: (IKEA-TRADFRI) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.
2018-06-24 22:25:16.782 Error: (IKEA-TRADFRI) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.
I hope it will be updated soon.
Development branch works with latest stable.

Lähetetty minun ONEPLUS A5010 laitteesta Tapatalkilla

m0rph13
Posts: 18
Joined: Sunday 31 January 2016 1:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

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

Post by m0rph13 »

Gettting the latest version from Master branch and restarting my Pi made the above mentioned problem go away. The only strangeness that remains (for me now) is that none of the Trådfri devices are shown anywhere except for under Settings -> Devices.
Anyone else encountered this and found a fix for it?

https://github.com/moroen/IKEA-Tradfri-plugin/issues/39
dzjr
Posts: 45
Joined: Monday 02 July 2018 23:35
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.100xx
Location: Alkmaar, The Netherlands
Contact:

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

Post by dzjr »

Hello everybody,

I am a newbie whit Domoticz and i hope that i can control my home and garden whit Domoticz.

As a start i was trying to install the Ikea Tradfri plugin because i already have some Tradfri components, and thats a good start i thought .


So, i have a raspberry 3 clean install whit "Raspbian stretch 2018-06-28" and also a clean install of "Domoticz 4.9700"

After the install of Domoticz i tried to Install libcoap as per ggravlingen's description, only whit that script gave a error of missing some file's (it Couldn't find áutoconfig', 'aclocal', 'libtool', 'libtoolize')
(i dind't make a copy of these error's).
Whit some help of google i found at https://learn.pimoroni.com/tutorial/san ... om-your-pi a working instruction for Coap, so first step dune.

Next i followed the instruction from the Github, it looks like everything was installed oké,

So, i configured IKEA Tradfri in Domoticz, and in the log there was the following error:

Code: Select all

2018-07-06 18:39:53.965 (Tradfri) Failed to connect to IKEA tradfri COAP-adapter! Status: 111 Description: Connection refused
2018-07-06 18:39:53.965 (Tradfri) Device has disconnected
I looked in some message's on this board and(re) installed/updated OpenSSL and twisted as suggested and also Run tradfri.tac whit Python3 and it display a error message after i pressed RUN

Code: Select all

Warning (from warnings module):
  File "", line 0
UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''. 
Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied.  
Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification.  
Many valid certificate/hostname mappings may be rejected.
So i google-ed for service-identity and tried to install is whit " sudo pip install service_identity"

after re-run " sudo pip install service_identity " the commandline came whit the message that is is installed in Phyton2,7


only that don't get a solution probably because it is installed in Phyton 2,7 instead of 3,5, the next error display-ed in Phyton-3 after run tradfri.tac;

I don't know how to install the service-identyti in phyton3,5.

Code: Select all

Connected from IPv4Address(TCP, '127.0.0.1', 44672)
Data received: b'{"groups": "False", "identity": "***************", "pollinterval": "30", "psk": "{\\"9091\\":\\"****************\\",\\"9029\\":\\"1.4.0015\\"}", "gateway": "192.168.0.19", "action": "setConfig", "observe": "False"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 103, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 86, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 205, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 211, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 76, in dataReceived
    self.factory.initGateway(self, command)
  File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 275, in initGateway
    self.devices = self.api(self.api(self.gateway.get_devices()))
  File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
    return self._execute(api_commands, timeout=timeout)
  File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
    raise RequestTimeout() from None
pytradfri.error.RequestTimeout: 

Disconnected

(the ******** is because i removed the official code)

in the log of Domoticz the following message's show up;

Code: Select all

2018-07-06 19:07:24.279 (Tradfri) Connected successfully to: 192.168.0.19
2018-07-06 19:07:35.202 PluginSystem: Restarting I/O service thread.
2018-07-06 19:07:35.203 (Tradfri) Device has disconnected

Also the tradfri hub is not working when i run tradfri.tac (probably because the error) , after stop tradfri.tac it the HUB is working again.

I hope some of you can help me whit this problem.

Again, i have a new raspbian en domoticz install and only configured the IKEA Tradfri plugin.
NUC Proxmox VM Stable & Raspberry Pi-3 Domoticz Beta
Tradfri Pluging by Moroen, Home made MySensors, Luftdaten, Home & Garden automatisation.
APC Back-UPS XS 700U, Modbus RTU & Janitza UMG103, RF-Link
Sonos plugins
dzjr
Posts: 45
Joined: Monday 02 July 2018 23:35
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.100xx
Location: Alkmaar, The Netherlands
Contact:

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

Post by dzjr »

i found a solution for the problem of the service identity;

here: https://stackoverflow.com/questions/483 ... ot-working


only now i have another problem, in Domoticz is the tradfri host connected succesfully and after 10 seconds "PluginSystem Restarting I/O service thread"

Code: Select all

 2018-08-04 21:24:17.866 (IKEA Tradfri) Connected successfully to: 192.168.0.19
2018-08-04 21:24:28.085 PluginSystem: Restarting I/O service thread.
2018-08-04 21:24:28.085 (IKEA Tradfri) Device has disconnected 
when i run tradfri.tac in the commandline i get this:

Code: Select all


Connected from IPv4Address(type='TCP', host='127.0.0.1', port=51086)
Data received: b'{"identity": "*********", "groups": "False", "pollinterval": "30", "action": "setConfig", "gateway": "192.168.0.19", "observe": "False", "psk": " {\\"9091\\":\\"***********************\\",\\"9029\\":\\"1.4.0015\\"}"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/log.py", line 103, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/log.py", line 86, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 243, in doRead
    return self._dataReceived(data)
  File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 249, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "tradfri.tac", line 76, in dataReceived
    self.factory.initGateway(self, command)
  File "tradfri.tac", line 275, in initGateway
    self.devices = self.api(self.api(self.gateway.get_devices()))
  File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
    return self._execute(api_commands, timeout=timeout)
  File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
    raise RequestTimeout() from None
pytradfri.error.RequestTimeout: 

Disconnected


is there anything i do wrong?

I hope someone can help me.


Thanks you
NUC Proxmox VM Stable & Raspberry Pi-3 Domoticz Beta
Tradfri Pluging by Moroen, Home made MySensors, Luftdaten, Home & Garden automatisation.
APC Back-UPS XS 700U, Modbus RTU & Janitza UMG103, RF-Link
Sonos plugins
djim1
Posts: 2
Joined: Tuesday 07 August 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9796
Location: The Netherlands
Contact:

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

Post by djim1 »

Hello,

I'am new to this topic but I tried to install the IKEA tradfri plugin and facing some problems. I followd each step (installed the libcoap, pytradfri-library and twisted.
I am on step 5 and there it's getting wrong.
I filled my GATEWAY-KEY (here in example filled with xxxxxxxxxxx), IDENT en IP....i even tried with other IDENT-names but each time i get no PSK respons.

Code: Select all

pi@raspberrypi:~ $ coap-client -m post -u "Client_identity" -k "xxxxxxxxxxxxxxx" -e '{"9090":"IKEA01"}' "coaps://192.168.0.24:5684/15011/9063"
v:1 t:CON c:POST i:797a {} [ ]
pi@raspberrypi:~ $ 
What do i wrong?

regards
D
djim1
Posts: 2
Joined: Tuesday 07 August 2018 16:59
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9796
Location: The Netherlands
Contact:

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

Post by djim1 »

Hello,

I found the problem...it was a wrong char in de GATEWAY-KEY....an l in stat of I.....but now the following problem.
i recieved de PSK and filled everything in Domoticz hardware. After that I don't see any lamps in devices and the logfile shows this:

Code: Select all

2018-08-14 21:40:26.435 Status: (tradfri) Stop directive received.
2018-08-14 21:40:26.569 Status: (tradfri) Exiting work loop.
2018-08-14 21:40:26.635 Status: (tradfri) Stopping threads.
2018-08-14 21:40:26.635 Status: (tradfri) Stopped.
2018-08-14 21:40:26.635 Status: (tradfri) Started.
2018-08-14 21:40:26.800 Status: (tradfri) Entering work loop.
2018-08-14 21:40:26.800 Status: (tradfri) Initialized version 1.0.6, author 'moroen'
2018-08-14 21:40:46.139 (tradfri) Device has disconnected
2018-08-14 21:40:50.398 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:41:01.119 (tradfri) Device has disconnected
2018-08-14 21:41:06.379 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:41:11.893 Error: PROXY: timeout occurred, reconnecting
2018-08-14 21:41:11.893 Error: PROXY: Connect failed, reconnecting: Network is unreachable
2018-08-14 21:41:17.099 (tradfri) Device has disconnected
2018-08-14 21:41:22.410 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:41:33.080 (tradfri) Device has disconnected
2018-08-14 21:41:38.390 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:41:49.110 (tradfri) Device has disconnected
2018-08-14 21:41:54.420 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:42:05.090 (tradfri) Device has disconnected
2018-08-14 21:42:10.400 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:42:21.071 (tradfri) Device has disconnected
2018-08-14 21:42:26.381 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:42:26.893 Error: PROXY: timeout occurred, reconnecting
2018-08-14 21:42:26.894 Error: PROXY: Connect failed, reconnecting: Network is unreachable
2018-08-14 21:42:37.100 (tradfri) Device has disconnected
2018-08-14 21:42:42.411 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:42:53.081 (tradfri) Device has disconnected
2018-08-14 21:42:58.391 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:43:09.111 (tradfri) Device has disconnected
2018-08-14 21:43:14.421 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:43:25.091 (tradfri) Device has disconnected
2018-08-14 21:43:30.352 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:43:41.073 (tradfri) Device has disconnected
2018-08-14 21:43:41.894 Error: PROXY: timeout occurred, reconnecting
2018-08-14 21:43:41.895 Error: PROXY: Handshake failed, reconnecting: Operation canceled
2018-08-14 21:43:46.384 (tradfri) Connected successfully to: 192.168.0.24
2018-08-14 21:43:57.105 (tradfri) Device has disconnected 

any idea what went wrong?
Philos31
Posts: 33
Joined: Friday 15 August 2014 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Philos31 »

Hi, I am allready busy for 2 days to get this working.
Everything seems ok, but there is something strange going on.
In the domoticz log I see:

Code: Select all

2018-08-21 10:04:21.915 Error: (Tradfri) ----> Line 280 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py, function onMessage
2018-08-21 10:04:21.915 Error: (Tradfri) ----> Line 190 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py, function onMessage
2018-08-21 10:04:22.567 Error: (Tradfri) ----> Line 280 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py, function onMessage
2018-08-21 10:04:22.567 Error: (Tradfri) ----> Line 190 in '/home/pi/domoticz/plugins/IKEA-Tradfri/plugin.py, function onMessage
When I try:

Code: Select all

python3 tradfri.tac
It is stuck when initializing

Code: Select all

IKEA-tradfri COAP-adaptor version 0.6 started (command line)!
Connected from IPv4Address(type='TCP', host='127.0.0.1', port=52704)
Data received: b'{"identity": "domoticz", "gateway": "192.168.1.136", "action": "setConfig", "pollinterval": "30", "groups": "False", "psk": "*****************", "observe": "True"}'
Initializing gateway
And it stays initializing, doing nothing further...
Any idea?
RasPi2/KaKu/HUE/Xiaomi/Z-Wave/Nuki/Daikin 3,5kw Ururu Sarara/IR Heating Panels all working together with domoticz
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest