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

Python and python framework
jackisidore
Posts: 144
Joined: Friday 12 July 2013 15:52
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

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

Post by jackisidore » Sunday 18 March 2018 21:46

I'm trying to install this plugin.
libcoap is working. I get the correct output from
coap-client -m post -u "Client_identity" -k "GATEWAY-KEY" -e '{"9090":"IDENT"}' "coaps://IP:5684/15011/9063"

pytradfri library, plugin (development branch), twisted installed without errors
moved pytradfri to a subfolder of IKEA-Tradfri

Step 6. Enable COAP-adaptor fails:

Code: Select all

sudo python3 tradfri.tac
Traceback (most recent call last):
  File "tradfri.tac", line 2, in <module>
    from twisted.internet import protocol, task, reactor, endpoints
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction
    from twisted.internet.epollreactor import install
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/epollreactor.py", line 24, in <module>
    from twisted.internet import posixbase
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/local/lib/python3.4/dist-packages/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/usr/local/lib/python3.4/dist-packages/twisted/internet/_sslverify.py", line 38, in <module>
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
I can't find the reason. Any help is very welcome

Hann1BaL
Posts: 2
Joined: Sunday 11 March 2018 16:37
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

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

Post by Hann1BaL » Friday 23 March 2018 17:39

Hann1BaL wrote:
Sunday 11 March 2018 16:43

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/etc/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-03-11 15:32:38 CET; 1s ago
  Process: 32183 ExecStart=/usr/bin/twistd --nodaemon --rundir=${IKEA_HOME} --pidfile=${IKEA_HOME}/twistd.pid --python=${IKEA_HOME}/tradfri.ta Main PID: 32183 (code=exited, status=217/USER)

Mar 11 15:32:37 raspberrypi systemd[1]: ikea-tradfri.service: Failed with result 'exit-code'.
Mar 11 15:32:38 raspberrypi systemd[1]: ikea-tradfri.service: Service hold-off time over, scheduling restart.
Mar 11 15:32:38 raspberrypi systemd[1]: Stopped IKEA Tradfri COAP-adapter.
Mar 11 15:32:38 raspberrypi systemd[1]: ikea-tradfri.service: Start request repeated too quickly.
Mar 11 15:32:38 raspberrypi systemd[1]: Failed to start IKEA Tradfri COAP-adapter.
Mar 11 15:32:38 raspberrypi systemd[1]: ikea-tradfri.service: Unit entered failed state.
Mar 11 15:32:38 raspberrypi systemd[1]: ikea-tradfri.service: Failed with result 'exit-code'.
I am trying to install the IKEA tradfri plugin and I believe I managed to get it installed, but every time I run it, it seems to stop itself and I have no real idea how to start troubleshooting this.
Running Domoticz v3.8153 on a rpi2.
Just to bump it up. Does anyone have an idea?

redfirebrooks
Posts: 16
Joined: Sunday 07 January 2018 16:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by redfirebrooks » Wednesday 11 April 2018 21:56

Hello

I need some help please. It looks like I broke somehow my configuration.

I am running Linux domoticz 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

I have this message since few days.

Code: Select all

2018-04-11 21:54:36.301 (IKEA TRADFRI) Initialized version 1.0.6, author 'moroen'
2018-04-11 21:54:36.357 PluginSystem: Starting I/O service thread.
2018-04-11 21:54:36.407 (IKEA TRADFRI) Connected successfully to: 192.168.1.250
2018-04-11 21:54:36.408 Error: (IKEA TRADFRI) 'onMessage' failed 'TypeError':'onMessage() takes 2 positional arguments but 4 were given'.
I tried to reconfigure, uninstall and reinstall the IKEA device but with no positive result.

Finally I managed to resolve this first problem but now I have in loop

Code: Select all

2018-04-11 22:08:06.695 PluginSystem: Starting I/O service thread.
2018-04-11 22:08:06.746 (IKEA TRADFRI) Connected successfully to: 192.168.1.250
2018-04-11 22:08:17.075 PluginSystem: Restarting I/O service thread.
2018-04-11 22:08:17.076 (IKEA TRADFRI) Device has disconnected

Code: Select all

pi@domoticz:~ $ sudo systemctl status ikea-tradfri.service
● ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-04-11 22:07:15 CEST; 1min 24s ago
 Main PID: 349 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           ├─ 349 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-Tradfri/twistd.pi
           └─1100 coap-client -u IKEA01 -k CcXxNL618jx7pqQ7 -v 0 -m get coaps://192.168.1.250:5684/15001

avril 11 22:08:33 domoticz twistd[349]:           File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 275, in initGateway
avril 11 22:08:33 domoticz twistd[349]:             self.devices = self.api(self.api(self.gateway.get_devices()))
avril 11 22:08:33 domoticz twistd[349]:           File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
avril 11 22:08:33 domoticz twistd[349]:             return self._execute(api_commands, timeout=timeout)
avril 11 22:08:33 domoticz twistd[349]:           File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
avril 11 22:08:33 domoticz twistd[349]:             raise RequestTimeout() from None
avril 11 22:08:33 domoticz twistd[349]:         pytradfri.error.RequestTimeout:
avril 11 22:08:33 domoticz twistd[349]:         
avril 11 22:08:33 domoticz twistd[349]: 2018-04-11T22:08:33+0200 [stdout#info] Disconnected
avril 11 22:08:38 domoticz twistd[349]: 2018-04-11T22:08:38+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 45590)

