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()
>>>