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

Python and python framework

Moderator: leecollings

APDK66
Posts: 4
Joined: Monday 14 May 2018 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by APDK66 »

Hi,

I have the tradfri plugin running on my raspberry pi, for this I want to thank the ones who made this possible. :P
Now I was setting up my color light bulbs and that works fine with the color picker (for all 21 color settings) and for the intensity.
With placing the color bulps in a group the color picker works only of the percentages 0-100, settings above (110-200) the color stays on “lime”. :?:
Am I doing something wrong here?
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 »

APDK66 wrote: Saturday 19 May 2018 20:12 Hi,

I have the tradfri plugin running on my raspberry pi, for this I want to thank the ones who made this possible. :P
Now I was setting up my color light bulbs and that works fine with the color picker (for all 21 color settings) and for the intensity.
With placing the color bulps in a group the color picker works only of the percentages 0-100, settings above (110-200) the color stays on “lime”. :?:
Am I doing something wrong here?
No, your running up against a limitation in Domoticz, as the color picker supports levels as absolutes (integer value) and as a group only as a percentage. I haven't actually though much about using the color picker in groups/scenes, I'll look into it, but have no immediate solution...

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 »

Mario wrote: 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)>]
>>>
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 24 May 2018 22:58
Mario wrote: 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)>]
>>>
It would appear that the pure python side of things are working, the pytradfri library clearly works and the adapter appears to work as well. So the problem probably still remains on the domoticz side of things. Have you been able to get any other python plugins to appear/start 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,

I am a big step further, only to get me a new and fresh error message:

(IKEA) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.