redfirebrooks
Posts: 16
Joined: Sunday 07 January 2018 16:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by redfirebrooks » Friday 13 April 2018 20:14

I found a solution, I simple changed the IDENT name at the stage "Create identity and pre-shared-key".
So I wonder if it is possible to delete all previous IDENT created ?

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Saturday 14 April 2018 20:05

redfirebrooks wrote:
Friday 13 April 2018 20:14
I found a solution, I simple changed the IDENT name at the stage "Create identity and pre-shared-key".
So I wonder if it is possible to delete all previous IDENT created ?
As far as I know, no. I've read somewhere that there might be a limit on the number of idents possible, and when this limit is reached, the oldest might be wiped, but I don't have first hand experience on this. A factory reset will wipe all the idents, but along with all the lights...

I generally recommend to try running the adapter from the command-line when something fails, debugging while running as a systemd-service generally sucks... Get it to work from the command line first, then as a service...

Development has been stalled for a while, but I'm making slow progress on an adapter written in go, hopefully a alpha version is not to far away...

Regards,
M

echeberri77
Posts: 36
Joined: Friday 09 March 2018 19:52
Target OS: Linux
Domoticz version: 3.9203
Location: Italy
Contact:

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

Post by echeberri77 » Tuesday 17 April 2018 7:55

Hello!
I am trying to perform docker installation but I am stuck on this point:

Code: Select all

Copy the docker image to the system running Domoticz and start the Docker instance:

docker run -t -p 127.0.0.1:1234:1234 ikea-tradfri-plugin:1234
I get this output:

Code: Select all

Xavier-PC IKEA-Tradfri # docker run -t -p 192.168.1.2:1234:1234 ikea-tradfri-plugin:1234
Unable to find image 'ikea-tradfri-plugin:1234' locally
docker: Error response from daemon: repository ikea-tradfri-plugin not found: does not exist or no pull access.
See 'docker run --help'.
What's wrong?

This is the docker build part:

Code: Select all

docker build -t ikea-tradfri-plugin:latest .
Sending build context to Docker daemon 46.59 kB
Step 1/18 : FROM debian:latest
 ---> 2b98c9851a37
Step 2/18 : RUN apt-get update -y &&   apt-get install -y python3 python3-pip git autoconf automake libtool &&   apt-get clean &&   rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* build/
 ---> Using cache
 ---> 7a13f64e1a5e
Step 3/18 : RUN mkdir -p /usr/src/app /usr/src/build
 ---> Using cache
 ---> 7eebdc8f9f30
Step 4/18 : WORKDIR /usr/src/build
 ---> Using cache
 ---> d90fc539847b
Step 5/18 : RUN python3 -m pip install cython
 ---> Using cache
 ---> ca6da61570cc
Step 6/18 : RUN python3 -m pip install ipython
 ---> Using cache
 ---> 3c20980a965f
Step 7/18 : RUN git clone https://github.com/ggravlingen/pytradfri.git
 ---> Using cache
 ---> 3591e18c3aed
Step 8/18 : WORKDIR /usr/src/build/pytradfri
 ---> Using cache
 ---> 8e8a21e57d58
Step 9/18 : RUN git checkout tags/2.2.3
 ---> Using cache
 ---> beb620ec0a48
Step 10/18 : WORKDIR /usr/src/build/pytradfri/script
 ---> Using cache
 ---> 763c24abba11
Step 11/18 : RUN ./install-coap-client.sh
 ---> Using cache
 ---> fd076514da56
Step 12/18 : WORKDIR /usr/src/build/pytradfri
 ---> Using cache
 ---> 0a1ecd2ec128
Step 13/18 : RUN python3 setup.py install
 ---> Using cache
 ---> b379524f27d4
Step 14/18 : RUN pip3 install twisted
 ---> Using cache
 ---> 75c084f7900a
Step 15/18 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 950f17707ed0
Step 16/18 : COPY tradfri.tac /usr/src/app
 ---> Using cache
 ---> 3cee13170166
Step 17/18 : EXPOSE 1234
 ---> Using cache
 ---> aac02ab9a2f3
Step 18/18 : CMD python3 tradfri.tac
 ---> Using cache
 ---> 34b06bb94d19
Successfully built 34b06bb94d19
Thanks!

Xavier

echeberri77
Posts: 36
Joined: Friday 09 March 2018 19:52
Target OS: Linux
Domoticz version: 3.9203
Location: Italy
Contact:

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

Post by echeberri77 » Tuesday 17 April 2018 9:26

Finally I decided compilyng it in local.
After lauching the client I have this:

Code: Select all

Xavier-PC plugins # coap-client -m post -u "Client_identity" -k "1234567" -e '{"9090":"Camera da letto"}' "coaps://192.168.1.55:5684/15011/9063"
Apr 17 09:25:07 EMRG coaps URI scheme not supported in this version of libcoap
(I used a dummy code just to see the output...).

