I did not see these kind of errors with the mainbranch... sorry about all these printouts
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri$ coap-client -k xxxxx coaps://192.168.0.72/.well-known/core
v:1 t:CON c:GET i:a1cb {} [ ]
<//15006>;ct=0;obs,<//15001>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15010>;ct=0;obs,<//15005>;ct=0;obs,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9094>;ct=0;obs,<//15011/9095>;ct=0;obs,<//15011/9104>;ct=0;obs,<//15010/315645>;ct=0;obs,<//15001/65540>;ct=0;obs,<//15001/65543>;ct=0;obs,<//15001/65541>;ct=0;obs,<//15001/65542>;ct=0;obs,<//15001/65544>;ct=0;obs,<//15001/65538>;ct=0;obs,<//15001/65539>;ct=0;obs,<//15001/65537>;ct=0;obs,<//15001/65536>;ct=0;obs,<//15001/65546>;ct=0;obs,<//15001/65545>;ct=0;obs,<//15005/156072/223698>;ct=0;obs,<//15005/156072/212379>;ct=0;obs,<//15005/156072/203663>;ct=0;obs,<//15005/156073/223699>;ct=0;obs,<//15005/156073/223700>;ct=0;obs,<//15005/156073/223701>;ct=0;obs,<//15004/156073>;ct=0;obs,<//15005/156073>;ct=0;obs,<//15005/141990/220431>;ct=0;obs,<//15005/141990/220595>;ct=0;obs,<//15005/141990/220176>;ct=0;obs,<//15004/156072>;ct=0;obs,<//15005/156072>;ct=0;obs,<//15004/141990>;ct=0;obs,<//15005/141990>;ct=0;obs,<//15011/9063>;ct=0
pi@raspberrypi:~/domoticz/plugins/IKEA-Tradfri$ python3 tradfri.tac
IKEA-tradfri COAP-adaptor version 0.6 started (command line)!
Connected from IPv4Address(TCP, '127.0.0.1', 59356)
Data received: b'{"groups": "False", "gateway": "192.168.0.72", "observe": "True", "pollinterval": "30", "action": "setConfig", "identity": "IKEA01", "psk": "XXXXXX"}'
Initializing gateway
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 205, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 211, in _dataReceived
rval = self.protocol.dataReceived(data)
File "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/dist-packages/pytradfri/api/libcoap_api.py", line 92, in request
return self._execute(api_commands)
File "/usr/local/lib/python3.5/dist-packages/pytradfri/api/libcoap_api.py", line 81, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout:
root@raspberrypi:/home/pi/domoticz/plugins/IKEA-Tradfri# python3 -i -m pytradfri 192.168.0.72
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
Please provide the 'Security Code' on the back of your Tradfri gateway: XXXXXXXX
DEBUG:pytradfri.util:JSON file not found: tradfri_standalone_psk.conf
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 post ['15011', '9063']: {'9090': 'c00138337c2d4cf3b9284bfa64e6cf5a'}
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"2AjUjWJi6gIPi3BP","9029":"1.3.0014"}
Generated PSK: 2AjUjWJi6gIPi3BP
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001']
DEBUG:pytradfri.api.libcoap_api:Received: [65540,65543,65541,65542,65544,65538,65539,65537,65536,65546,65545]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65540]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506181596,"9001":"TRADFRI bulb GU10 WS 400lm","9020":1516766404,"9003":65540,"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":111,"9003":0,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5"}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65543]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506606717,"9001":"TRADFRI bulb GU10 WS 400lm 4","9020":1516718013,"9003":65543,"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":111,"9003":0,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5"}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65541]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506181673,"9001":"TRADFRI bulb GU10 WS 400lm 2","9020":1516766406,"9003":65541,"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":111,"9003":0,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5"}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65542]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506181778,"9001":"TRADFRI bulb GU10 WS 400lm 3","9020":1516766461,"9003":65542,"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":91,"9003":0,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5"}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65544]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506606774,"9001":"TRADFRI bulb GU10 WS 400lm 5","9020":1516718033,"9003":65544,"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":111,"9003":0,"5717":0,"5711":370,"5709":30138,"5710":26909,"5706":"f1e0b5"}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65538]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1507399195,"9001":"TRADFRI bulb E14 W op/ch 400lm 4","9020":1516698657,"9003":65538,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 W op/ch 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":1,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65539]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506181295,"9001":"TRADFRI bulb E14 W op/ch 400lm 3","9020":1516698660,"9003":65539,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 W op/ch 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":1,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65537]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1506181106,"9001":"TRADFRI bulb E14 W op/ch 400lm","9020":1516694850,"9003":65537,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E14 W op/ch 400lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":0,"5851":1,"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65536]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1507398531,"9001":"TRADFRI remote control","9020":1515354466,"9003":65536,"9054":0,"5750":0,"9019":1,"3":{"9":60,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3},"15009":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65546]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1510430521,"9001":"TRADFRI remote control 2","9020":1516743674,"9003":65546,"9054":0,"5750":0,"9019":1,"3":{"9":74,"0":"IKEA of Sweden","1":"TRADFRI remote control","2":"","3":"1.2.214","6":3},"15009":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15001', 65545]
DEBUG:pytradfri.api.libcoap_api:Received: {"9002":1507399005,"9001":"TRADFRI wireless dimmer","9020":1516707192,"9003":65545,"9054":0,"5750":0,"9019":1,"3":{"9":34,"0":"IKEA of Sweden","1":"TRADFRI wireless dimmer","2":"","3":"1.2.248","6":3},"15009":[{"9003":0}]}
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15004']
DEBUG:pytradfri.api.libcoap_api:Received: [156073,156072,141990]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15005', <pytradfri.command.Command object at 0x76702cf0>]
DEBUG:pytradfri.api.libcoap_api:Received: [156073,156072,141990]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15010']
DEBUG:pytradfri.api.libcoap_api:Received: [315645]
DEBUG:pytradfri.api.libcoap_api:Executing 192.168.0.72 get ['15011', '15012']
DEBUG:pytradfri.api.libcoap_api:Received: {"9023":"2.tradfri.pool.ntp.org","9092":0,"9059":1516780675,"9069":1515402535,"9060":"2018-01-24T07:57:55.012568Z","9062":0,"9061":0,"9029":"1.3.14","9055":100,"9081":"7e177152044000c4","9072":0,"9082":true,"9083":"090-90-084","9106":0,"9093":0,"9054":0,"9080":0,"9066":5,"9105":0,"9073":0,"9071":1,"9074":0,"9075":0,"9076":0,"9077":0,"9078":0,"9079":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()
>>>