What now? I am wondering if I ever get it to work :-(

Kind 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: Sunday 27 May 2018 22:37 Dear M,

I am a big step further, only to get me a new and fresh error message:

(IKEA) 'onMessage' failed 'TypeError':'onMessage() missing 2 required positional arguments: 'Status' and 'Extra''.

What now? I am wondering if I ever get it to work :-(

Kind regards,

M
You're getting closer, just need to switch to the development branch of the plugin. In the IKEA-plugin directory:

Code: Select all

domoticz/plugins/IKEA-Tradfri$ git checkout development
domoticz/plugins/IKEA-Tradfri$ git pull
and restart domoticz, and hopefully it should work!

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 »

And again a new problem.

Domoticz Log :

2018-05-27 23:42:09.511 (IKEA) Connected successfully to: 192.168.178.185
2018-05-27 23:42:20.080 PluginSystem: Restarting I/O service thread.
2018-05-27 23:42:20.081 (IKEA) Device has disconnected

Terminal log:

Connected from IPv4Address(TCP, '127.0.0.1', 38502)
Data received: b'{"psk": "XXXXXXXXXXX", "gateway": "XXXXXXXXXXX", "groups": "False", "identity": "DOMOTICZ", "observe": "True", "action": "setConfig", "pollinterval": "30"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 211, 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 "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
return self._execute(api_commands, timeout=timeout)
File "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout:
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 27 May 2018 23:44 And again a new problem.

Domoticz Log :

2018-05-27 23:42:09.511 (IKEA) Connected successfully to: 192.168.178.185
2018-05-27 23:42:20.080 PluginSystem: Restarting I/O service thread.
2018-05-27 23:42:20.081 (IKEA) Device has disconnected

Terminal log:

Connected from IPv4Address(TCP, '127.0.0.1', 38502)
Data received: b'{"psk": "XXXXXXXXXXX", "gateway": "XXXXXXXXXXX", "groups": "False", "identity": "DOMOTICZ", "observe": "True", "action": "setConfig", "pollinterval": "30"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 211, 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 "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
return self._execute(api_commands, timeout=timeout)
File "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout:
The coax-client can't connect to the IKEA gateway and times out. Check to see if IP, ident and KEY are correct?

Regards,
M
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

Hi,

I have just done all the steps to install the IKEA-Tradfri plugin into domoticz, te last step to add the hardware fails for me.
the plugin doesn't show up into the list.
did I forgot something?
I copy the statuslog of the servicepi@Domoticz:~ $ sudo systemctl status ikea-tradfri.service

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 Tue 2018-05-29 11:23:43 CEST; 17min ago
 Main PID: 287 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           `-287 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-Tradfri/twistd.pid --python=/home/pi/domo

mei 29 11:23:43 Domoticz systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:48+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:51+0200 [-] Loaded.
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) starting up.
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:51+0200 [-] AdaptorFactory starting on 1234
mei 29 11:23:51 Domoticz twistd[287]: 2018-05-29T11:23:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x75c70ef0>
if I run the command manually i get the following

Code: Select all

pi@Domoticz:~/domoticz/plugins/IKEA-Tradfri $ twistd -n -y tradfri.tac
:0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''.  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.
2018-05-29T13:10:57+0200 [-] Loading tradfri.tac...
2018-05-29T13:10:58+0200 [-] Loaded.
2018-05-29T13:10:58+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) starting up.
2018-05-29T13:10:58+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
2018-05-29T13:10:58+0200 [-] AdaptorFactory starting on 1234
2018-05-29T13:10:58+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x76564a90>
but when i do

Code: Select all

sudo pip install service_identity
I get

Code: Select all

pi@Domoticz:~/domoticz/plugins/IKEA-Tradfri $ sudo pip install service_identity
Requirement already satisfied: service_identity in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: pyasn1-modules in /usr/local/lib/python2.7/dist-packages (from service_identity)
Requirement already satisfied: pyasn1 in /usr/lib/python2.7/dist-packages (from service_identity)
Requirement already satisfied: pyopenssl>=0.12 in /usr/lib/python2.7/dist-packages (from service_identity)
Requirement already satisfied: attrs in /usr/local/lib/python2.7/dist-packages (from service_identity)
pi@Domoticz:~/domoticz/plugins/IKEA-Tradfri $ 

OK, already a little bit further but still no IKEA-Tradfri in the hardware list.
if I run the twists -n -y tradfri.tac command i now get

Code: Select all

pi@Domoticz:~/domoticz/plugins/IKEA-Tradfri $ twistd -n -y tradfri.tac
2018-05-29T13:38:33+0200 [-] Loading tradfri.tac...
2018-05-29T13:38:34+0200 [-] Loaded.
2018-05-29T13:38:34+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) starting up.
2018-05-29T13:38:34+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
2018-05-29T13:38:34+0200 [-] AdaptorFactory starting on 1234
2018-05-29T13:38:34+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x7650b650>

if I connect via command line python3 -i -m pytradfri I get the following what I think is OK

Code: Select all

pi@Domoticz:/tmp $ python3 -i -m pytradfri 192.168.10.12
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65550,65567,65570,65559,65555,65568,65552,65551,65549,65558,65544,65545,65547,65553,65546,65557,65569,65543,65564,65562,65556,65561]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65550]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649850,"9001":"TRADFRI motion sensor","9020":1526851138,"9003":65550,"9054":0,"5750":4,"9019":1,"3":{"9":74,"0":"IKEA of Sweden","1":"TRADFRI motion sensor","2":"","3":"1.2.214","6":3},"3300":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65567]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1515022445,"9001":"","9020":1527398155,"9003":65567,"9054":0,"5750":2,"9019":1,"3":{"0":"","1":"","2":"","3":"","6":0},"3311":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65570]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1526848633,"9001":"TRADFRI bulb E27 WS opal 980lm 10","9020":1527608172,"9003":65570,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":1,"5851":2,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65559]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513455999,"9001":"TRADFRI bulb GU10 WS 400lm 6","9020":1527593435,"9003":65559,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":2,"5717":0,"5711":452,"5709":30138,"5710":26909,"5706":"efd275","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65555]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509654447,"9001":"TRADFRI bulb E27 WS opal 980lm 4","9020":1527595158,"9003":65555,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":203,"5717":0,"5711":400,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65568]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1526848557,"9001":"TRADFRI remote control 5","9020":1527441779,"9003":65568,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"9":34,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65552]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649929,"9001":"TRADFRI bulb E27 WS opal 980lm 3","9020":1527529906,"9003":65552,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65551]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649901,"9001":"TRADFRI bulb E27 WS opal 980lm 2","9020":1527529911,"9003":65551,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65549]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649809,"9001":"Afstandsbediening Badkamer","9020":1527445321,"9003":65549,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"9":87,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65558]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513455958,"9001":"TRADFRI bulb GU10 WS 400lm 5","9020":1527533702,"9003":65558,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":2,"5717":0,"5711":451,"5709":30138,"5710":26909,"5706":"efd275","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65544]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649037,"9001":"TRADFRI bulb GU10 W 400lm","9020":1527533708,"9003":65544,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65545]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649063,"9001":"TRADFRI bulb GU10 W 400lm 2","9020":1527533723,"9003":65545,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65547]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649140,"9001":"TRADFRI bulb GU10 W 400lm 4","9020":1527533730,"9003":65547,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65553]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509650278,"9001":"TRADFRI bulb GU10 WS 400lm 3","9020":1527533793,"9003":65553,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":2,"5717":0,"5711":448,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65546]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509649094,"9001":"TRADFRI bulb GU10 W 400lm 3","9020":1527533814,"9003":65546,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65557]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513455926,"9001":"TRADFRI bulb GU10 W 400lm 6","9020":1527533877,"9003":65557,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65569]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1526848596,"9001":"TRADFRI bulb E27 WS opal 980lm 9","9020":1527543679,"9003":65569,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65543]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1509648936,"9001":"TRADFRI remote control 2","9020":1527542541,"9003":65543,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"9":47,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65564]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513458401,"9001":"TRADFRI bulb E14 WS opal 400lm 8","9020":1527547918,"9003":65564,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":12,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65562]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513457451,"9001":"TRADFRI bulb E14 WS opal 400lm 7","9020":1527549197,"9003":65562,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","2":"","3":"1.2.217","6":1},"3311":[{"5850":0,"5851":1,"5717":0,"5711":454,"5709":33137,"5710":27211,"5706":"efd275","9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65556]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513455897,"9001":"TRADFRI bulb GU10 W 400lm 5","9020":1527567926,"9003":65556,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":254,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65561]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1513457363,"9001":"TRADFRI remote control 4","9020":1527476780,"9003":65561,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"9":74,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15005', <pytradfri.command.Command object at 0x765563d0>]
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: []
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9023":"1.tradfri.pool.ntp.org","9072":5,"9060":"2018-05-29T17:11:42.048464Z","9059":1527613902,"9062":0,"9061":0,"9077":28,"9029":"1.3.14","9092":0,"9081":"7e183152044000ce","9105":0,"9082":true,"9083":"664-12-131","9074":20,"9054":0,"9079":0,"9073":19,"9055":0,"9069":1515425568,"9066":5,"9071":1,"9075":44,"9106":0,"9076":10,"9078":1,"9080":60,"9093":0}

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()
is there anyone that can help me adding the plugin into domoticz?
Last edited by bmoons on Tuesday 29 May 2018 19:15, edited 1 time in total.
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: Monday 28 May 2018 0:40
Mario wrote: Sunday 27 May 2018 23:44 And again a new problem.

Domoticz Log :

2018-05-27 23:42:09.511 (IKEA) Connected successfully to: 192.168.178.185
2018-05-27 23:42:20.080 PluginSystem: Restarting I/O service thread.
2018-05-27 23:42:20.081 (IKEA) Device has disconnected

Terminal log:

Connected from IPv4Address(TCP, '127.0.0.1', 38502)
Data received: b'{"psk": "XXXXXXXXXXX", "gateway": "XXXXXXXXXXX", "groups": "False", "identity": "DOMOTICZ", "observe": "True", "action": "setConfig", "pollinterval": "30"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 211, 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 "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 96, in request
return self._execute(api_commands, timeout=timeout)
File "/usr/local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 85, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout:
The coax-client can't connect to the IKEA gateway and times out. Check to see if IP, ident and KEY are correct?

Regards,
M
Hi M,

I am at 99% of getting it working. When I start Coap adapter from command line everything is working. But when I turn off coap adaptor it stops working. So I need to have coap adapter start at startup, found descriptions that the service file needs to be edited but where and how do I do that?
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: Tuesday 29 May 2018 18:03 Hi M,

I am at 99% of getting it working. When I start Coap adapter from command line everything is working. But when I turn off coap adaptor it stops working. So I need to have coap adapter start at startup, found descriptions that the service file needs to be edited but where and how do I do that?
You need to use an editor like nano, and change the ikea-tradfri.service file to the proper location of the plugin and the username you're running the plugin as. On a PI I think it would be something like:

Code: Select all

[Unit]
Description=IKEA Tradfri COAP-adapter

[Service]
Type=simple
Environment=IKEA_HOME=/home/pi/domoticz/plugins/IKEA-Tradfri
ExecStart=/usr/local/bin/twistd --nodaemon \
      --rundir=${IKEA_HOME} \
      --pidfile=${IKEA_HOME}/twistd.pid \
      --python=${IKEA_HOME}/tradfri.tac

User=pi
Group=pi

Restart=always

[Install]
WantedBy=multi-user.target
The most important lines are the Environment=IKEA_HOME=... set to the correct path, and User and Group set to the correct user.

Then copy the ikea-tradfri.service file to the systemd-service directory, probably:

Code: Select all

$ sudo cp ikea-tradfri.service /lib/systemd/system
Check to see if the adapter is starting correctly:

Code: Select all

$ sudo systemctl start ikea-tradfri
$ sudo systemctl status ikea-tradfri
And if all that works, and you can control the IKEA lights from domoticz, finally enable auto starting the adapter

Code: Select all

$ sudo systemctl enable ikea-tradfri
and hopefully; hey presto!

Regards,
M
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

Hi,

After reinstalling the full raspberry PI I now have the plugin into the hardware tab.
now i have another problem
I get the following return from the libcoap

Code: Select all

coap-client -m post -u "Client_identity" -k "<KEY>" -e '{"9090":"DOMOTICZ"}' "coaps://192.168.10.12:5684/15011/9063"
v:1 t:CON c:POST i:7012 {} [ ]
4.00
what have I done wrong?
I've installed the libcoap using the install-coap-client.sh from ggravlingen
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

OK already a little bit further,

I succesfully created a PSK
but I didn't see any devices in the list

when I do
sudo systemctl status ikea-tradfri I get

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-31 00:20:46 CEST; 6min ago
 Main PID: 320 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─320 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-T

mei 31 00:20:46 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:49+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] Loaded.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) st
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreac
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] AdaptorFactory starting on 1234
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x764b85f0>
mei 31 00:21:05 raspberrypi twistd[320]: 2018-05-31T00:21:05+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 36852)
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: Wednesday 30 May 2018 22:55 Hi,

After reinstalling the full raspberry PI I now have the plugin into the hardware tab.
now i have another problem
I get the following return from the libcoap

Code: Select all

coap-client -m post -u "Client_identity" -k "<KEY>" -e '{"9090":"DOMOTICZ"}' "coaps://192.168.10.12:5684/15011/9063"
v:1 t:CON c:POST i:7012 {} [ ]
4.00
what have I done wrong?
I've installed the libcoap using the install-coap-client.sh from ggravlingen
You've probably already created a PSK for the ident "DOMOTICZ", as far as I know there are no way to generate a new PSK for a previously used ident, try using DOMOTICZ01 or something else!

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 »

bmoons wrote: Wednesday 30 May 2018 23:39 OK already a little bit further,

I succesfully created a PSK
but I didn't see any devices in the list

when I do
sudo systemctl status ikea-tradfri I get

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-31 00:20:46 CEST; 6min ago
 Main PID: 320 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─320 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-T

mei 31 00:20:46 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:49+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] Loaded.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) st
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreac
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] AdaptorFactory starting on 1234
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x764b85f0>
mei 31 00:21:05 raspberrypi twistd[320]: 2018-05-31T00:21:05+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 36852)
Hm, the adapter seems to be working and accepting connects from domoticz... Could you try running the adapter from the command-line and post the output, it's a bit more verbose when running from the command-line...

Regards,
M
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

moroen wrote: Thursday 31 May 2018 0:46
bmoons wrote: Wednesday 30 May 2018 23:39 OK already a little bit further,

I succesfully created a PSK
but I didn't see any devices in the list

when I do
sudo systemctl status ikea-tradfri I get

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-31 00:20:46 CEST; 6min ago
 Main PID: 320 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─320 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-T

mei 31 00:20:46 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:49+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] Loaded.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) st
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreac
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] AdaptorFactory starting on 1234
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x764b85f0>
mei 31 00:21:05 raspberrypi twistd[320]: 2018-05-31T00:21:05+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 36852)
Hm, the adapter seems to be working and accepting connects from domoticz... Could you try running the adapter from the command-line and post the output, it's a bit more verbose when running from the command-line...

Regards,
M
Hi Moroen,

I run it via commandline and that is the outcome

Code: Select all

pi@raspberrypi:~ $ python3 -i -m pytradfri 192.168.10.12
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
Please provide the 'Security Code' on the back of your Tradfri gateway: xxxxxxxxxxxxx
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 post ['15011', '9063']: {'9090': '97d3e9ff81954bbdbe9d9f5147031b88'}
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"SSbUWlEkRTL0ufPf","9029":"1.3.0014"}
Generated PSK:  SSbUWlEkRTL0ufPf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65550,65567,65568,65549,65561,65544,65545,65547,65553,65546,65557,65569,65570,65543,65564,65562,65556,65559,65555,65552,65551,65558]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65550]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI motion sensor","9002":1509649850,"9020":1526851138,"9003":65550,"9054":0,"5750":4,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI motion sensor","6":3,"2":"","3":"1.2.214","9":74},"3300":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65567]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"","9002":1515022445,"9020":1527398155,"9003":65567,"9054":0,"3311":[{"9003":0}],"5750":2,"9019":1,"3":{"0":"","1":"","6":0,"2":"","3":""}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65568]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 5","9002":1526848557,"9020":1527441779,"9003":65568,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":34}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65549]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"Afstandsbediening Badkamer","9002":1509649809,"9020":1527445321,"9003":65549,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":87}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65561]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 4","9002":1513457363,"9020":1527476780,"9003":65561,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":74}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65544]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm","9002":1509649037,"9020":1527713464,"9003":65544,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65545]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 2","9002":1509649063,"9020":1527713462,"9003":65545,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65547]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 4","9002":1509649140,"9020":1527713459,"9003":65547,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65553]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 3","9002":1509650278,"9020":1527713465,"9003":65553,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":448,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65546]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 3","9002":1509649094,"9020":1527713447,"9003":65546,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65557]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 6","9002":1513455926,"9020":1527713455,"9003":65557,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65569]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 9","9002":1526848596,"9020":1527713006,"9003":65569,"9054":0,"3311":[{"5850":0,"5851":0,"5717":0,"5711":0,"5709":0,"5710":0,"5706":"0","9003":0}],"5750":2,"9019":0,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65570]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 10","9002":1526848633,"9020":1527713460,"9003":65570,"9054":0,"3311":[{"5850":1,"5851":2,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65543]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 2","9002":1509648936,"9020":1527628917,"9003":65543,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":47}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65564]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 8","9002":1513458401,"9020":1527720712,"9003":65564,"9054":0,"3311":[{"5850":0,"5851":224,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65562]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 7","9002":1513457451,"9020":1527721992,"9003":65562,"9054":0,"3311":[{"5850":0,"5851":254,"5717":0,"5711":454,"5709":33137,"5710":27211,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65556]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 5","9002":1513455897,"9020":1527740722,"9003":65556,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65559]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 6","9002":1513455999,"9020":1527713459,"9003":65559,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":452,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65555]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 4","9002":1509654447,"9020":1527713463,"9003":65555,"9054":0,"3311":[{"5850":0,"5851":203,"5717":0,"5711":400,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65552]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 3","9002":1509649929,"9020":1527713454,"9003":65552,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65551]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 2","9002":1509649901,"9020":1527713458,"9003":65551,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65558]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 5","9002":1513455958,"9020":1527713466,"9003":65558,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":451,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15005', <pytradfri.command.Command object at 0x76a690d0>]
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: []
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9029":"1.3.14","9023":"1.tradfri.pool.ntp.org","9081":"7e183152044000ce","9059":1527746020,"9066":5,"9060":"2018-05-31T05:53:40.063320Z","9062":0,"9106":0,"9061":0,"9082":true,"9079":0,"9083":"664-12-131","9093":0,"9054":0,"9055":0,"9069":1515425568,"9073":19,"9071":1,"9072":5,"9092":0,"9080":60,"9075":44,"9074":20,"9105":0,"9076":10,"9077":28,"9078":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()
>>> 
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

bmoons wrote: Thursday 31 May 2018 8:00
moroen wrote: Thursday 31 May 2018 0:46
bmoons wrote: Wednesday 30 May 2018 23:39 OK already a little bit further,

I succesfully created a PSK
but I didn't see any devices in the list

when I do
sudo systemctl status ikea-tradfri I get

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-31 00:20:46 CEST; 6min ago
 Main PID: 320 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─320 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-T

mei 31 00:20:46 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:49+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] Loaded.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) st
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreac
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] AdaptorFactory starting on 1234
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x764b85f0>
mei 31 00:21:05 raspberrypi twistd[320]: 2018-05-31T00:21:05+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 36852)
Hm, the adapter seems to be working and accepting connects from domoticz... Could you try running the adapter from the command-line and post the output, it's a bit more verbose when running from the command-line...

Regards,
M
Hi Moroen,

I run it via commandline and that is the outcome

Code: Select all

pi@raspberrypi:~ $ python3 -i -m pytradfri 192.168.10.12
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
Please provide the 'Security Code' on the back of your Tradfri gateway: xxxxxxxxxxxxx
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 post ['15011', '9063']: {'9090': '97d3e9ff81954bbdbe9d9f5147031b88'}
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"SSbUWlEkRTL0ufPf","9029":"1.3.0014"}
Generated PSK:  SSbUWlEkRTL0ufPf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65550,65567,65568,65549,65561,65544,65545,65547,65553,65546,65557,65569,65570,65543,65564,65562,65556,65559,65555,65552,65551,65558]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65550]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI motion sensor","9002":1509649850,"9020":1526851138,"9003":65550,"9054":0,"5750":4,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI motion sensor","6":3,"2":"","3":"1.2.214","9":74},"3300":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65567]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"","9002":1515022445,"9020":1527398155,"9003":65567,"9054":0,"3311":[{"9003":0}],"5750":2,"9019":1,"3":{"0":"","1":"","6":0,"2":"","3":""}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65568]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 5","9002":1526848557,"9020":1527441779,"9003":65568,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":34}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65549]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"Afstandsbediening Badkamer","9002":1509649809,"9020":1527445321,"9003":65549,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":87}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65561]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 4","9002":1513457363,"9020":1527476780,"9003":65561,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":74}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65544]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm","9002":1509649037,"9020":1527713464,"9003":65544,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65545]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 2","9002":1509649063,"9020":1527713462,"9003":65545,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65547]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 4","9002":1509649140,"9020":1527713459,"9003":65547,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65553]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 3","9002":1509650278,"9020":1527713465,"9003":65553,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":448,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65546]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 3","9002":1509649094,"9020":1527713447,"9003":65546,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65557]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 6","9002":1513455926,"9020":1527713455,"9003":65557,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65569]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 9","9002":1526848596,"9020":1527713006,"9003":65569,"9054":0,"3311":[{"5850":0,"5851":0,"5717":0,"5711":0,"5709":0,"5710":0,"5706":"0","9003":0}],"5750":2,"9019":0,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65570]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 10","9002":1526848633,"9020":1527713460,"9003":65570,"9054":0,"3311":[{"5850":1,"5851":2,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65543]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 2","9002":1509648936,"9020":1527628917,"9003":65543,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":47}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65564]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 8","9002":1513458401,"9020":1527720712,"9003":65564,"9054":0,"3311":[{"5850":0,"5851":224,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65562]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 7","9002":1513457451,"9020":1527721992,"9003":65562,"9054":0,"3311":[{"5850":0,"5851":254,"5717":0,"5711":454,"5709":33137,"5710":27211,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65556]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 5","9002":1513455897,"9020":1527740722,"9003":65556,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65559]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 6","9002":1513455999,"9020":1527713459,"9003":65559,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":452,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65555]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 4","9002":1509654447,"9020":1527713463,"9003":65555,"9054":0,"3311":[{"5850":0,"5851":203,"5717":0,"5711":400,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65552]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 3","9002":1509649929,"9020":1527713454,"9003":65552,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65551]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 2","9002":1509649901,"9020":1527713458,"9003":65551,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65558]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 5","9002":1513455958,"9020":1527713466,"9003":65558,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":451,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15005', <pytradfri.command.Command object at 0x76a690d0>]
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: []
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9029":"1.3.14","9023":"1.tradfri.pool.ntp.org","9081":"7e183152044000ce","9059":1527746020,"9066":5,"9060":"2018-05-31T05:53:40.063320Z","9062":0,"9106":0,"9061":0,"9082":true,"9079":0,"9083":"664-12-131","9093":0,"9054":0,"9055":0,"9069":1515425568,"9073":19,"9071":1,"9072":5,"9092":0,"9080":60,"9075":44,"9074":20,"9105":0,"9076":10,"9077":28,"9078":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()
>>> 

Finally it worked when I checked the logs in domoticz I received some errors where i needed to enable development so I did and after a reboot of the PI all bulbs where there
bmoons
Posts: 6
Joined: Tuesday 29 May 2018 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bmoons »

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
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: Wednesday 30 May 2018 0:48
Mario wrote: Tuesday 29 May 2018 18:03 Hi M,

I am at 99% of getting it working. When I start Coap adapter from command line everything is working. But when I turn off coap adaptor it stops working. So I need to have coap adapter start at startup, found descriptions that the service file needs to be edited but where and how do I do that?
You need to use an editor like nano, and change the ikea-tradfri.service file to the proper location of the plugin and the username you're running the plugin as. On a PI I think it would be something like:

Code: Select all

[Unit]
Description=IKEA Tradfri COAP-adapter

[Service]
Type=simple
Environment=IKEA_HOME=/home/pi/domoticz/plugins/IKEA-Tradfri
ExecStart=/usr/local/bin/twistd --nodaemon \
      --rundir=${IKEA_HOME} \
      --pidfile=${IKEA_HOME}/twistd.pid \
      --python=${IKEA_HOME}/tradfri.tac

User=pi
Group=pi

Restart=always



[Install]
WantedBy=multi-user.target
The most important lines are the Environment=IKEA_HOME=... set to the correct path, and User and Group set to the correct user.

Then copy the ikea-tradfri.service file to the systemd-service directory, probably:

Code: Select all

$ sudo cp ikea-tradfri.service /lib/systemd/system
Check to see if the adapter is starting correctly:

Code: Select all

$ sudo systemctl start ikea-tradfri
$ sudo systemctl status ikea-tradfri
And if all that works, and you can control the IKEA lights from domoticz, finally enable auto starting the adapter

Code: Select all

$ sudo systemctl enable ikea-tradfri
and hopefully; hey presto!

Regards,
M
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...
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 8:00
moroen wrote: Thursday 31 May 2018 0:46
bmoons wrote: Wednesday 30 May 2018 23:39 OK already a little bit further,

I succesfully created a PSK
but I didn't see any devices in the list

when I do
sudo systemctl status ikea-tradfri I get

Code: Select all

ikea-tradfri.service - IKEA Tradfri COAP-adapter
   Loaded: loaded (/lib/systemd/system/ikea-tradfri.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-05-31 00:20:46 CEST; 6min ago
 Main PID: 320 (twistd)
   CGroup: /system.slice/ikea-tradfri.service
           └─320 /usr/bin/python3 /usr/local/bin/twistd --nodaemon --rundir=/home/pi/domoticz/plugins/IKEA-Tradfri --pidfile=/home/pi/domoticz/plugins/IKEA-T

mei 31 00:20:46 raspberrypi systemd[1]: Started IKEA Tradfri COAP-adapter.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:49+0200 [-] Loading /home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac...
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] Loaded.
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 18.4.0 (/usr/bin/python3 3.5.3) st
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreac
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [-] AdaptorFactory starting on 1234
mei 31 00:20:51 raspberrypi twistd[320]: 2018-05-31T00:20:51+0200 [builtins.AdaptorFactory#info] Starting factory <AdaptorFactory object at 0x764b85f0>
mei 31 00:21:05 raspberrypi twistd[320]: 2018-05-31T00:21:05+0200 [stdout#info] Connected from IPv4Address(TCP, '127.0.0.1', 36852)
Hm, the adapter seems to be working and accepting connects from domoticz... Could you try running the adapter from the command-line and post the output, it's a bit more verbose when running from the command-line...

Regards,
M
Hi Moroen,

I run it via commandline and that is the outcome

Code: Select all

pi@raspberrypi:~ $ python3 -i -m pytradfri 192.168.10.12
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
Please provide the 'Security Code' on the back of your Tradfri gateway: xxxxxxxxxxxxx
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 post ['15011', '9063']: {'9090': '97d3e9ff81954bbdbe9d9f5147031b88'}
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"SSbUWlEkRTL0ufPf","9029":"1.3.0014"}
Generated PSK:  SSbUWlEkRTL0ufPf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65550,65567,65568,65549,65561,65544,65545,65547,65553,65546,65557,65569,65570,65543,65564,65562,65556,65559,65555,65552,65551,65558]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65550]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI motion sensor","9002":1509649850,"9020":1526851138,"9003":65550,"9054":0,"5750":4,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI motion sensor","6":3,"2":"","3":"1.2.214","9":74},"3300":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65567]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"","9002":1515022445,"9020":1527398155,"9003":65567,"9054":0,"3311":[{"9003":0}],"5750":2,"9019":1,"3":{"0":"","1":"","6":0,"2":"","3":""}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65568]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 5","9002":1526848557,"9020":1527441779,"9003":65568,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":34}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65549]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"Afstandsbediening Badkamer","9002":1509649809,"9020":1527445321,"9003":65549,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":87}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65561]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 4","9002":1513457363,"9020":1527476780,"9003":65561,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":74}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65544]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm","9002":1509649037,"9020":1527713464,"9003":65544,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65545]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 2","9002":1509649063,"9020":1527713462,"9003":65545,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65547]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 4","9002":1509649140,"9020":1527713459,"9003":65547,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65553]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 3","9002":1509650278,"9020":1527713465,"9003":65553,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":448,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65546]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 3","9002":1509649094,"9020":1527713447,"9003":65546,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65557]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 6","9002":1513455926,"9020":1527713455,"9003":65557,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65569]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 9","9002":1526848596,"9020":1527713006,"9003":65569,"9054":0,"3311":[{"5850":0,"5851":0,"5717":0,"5711":0,"5709":0,"5710":0,"5706":"0","9003":0}],"5750":2,"9019":0,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65570]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 10","9002":1526848633,"9020":1527713460,"9003":65570,"9054":0,"3311":[{"5850":1,"5851":2,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65543]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI remote control 2","9002":1509648936,"9020":1527628917,"9003":65543,"9054":0,"5750":0,"9019":1,"15009":[{"9003":0}],"3":{"0":"IKEA of Sweden","1":"TRADFRI remote control","6":3,"2":"","3":"1.2.214","9":47}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65564]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 8","9002":1513458401,"9020":1527720712,"9003":65564,"9054":0,"3311":[{"5850":0,"5851":224,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65562]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E14 WS opal 400lm 7","9002":1513457451,"9020":1527721992,"9003":65562,"9054":0,"3311":[{"5850":0,"5851":254,"5717":0,"5711":454,"5709":33137,"5710":27211,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 WS opal 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65556]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 W 400lm 5","9002":1513455897,"9020":1527740722,"9003":65556,"9054":0,"3311":[{"5850":0,"5851":254,"9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 W 400lm","6":1,"2":"","3":"1.2.214"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65559]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 6","9002":1513455999,"9020":1527713459,"9003":65559,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":452,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65555]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 4","9002":1509654447,"9020":1527713463,"9003":65555,"9054":0,"3311":[{"5850":0,"5851":203,"5717":0,"5711":400,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65552]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 3","9002":1509649929,"9020":1527713454,"9003":65552,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65551]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb E27 WS opal 980lm 2","9002":1509649901,"9020":1527713458,"9003":65551,"9054":0,"3311":[{"5850":1,"5851":254,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 WS opal 980lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15001', 65558]
DEBUG:pytradfri.api.libcoap_api:Received: {"9001":"TRADFRI bulb GU10 WS 400lm 5","9002":1513455958,"9020":1527713466,"9003":65558,"9054":0,"3311":[{"5850":0,"5851":2,"5717":0,"5711":451,"5709":30138,"5710":26909,"5706":"efd275","9003":0}],"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb GU10 WS 400lm","6":1,"2":"","3":"1.2.217"}}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15005', <pytradfri.command.Command object at 0x76a690d0>]
DEBUG:pytradfri.api.libcoap_api:Received: [131079,131087,131078,131075,131084,131083]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: []
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.10.12 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9029":"1.3.14","9023":"1.tradfri.pool.ntp.org","9081":"7e183152044000ce","9059":1527746020,"9066":5,"9060":"2018-05-31T05:53:40.063320Z","9062":0,"9106":0,"9061":0,"9082":true,"9079":0,"9083":"664-12-131","9093":0,"9054":0,"9055":0,"9069":1515425568,"9073":19,"9071":1,"9072":5,"9092":0,"9080":60,"9075":44,"9074":20,"9105":0,"9076":10,"9077":28,"9078":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()
>>> 
I meant the plugins coal-adapter from the command line, here you're running pytradfri directly. Please try the following and post the output.

Code: Select all

$ python3 tradfri.tac
Regards,
M
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest