core: Tradfri integration breaks if updating to v0.99.0

#f03c15 If it’s not working, roll back to the 0.98.5 docker image (confirmed to be working) until we’ve fixed the issue.

Home Assistant release with the issue:

0.99.x (reported in Discord/Beta group)

Last working Home Assistant release (if known): 0.99.x (reported by another user to be a working version in Discord/Beta group)

Operating environment (Hass.io/Docker/Windows/etc.):

Component/platform:

https://www.home-assistant.io/components/tradfri/

Description of problem:

Anecdotal evidence in Home Assistant’s forums and Discord channels suggests tradfri is not working in version 1.9 of the gateway.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):

Error setting up entry 10.0.100.5 for tradfri
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 190, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/tradfri/__init__.py", line 114, in async_setup_entry
    gateway_info = await api(gateway.get_gateway_info())
  File "/usr/local/lib/python3.7/site-packages/pytradfri/api/aiocoap_api.py", line 155, in request
    result = await self._execute(api_commands)
  File "/usr/local/lib/python3.7/site-packages/pytradfri/api/aiocoap_api.py", line 146, in _execute
    _, res = await self._get_response(msg)
  File "/usr/local/lib/python3.7/site-packages/pytradfri/api/aiocoap_api.py", line 95, in _get_response
    r = await pr.response
  File "/usr/local/lib/python3.7/site-packages/aiocoap/protocol.py", line 720, in _run_outer
    await cls._run(app_request, response, weak_observation, protocol, log)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/protocol.py", line 745, in _run
    await protocol.find_remote_and_interface(app_request)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/protocol.py", line 295, in find_remote_and_interface
    if await ri.fill_or_recognize_remote(message):
  File "/usr/local/lib/python3.7/site-packages/aiocoap/tokenmanager.py", line 179, in fill_or_recognize_remote
    return await self.token_interface.fill_or_recognize_remote(message)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/messagemanager.py", line 327, in fill_or_recognize_remote
    remote = await self.message_interface.determine_remote(message)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/transports/tinydtls.py", line 328, in determine_remote
    dtlsparams = self.ctx.client_credentials.credentials_from_request(request)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/credentials.py", line 285, in credentials_from_request
    raise CredentialsMissingError("No suitable credentials for %s" % uri)
aiocoap.credentials.CredentialsMissingError: No suitable credentials for coaps://10.0.100.5:5684/15011/15012

Additional information: Related issue for upstream dependency: https://github.com/ggravlingen/pytradfri/issues/246

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 38 (18 by maintainers)

Most upvoted comments

On 0.99 release, HA in docker, Tradfri GW 1.9.27 Tradfri no longer works. “No suitable credentials…”

Horrible hack but:

docker exec -ti home-assistant /bin/bash
> apk install autoconf gcc libc-dev
> pip install pytradfri==6.3.1 pytradfri[async]=6.3.1
> exit
docker restart home-assistant

Has gotten mine working again (using docker), so i can confirm that bumping pytradfri to 6.3.1. fixes the issue.

@Mariusthvdb this is not on IKEA’s side but due to a bug in pytradfri. The bug has been fixed and now needs to be released to Home Assistant.

Thank you @thinkl33t! I’ve mentioned this fix to @balloob and unless he or someone else beats me to it, I’ll have time to provide a fix tonight or tomorrow night.

If you want to do it, look at my PR for the blinds here and see what files I’ve changed where pytradfri 6.3.1 is mentioned.

I see the same error after upgrading to the 0.99 beta. It used to work fine with 0.98. I’m not sure what version my Ikea trådfri hub is and I’m unfortunately not able to check at the moment.

The horrible hack over by @thinkl33t didn’t work for me, but I can then come with my own horrible hack… Downgrading to 0.89.5 would still probably be best for everyone until the release with fix is out 😃

Did the install commands, but when I restarted the docker container, HA took over and downloaded the “old” pypi package again that was marked in the manifest.json file, but can also do this which fixed it for me:

docker exec -ti homeassistant /bin/bash
> vi usr/src/homeassistant/homeassistant/components/tradfri/manifest.json
# edit as shown below
docker restart homeassistant

Editing the file in vi from

"requirements": [
    "pytradfri[async]==6.0.1"
  ],

to

"requirements": [
    "pytradfri[async]==6.3.1"
  ],