After having to reset my Tradfri gateway (I wasn’t able to connect both my remote and a lightstrip at the same time) HASS can’t connect to my Gateway anymore. The log shows an error related to the encryption.
2017-11-05 16:05:47 ERROR (MainThread) [coap] Fatal DTLS error: code 115
2017-11-05 16:05:47 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-05 16:05:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/lib/python3.6/asyncio/tasks.py”, line 181, in _step result = coro.throw(exc)
File “/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py”, line 108, in gateway_discovered allow_tradfri_groups)
File “/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py”, line 141, in _setup_gateway gateway_info_result = yield from api(gateway.get_gateway_info())
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 149, in request result = yield from self._execute(api_commands)
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 139, in _execute _, res = yield from self._get_response(msg)
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 92, in _get_response r = yield from pr.response
File “/usr/lib/python3.6/asyncio/futures.py”, line 331, in iter yield self # This tells Task to wait for completion. File “/usr/lib/python3.6/asyncio/tasks.py”, line 244, in _wakeup future.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 244, in result raise self._exception File “/usr/lib/python3.6/site-packages/aiocoap/protocol.py”, line 814, in _run_outer yield from cls._run(app_request, response, weak_observation, protocol, log, exchange_monitor_factory)
File “/usr/lib/python3.6/site-packages/aiocoap/protocol.py”, line 863, in _run blockresponse = yield from blockrequest.response
File “/usr/lib/python3.6/asyncio/futures.py”, line 331, in iter yield self # This tells Task to wait for completion. File “/usr/lib/python3.6/asyncio/tasks.py”, line 244, in _wakeup future.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 244, in result raise self._exception OSError: [Errno -1] No error information
After this it keeps spamming:
2017-11-05 16:05:47 ERROR (MainThread) [coap] Fatal DTLS error: code 115
2017-11-05 16:05:47 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
Somebody knows how to reset the tradfri component or knows what else to do?
I’m running Hass.io with latest HASS version on a raspberry pi 3
removed it… reboot… added key and result…none
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 179, in _step
result = coro.send(None)
File “/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py”, line 66, in configuration_callback
psk = yield from api_factory.generate_psk(callback_data.get(‘key’))
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 193, in generate_psk
self._psk = yield from self.request(command)
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 149, in request
result = yield from self._execute(api_commands)
File “/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py”, line 141, in _execute
api_command.result = _process_output(res, parse_json)
File “/usr/lib/python3.6/site-packages/pytradfri/command.py”, line 71, in result
self._result = self._process_result(value)
File “/usr/lib/python3.6/site-packages/pytradfri/gateway.py”, line 28, in process_result
return result[ATTR_PSK]
TypeError: ‘NoneType’ object is not subscriptable
just did it
that file never showed again on my config folder…
I have a weird I that can be read as 1 that I might have insisted more than once… but log shows an error not really related to wrong key…
and by the way… was working few days back
as far as I’m aware aiocoap is the part of pytradfri that handles the encryption. but your error is different from the one I got anyway.
There’s some issues concerning the tradfri open on github, I suppose those get fixed within the next weeks.
I added the IKEA component in configuration.yaml file besides having Discovery enabled. And now it shows up twice in the “Configurator” pane on the overview page(?)
2017-11-09 20:33:07 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 66, in configuration_callback
psk = yield from api_factory.generate_psk(callback_data.get('key'))
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 193, in generate_psk
self._psk = yield from self.request(command)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 149, in request
result = yield from self._execute(api_commands)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 141, in _execute
api_command.result = _process_output(res, parse_json)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/command.py", line 71, in result
self._result = self._process_result(value)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/gateway.py", line 28, in process_result
return result[ATTR_PSK]
TypeError: 'NoneType' object is not subscriptable
I’m not sure it is a bug, but it seems that it cannot write the tradfri.conf file.
it looks more like the pre shared key for the encryption is an empty string.
and the .tradfri_conf is hidden, might wanna try ls -a in a console in your configuration folder
honestly…to me… and I am having exactly same problem… looks like UI is not sending the typed string to the core. That is why lot of people does not have issues… and others (like and you) have. We deleted the tradfri.conf where they key was… and not we cannot add that key?