Maybe the problem is into the libcoap version? Which version is supported?

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Tuesday 17 April 2018 18:37

echeberri77 wrote:
Tuesday 17 April 2018 9:26
Finally I decided compilyng it in local.
After lauching the client I have this:

Code: Select all

Xavier-PC plugins # coap-client -m post -u "Client_identity" -k "1234567" -e '{"9090":"Camera da letto"}' "coaps://192.168.1.55:5684/15011/9063"
Apr 17 09:25:07 EMRG coaps URI scheme not supported in this version of libcoap
(I used a dummy code just to see the output...).

Maybe the problem is into the libcoap version? Which version is supported?
You need to install the libcoap-version used in Home Assistant, as referenced in the install instructions for pytradfri:
(https://github.com/ggravlingen/pytradfr ... -client.sh)

That version should work. I've never been able to make the official libcoap work with pytradfri...

Regards,
M

echeberri77
Posts: 36
Joined: Friday 09 March 2018 19:52
Target OS: Linux
Domoticz version: 3.9203
Location: Italy
Contact:

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

Post by echeberri77 » Saturday 21 April 2018 16:20

moroen wrote:
Tuesday 17 April 2018 18:37
echeberri77 wrote:
Tuesday 17 April 2018 9:26
Finally I decided compilyng it in local.
After lauching the client I have this:

Code: Select all

Xavier-PC plugins # coap-client -m post -u "Client_identity" -k "1234567" -e '{"9090":"Camera da letto"}' "coaps://192.168.1.55:5684/15011/9063"
Apr 17 09:25:07 EMRG coaps URI scheme not supported in this version of libcoap
(I used a dummy code just to see the output...).

Maybe the problem is into the libcoap version? Which version is supported?
You need to install the libcoap-version used in Home Assistant, as referenced in the install instructions for pytradfri:
(https://github.com/ggravlingen/pytradfr ... -client.sh)

That version should work. I've never been able to make the official libcoap work with pytradfri...

Regards,
M
Hi Moroen,
using the libcoap version used in domoticz, now I have this output (Ip address is dummy and Tradfri ID is dummy too...)

Code: Select all

v:1 t:CON c:POST i:906b {} [ ]
Is this what I should expect to see?

Thanks!!!

Xavier

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Saturday 21 April 2018 21:02

echeberri77 wrote:
Saturday 21 April 2018 16:20
moroen wrote:
Tuesday 17 April 2018 18:37
echeberri77 wrote:
Tuesday 17 April 2018 9:26
Finally I decided compilyng it in local.
After lauching the client I have this:

Code: Select all

Xavier-PC plugins # coap-client -m post -u "Client_identity" -k "1234567" -e '{"9090":"Camera da letto"}' "coaps://192.168.1.55:5684/15011/9063"
Apr 17 09:25:07 EMRG coaps URI scheme not supported in this version of libcoap
(I used a dummy code just to see the output...).

Maybe the problem is into the libcoap version? Which version is supported?
You need to install the libcoap-version used in Home Assistant, as referenced in the install instructions for pytradfri:
(https://github.com/ggravlingen/pytradfr ... -client.sh)

That version should work. I've never been able to make the official libcoap work with pytradfri...

Regards,
M
Hi Moroen,
using the libcoap version used in domoticz, now I have this output (Ip address is dummy and Tradfri ID is dummy too...)

Code: Select all

v:1 t:CON c:POST i:906b {} [ ]
Is this what I should expect to see?

Thanks!!!

Xavier
No, you should get a key for the ident. If memory serves me right, the reply you got, indicates that the ident/psk-pair already has been created. I've not found a way to regenerate a key for a previously used ident. Try another ident, and see what happens. The correct response will be something like this:

Code: Select all

v:1 t:CON c:POST i:0ee2 {} [ ]
{"9091":"XXXXXXXXXXXXX","9029":"1.3.0014"}
Regards,
M

echeberri77
Posts: 36
Joined: Friday 09 March 2018 19:52
Target OS: Linux
Domoticz version: 3.9203
Location: Italy
Contact:

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

Post by echeberri77 » Saturday 21 April 2018 23:37

The IDENT I am using is a fake one because I don't have a Tradfri Gateway yet.
Maybe I launched the client some days ago and the udent was created...
I have to try it when I get the device!

Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Mario » Thursday 10 May 2018 21:32

Dear Moroen,

Been at it for almost 2 weeks now and still can't get the lights to work. Tried every suggestion posted on this forum but nothing helps.I am at the end of things now. Hope you can helpme point in the right direction.

When I install like you write, I come to the "/opt/domoticz/plugins/IKEA-Tradfri$ python3 tradfri.tac"" part. As result I get the following:

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

And then nothing happens. What's wrong?

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Friday 11 May 2018 15:25

Mario wrote:
Thursday 10 May 2018 21:32
Dear Moroen,

Been at it for almost 2 weeks now and still can't get the lights to work. Tried every suggestion posted on this forum but nothing helps.I am at the end of things now. Hope you can helpme point in the right direction.

When I install like you write, I come to the "/opt/domoticz/plugins/IKEA-Tradfri$ python3 tradfri.tac"" part. As result I get the following:

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

And then nothing happens. What's wrong?
Well, it appears that the adapter starts like it should. What happens when you try to add the plugin to Domoticz? Could you please provide the domoticz log? Which version of domoticz are you using, stable or beta? And which branch of the plugin, master or development?

Regards,
M

Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Mario » Monday 14 May 2018 14:43

This is the Domoticz log:

2018-05-14 14:41:15.049 Domoticz V3.9439 (c)2012-2018 GizMoCuz
2018-05-14 14:41:15.049 Build Hash: a6a160a8, Date: 2018-05-14 09:01:03
2018-05-14 14:41:15.050 Startup Path: /home/pi/domoticz/
2018-05-14 14:41:15.304 Sunrise: 05:45:00 SunSet: 21:26:00
2018-05-14 14:41:15.305 Day length: 15:41:00 Sun at south: 13:05:00
2018-05-14 14:41:15.305 Civil twilight start: 05:02:00 Civil twilight end: 22:08:00
2018-05-14 14:41:15.305 Nautical twilight start: 04:04:00 Nautical twilight end: 23:07:00
2018-05-14 14:41:15.305 Astronomical twilight start: 02:29:00 Astronomical twilight end: 00:41:00
2018-05-14 14:41:15.305 EventSystem: reset all events...
2018-05-14 14:41:15.337 Active notification Subsystems: (0/14)
2018-05-14 14:41:15.360 WebServer(HTTP) started on address: :: with port 8080
2018-05-14 14:41:15.389 WebServer(SSL) started on address: :: with port 443
2018-05-14 14:41:15.391 Proxymanager started.
2018-05-14 14:41:15.392 Camera: settings (re)loaded
2018-05-14 14:41:15.393 Starting shared server on: :::6144
2018-05-14 14:41:15.394 TCPServer: shared server started...
2018-05-14 14:41:15.394 RxQueue: queue worker started...
2018-05-14 14:41:17.399 ToonThermostat: Worker started...
2018-05-14 14:41:17.399 Wunderground: Worker started...
2018-05-14 14:41:31.983 (TOON) Thermostat (Toon instelling)
2018-05-14 14:41:31.984 (TOON) Temp (Kamer temperatuur)
2018-05-14 14:41:31.985 (TOON) P1 Smart Meter (Stroom)
2018-05-14 14:41:31.986 (TOON) P1 Smart Meter (Gas)
2018-05-14 14:41:33.896 (Weerstation) Temp + Humidity + Baro (Weer)
2018-05-14 14:41:33.897 (Weerstation) Wind (Wind)
2018-05-14 14:41:33.898 (Weerstation) Rain (Unknown)
2018-05-14 14:41:33.899 (Weerstation) General/Visibility (Unknown)

I have V3.9439 of Domoticz up and running, the plugin I used is your's from Github.

I have started all over from the beginning and now I get a problem making the PSK. this is the message I get:

coap-client -m post -u "Client_identity" -k "GATEWAY-KEY" -e '{"9090":"IDENT"}' "coaps://IP:5684/15011/9063"
-bash: coap-client: command not found
(I filled in the IP and Gateway key afcourse)

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Monday 14 May 2018 20:35

Mario wrote:
Monday 14 May 2018 14:43
This is the Domoticz log:

2018-05-14 14:41:15.049 Domoticz V3.9439 (c)2012-2018 GizMoCuz
2018-05-14 14:41:15.049 Build Hash: a6a160a8, Date: 2018-05-14 09:01:03
2018-05-14 14:41:15.050 Startup Path: /home/pi/domoticz/
2018-05-14 14:41:15.304 Sunrise: 05:45:00 SunSet: 21:26:00
2018-05-14 14:41:15.305 Day length: 15:41:00 Sun at south: 13:05:00
2018-05-14 14:41:15.305 Civil twilight start: 05:02:00 Civil twilight end: 22:08:00
2018-05-14 14:41:15.305 Nautical twilight start: 04:04:00 Nautical twilight end: 23:07:00
2018-05-14 14:41:15.305 Astronomical twilight start: 02:29:00 Astronomical twilight end: 00:41:00
2018-05-14 14:41:15.305 EventSystem: reset all events...
2018-05-14 14:41:15.337 Active notification Subsystems: (0/14)
2018-05-14 14:41:15.360 WebServer(HTTP) started on address: :: with port 8080
2018-05-14 14:41:15.389 WebServer(SSL) started on address: :: with port 443
2018-05-14 14:41:15.391 Proxymanager started.
2018-05-14 14:41:15.392 Camera: settings (re)loaded
2018-05-14 14:41:15.393 Starting shared server on: :::6144
2018-05-14 14:41:15.394 TCPServer: shared server started...
2018-05-14 14:41:15.394 RxQueue: queue worker started...
2018-05-14 14:41:17.399 ToonThermostat: Worker started...
2018-05-14 14:41:17.399 Wunderground: Worker started...
2018-05-14 14:41:31.983 (TOON) Thermostat (Toon instelling)
2018-05-14 14:41:31.984 (TOON) Temp (Kamer temperatuur)
2018-05-14 14:41:31.985 (TOON) P1 Smart Meter (Stroom)
2018-05-14 14:41:31.986 (TOON) P1 Smart Meter (Gas)
2018-05-14 14:41:33.896 (Weerstation) Temp + Humidity + Baro (Weer)
2018-05-14 14:41:33.897 (Weerstation) Wind (Wind)
2018-05-14 14:41:33.898 (Weerstation) Rain (Unknown)
2018-05-14 14:41:33.899 (Weerstation) General/Visibility (Unknown)

I have V3.9439 of Domoticz up and running, the plugin I used is your's from Github.

I have started all over from the beginning and now I get a problem making the PSK. this is the message I get:

coap-client -m post -u "Client_identity" -k "GATEWAY-KEY" -e '{"9090":"IDENT"}' "coaps://IP:5684/15011/9063"
-bash: coap-client: command not found
(I filled in the IP and Gateway key afcourse)
First, from your log, the python plugin-system doesn't seem to start, you should se something along this line rather early in the log:

Code: Select all

2018-05-14 20:30:42.615  PluginSystem: Started, Python version '3.6.5'.
Second, it appears you are missing the coap-client? Have you tried to install it using the instructions from pytradfri? You'll find the instructions at: https://github.com/ggravlingen/pytradfr ... -client.sh

Let me know how it works out!

Regards,
M

Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Mario » Monday 14 May 2018 20:42

moroen wrote:
Monday 14 May 2018 20:35
Mario wrote:
Monday 14 May 2018 14:43
This is the Domoticz log:

2018-05-14 14:41:15.049 Domoticz V3.9439 (c)2012-2018 GizMoCuz
2018-05-14 14:41:15.049 Build Hash: a6a160a8, Date: 2018-05-14 09:01:03
2018-05-14 14:41:15.050 Startup Path: /home/pi/domoticz/
2018-05-14 14:41:15.304 Sunrise: 05:45:00 SunSet: 21:26:00
2018-05-14 14:41:15.305 Day length: 15:41:00 Sun at south: 13:05:00
2018-05-14 14:41:15.305 Civil twilight start: 05:02:00 Civil twilight end: 22:08:00
2018-05-14 14:41:15.305 Nautical twilight start: 04:04:00 Nautical twilight end: 23:07:00
2018-05-14 14:41:15.305 Astronomical twilight start: 02:29:00 Astronomical twilight end: 00:41:00
2018-05-14 14:41:15.305 EventSystem: reset all events...
2018-05-14 14:41:15.337 Active notification Subsystems: (0/14)
2018-05-14 14:41:15.360 WebServer(HTTP) started on address: :: with port 8080
2018-05-14 14:41:15.389 WebServer(SSL) started on address: :: with port 443
2018-05-14 14:41:15.391 Proxymanager started.
2018-05-14 14:41:15.392 Camera: settings (re)loaded
2018-05-14 14:41:15.393 Starting shared server on: :::6144
2018-05-14 14:41:15.394 TCPServer: shared server started...
2018-05-14 14:41:15.394 RxQueue: queue worker started...
2018-05-14 14:41:17.399 ToonThermostat: Worker started...
2018-05-14 14:41:17.399 Wunderground: Worker started...
2018-05-14 14:41:31.983 (TOON) Thermostat (Toon instelling)
2018-05-14 14:41:31.984 (TOON) Temp (Kamer temperatuur)
2018-05-14 14:41:31.985 (TOON) P1 Smart Meter (Stroom)
2018-05-14 14:41:31.986 (TOON) P1 Smart Meter (Gas)
2018-05-14 14:41:33.896 (Weerstation) Temp + Humidity + Baro (Weer)
2018-05-14 14:41:33.897 (Weerstation) Wind (Wind)
2018-05-14 14:41:33.898 (Weerstation) Rain (Unknown)
2018-05-14 14:41:33.899 (Weerstation) General/Visibility (Unknown)

I have V3.9439 of Domoticz up and running, the plugin I used is your's from Github.

I have started all over from the beginning and now I get a problem making the PSK. this is the message I get:

coap-client -m post -u "Client_identity" -k "GATEWAY-KEY" -e '{"9090":"IDENT"}' "coaps://IP:5684/15011/9063"
-bash: coap-client: command not found
(I filled in the IP and Gateway key afcourse)
First, from your log, the python plugin-system doesn't seem to start, you should se something along this line rather early in the log:

Code: Select all

2018-05-14 20:30:42.615  PluginSystem: Started, Python version '3.6.5'.
Second, it appears you are missing the coap-client? Have you tried to install it using the instructions from pytradfri? You'll find the instructions at: https://github.com/ggravlingen/pytradfr ... -client.sh

Let me know how it works out!

Regards,
M
Hi,

I reinstalled the cap client and when coming to the part " make " I get some errors at the end. See attached Log.

pi@raspberrypi:~/libcoap $ make
make all-recursive
make[1]: Entering directory '/home/pi/libcoap'
Making all in ext/tinydtls
make[2]: Entering directory '/home/pi/libcoap/ext/tinydtls'
make -C aes rijndael.o
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/aes'
make[3]: 'rijndael.o' is up to date.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/aes'
make -C ecc ecc.o
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/ecc'
make[3]: 'ecc.o' is up to date.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/ecc'
make -C sha2 sha2.o
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/sha2'
make[3]: 'sha2.o' is up to date.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/sha2'
make -C doc
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/doc'
: Doxyfile >./doxygen.out 2>&1
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/doc'
for dir in tests doc platform-specific sha2 aes ecc; do \
make -C $dir ; \
done
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/tests'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/tests'
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/doc'
: Doxyfile >./doxygen.out 2>&1
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/doc'
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/platform-specific'
make[3]: Nothing to be done for 'clean'.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/platform-specific'
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/sha2'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/sha2'
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/aes'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/aes'
make[3]: Entering directory '/home/pi/libcoap/ext/tinydtls/ecc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/libcoap/ext/tinydtls/ecc'
make[2]: Leaving directory '/home/pi/libcoap/ext/tinydtls'
Making all in .
make[2]: Entering directory '/home/pi/libcoap'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I ./ext/tinydtls -fPIC -fPIE -I ./include/coap/ -pedantic -Wall -Wextra -Wformat-security -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wunused -Wunused-result -Wlogical-op -std=c99 -D COAP_DEBUG_FD=stderr -fdiagnostics-color -D_GNU_SOURCE -DWITH_POSIX -MT src/libcoap_1_la-address.lo -MD -MP -MF src/.deps/libcoap_1_la-address.Tpo -c -o src/libcoap_1_la-address.lo `test -f 'src/address.c' || echo './'`src/address.c
./libtool: ./libtool: is a directory
Makefile:734: recipe for target 'src/libcoap_1_la-address.lo' failed
make[2]: *** [src/libcoap_1_la-address.lo] Error 126
make[2]: Leaving directory '/home/pi/libcoap'
Makefile:940: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/libcoap'
Makefile:526: recipe for target 'all' failed
make: *** [all] Error 2
pi@raspberrypi:~/libcoap $ make install
Making install in ext/tinydtls
make[1]: Entering directory '/home/pi/libcoap/ext/tinydtls'
make -C aes rijndael.o
make[2]: Entering directory '/home/pi/libcoap/ext/tinydtls/aes'
make[2]: 'rijndael.o' is up to date.
make[2]: Leaving directory '/home/pi/libcoap/ext/tinydtls/aes'
make -C ecc ecc.o
make[2]: Entering directory '/home/pi/libcoap/ext/tinydtls/ecc'
make[2]: 'ecc.o' is up to date.
make[2]: Leaving directory '/home/pi/libcoap/ext/tinydtls/ecc'
make -C sha2 sha2.o
make[2]: Entering directory '/home/pi/libcoap/ext/tinydtls/sha2'
make[2]: 'sha2.o' is up to date.
make[2]: Leaving directory '/home/pi/libcoap/ext/tinydtls/sha2'
make -C doc
make[2]: Entering directory '/home/pi/libcoap/ext/tinydtls/doc'
: Doxyfile >./doxygen.out 2>&1
make[2]: Leaving directory '/home/pi/libcoap/ext/tinydtls/doc'
test -d /usr/local/lib || mkdir -p /usr/local/lib
test -d /usr/local/include/tinydtls || mkdir -p /usr/local/include/tinydtls
mkdir: cannot create directory ‘/usr/local/include/tinydtls’: Permission denied
Makefile:107: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/pi/libcoap/ext/tinydtls'
Makefile:940: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
pi@raspberrypi:~/libcoap $

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Monday 14 May 2018 20:53

Mario wrote:
Monday 14 May 2018 20:42
test -d /usr/local/include/tinydtls || mkdir -p /usr/local/include/tinydtls
mkdir: cannot create directory ‘/usr/local/include/tinydtls’: Permission denied
Makefile:107: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/pi/libcoap/ext/tinydtls'
Makefile:940: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
pi@raspberrypi:~/libcoap $
You need to make sure that you can write to /usr/local/* (or to try the quick-fix, run make install using sudo)

Regards,
M

Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Mario » Monday 14 May 2018 22:49

moroen wrote:
Monday 14 May 2018 20:53
Mario wrote:
Monday 14 May 2018 20:42
test -d /usr/local/include/tinydtls || mkdir -p /usr/local/include/tinydtls
mkdir: cannot create directory ‘/usr/local/include/tinydtls’: Permission denied
Makefile:107: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/pi/libcoap/ext/tinydtls'
Makefile:940: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
pi@raspberrypi:~/libcoap $
You need to make sure that you can write to /usr/local/* (or to try the quick-fix, run make install using sudo)

Regards,
M
I am back. I got above problem fixed but I cannot get Python get to start in Domoticz. (python3: can't open file 'tradfri.tac': [Errno 2] No such file or directory)

2018-05-14 22:43:37.101 Domoticz V3.9439 (c)2012-2018 GizMoCuz
2018-05-14 22:43:37.101 Build Hash: a6a160a8, Date: 2018-05-14 09:01:03
2018-05-14 22:43:37.101 Startup Path: /home/pi/domoticz/
2018-05-14 22:43:37.272 EventSystem: reset all events...
2018-05-14 22:43:37.314 WebServer(HTTP) started on address: :: with port 8080
2018-05-14 22:43:37.340 WebServer(SSL) started on address: :: with port 443
2018-05-14 22:43:37.342 Proxymanager started.
2018-05-14 22:43:37.343 Camera: settings (re)loaded
2018-05-14 22:43:37.344 TCPServer: shared server started...
2018-05-14 22:43:37.345 RxQueue: queue worker started...
2018-05-14 22:43:39.347 ToonThermostat: Worker started...
2018-05-14 22:43:39.347 Wunderground: Worker started...

I am lost :-(

moroen
Posts: 165
Joined: Sunday 15 January 2017 12:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

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

Post by moroen » Monday 14 May 2018 23:47

Mario wrote:
Monday 14 May 2018 22:49
moroen wrote:
Monday 14 May 2018 20:53
Mario wrote:
Monday 14 May 2018 20:42
test -d /usr/local/include/tinydtls || mkdir -p /usr/local/include/tinydtls
mkdir: cannot create directory ‘/usr/local/include/tinydtls’: Permission denied
Makefile:107: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/pi/libcoap/ext/tinydtls'
Makefile:940: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
pi@raspberrypi:~/libcoap $
You need to make sure that you can write to /usr/local/* (or to try the quick-fix, run make install using sudo)

Regards,
M
I am back. I got above problem fixed but I cannot get Python get to start in Domoticz. (python3: can't open file 'tradfri.tac': [Errno 2] No such file or directory)

2018-05-14 22:43:37.101 Domoticz V3.9439 (c)2012-2018 GizMoCuz
2018-05-14 22:43:37.101 Build Hash: a6a160a8, Date: 2018-05-14 09:01:03
2018-05-14 22:43:37.101 Startup Path: /home/pi/domoticz/
2018-05-14 22:43:37.272 EventSystem: reset all events...
2018-05-14 22:43:37.314 WebServer(HTTP) started on address: :: with port 8080
2018-05-14 22:43:37.340 WebServer(SSL) started on address: :: with port 443
2018-05-14 22:43:37.342 Proxymanager started.
2018-05-14 22:43:37.343 Camera: settings (re)loaded
2018-05-14 22:43:37.344 TCPServer: shared server started...
2018-05-14 22:43:37.345 RxQueue: queue worker started...
2018-05-14 22:43:39.347 ToonThermostat: Worker started...
2018-05-14 22:43:39.347 Wunderground: Worker started...

I am lost :-(
The plugin is in to parts, one is the adapter (tradfri.tac), running outside of domoticz, and the plugin.py part, running as part of the python plugin framework. I still think you two problems.

The first, and major, problem is a lack of support for python plugins. Are you compiling domoticz from source or using prebuild binaries? You need to compile the domoticz development-branch from source (at least I think this is still needed) in order to enable python plugins from domoticz. Then copy the development-branch of the plugin to the plugin directory.


When Pyhon plugins are enabled and you have added the IKEA Tradfri plugin to domoticz, you should see something like:

Code: Select all

2018-05-14 23:41:55.398  (IKEA) Started.
2018-05-14 23:41:55.516  (IKEA) Entering work loop.
2018-05-14 23:41:55.517  (IKEA) Initialized version 1.0.6, author 'moroen'
2018-05-14 23:41:55.568  (IKEA) Failed to connect to IKEA tradfri COAP-adapter! Status: 61 Description: Connection refused
2018-05-14 23:41:55.569  (IKEA) Device has disconnected
Then get the adapter running. Enter the IKEA-plugin directory and try running the adapter from the command-line:

Code: Select all

$ python3 tradfri.tac
Hopefully the plugin will be able to connect to the adapter, if not, post the output from the python3 command, and we'll take it from there... :)

Regards,
M

Mario
Posts: 16
Joined: Tuesday 08 May 2018 20:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Mario » Tuesday 15 May 2018 10:56

Hi again,

Reinstalled Domoticz as suggested. When in Ikea subfolder using the python command I get the following.
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri $ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.6 started (command line)!

Don't see anything happening in Domoticz. What did I forget or didn't do? I assume something wrong with the plugins, but how can I get them right? I think something wrong with Python.

Anyway, thanks for your patience with me ;-)

Hi M, Playing around a bit and when using the commandline I notice my gateway can be accest. Maybe this helps figuring out what is going wrong. (See below)
Spoiler: show
i@raspberrypi:~ $ python3 -i -m pytradfri IP ADRESS
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
Please provide the 'Security Code' on the back of your Tradfri gateway: XXXXXXXXXXXXXX
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 post ['15011', '9063']: {'9090': '19ef5b3027654fdb8dc579feecf78479'}
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"gWfDNiX2Ay3yqBtD","9029":"1.3.0014"}
Generated PSK: gWfDNiX2Ay3yqBtD
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65567,65558,65552,65562,65563,65564,65551,65566,65559,65560,65541,65537,65561,65565,65540]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65567]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"Afstandsbediening huiskamer","9002":1520373674,"9020":1526429789,"9003":65567,"5750":0,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI remote control","3":"1.2.214","6":3,"9":34},"15009":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65558]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"Afstandsbediening keuken","9002":1520373324,"9020":1526426752,"9003":65558,"5750":0,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI remote control","3":"1.2.214","6":3,"9":60},"15009":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65552]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"eettafel","9002":1520090428,"3311":[{"5850":0,"5851":12,"5717":0,"5711":454,"5709":33137,"5710":27211,"9003":0,"5706":"efd275"}],"9020":1526417017,"9003":65552,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS clear 950lm","3":"1.2.217","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65562]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"keuken","9002":1520373478,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424333,"9003":65562,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65563]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"keuken","9002":1520373514,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424290,"9003":65563,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65564]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"keuken","9002":1520373548,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424288,"9003":65564,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65551]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"eettafel","9002":1520090387,"3311":[{"5850":0,"5851":12,"5717":0,"5711":454,"5709":33137,"5710":27211,"9003":0,"5706":"efd275"}],"9020":1526417048,"9003":65551,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS clear 950lm","3":"1.2.217","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65566]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"keuken","9002":1520373617,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424307,"9003":65566,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65559]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"bar","9002":1520373379,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424253,"9003":65559,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65560]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"bar","9002":1520373411,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424367,"9003":65560,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65541]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"tv lamp links","9002":1518985231,"3311":[{"5850":0,"5851":12,"5717":0,"5711":454,"5709":32977,"5710":27105,"9003":0,"5706":"efd275"}],"9020":1526407177,"9003":65541,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","3":"1.2.217","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65537]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"dekenkist","9002":1518985116,"3311":[{"5850":0,"5851":12,"5717":0,"5711":450,"5709":32886,"5710":27217,"9003":0,"5706":"efd275"}],"9020":1526457082,"9003":65537,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","3":"1.2.217","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65561]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"bar","9002":1520373443,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424275,"9003":65561,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65565]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"keuken","9002":1520373582,"3311":[{"5850":0,"5851":12,"9003":0}],"9020":1526424278,"9003":65565,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","3":"1.2.214","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15001', 65540]
DEBUG:pytradfri.api.libcoap_api:Received: {"9054":0,"9001":"tv lamp recht","9002":1518985206,"3311":[{"5850":0,"5851":12,"5717":0,"5711":454,"5709":32977,"5710":27105,"9003":0,"5706":"efd275"}],"9020":1526440111,"9003":65540,"5750":2,"9019":1,"3":{"2":"","0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","3":"1.2.217","6":1}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [131073,131079]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15005', <pytradfri.command.Command object at 0x765cb250>]
DEBUG:pytradfri.api.libcoap_api:Received: [131073,131079]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: []
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.178.185 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9023":"2.tradfri.pool.ntp.org","9060":"2018-05-16T11:54:44.002856Z","9059":1526471684,"9062":0,"9061":0,"9029":"1.3.14","9081":"7e1b715204400062","9106":1,"9066":5,"9082":true,"9083":"748-85-399","9105":1,"9072":5,"9054":0,"9055":0,"9069":1518984491,"9071":2,"9078":1,"9077":28,"9073":14,"9074":20,"9080":60,"9075":49,"9076":10,"9093":0,"9079":0,"9092":1}

Example commands:
> devices
> homekit_id
> light.light_control.lights
> api(light.light_control.set_dimmer(10))
> api(light.light_control.set_dimmer(254))
> api(light.light_control.set_xy_color(254))
> api(lights[1].light_control.set_dimmer(20))
> tasks[0].repeat_days_list
> api(gateway.reboot())
> groups
> moods
> tasks
> dump_devices()
> dump_all()
>>> lights
[<65552 - eettafel (TRADFRI bulb E27 WS clear 950lm)>, <65562 - keuken (TRADFRI bulb GU10 W 400lm)>, <65563 - keuken (TRADFRI bulb GU10 W 400lm)>, <65564 - keuken (TRADFRI bulb GU10 W 400lm)>, <65551 - eettafel (TRADFRI bulb E27 WS clear 950lm)>, <65566 - keuken (TRADFRI bulb GU10 W 400lm)>, <65559 - bar (TRADFRI bulb GU10 W 400lm)>, <65560 - bar (TRADFRI bulb GU10 W 400lm)>, <65541 - tv lamp links (TRADFRI bulb E14 WS opal 400lm)>, <65537 - dekenkist (TRADFRI bulb E14 WS opal 400lm)>, <65561 - bar (TRADFRI bulb GU10 W 400lm)>, <65565 - keuken (TRADFRI bulb GU10 W 400lm)>, <65540 - tv lamp recht (TRADFRI bulb E14 WS opal 400lm)>]
>>>
Last edited by Mario on Thursday 24 May 2018 22:31, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: alanlsmith and 3 guests