Closed ggravlingen closed 4 years ago
Which version of HA? I have it with working with 0.98.5 and TRADFRI 1.9.27 (latest version)
Oh I see on the commit, that you're using 0.99? So I think it would be fair to say its on the HA side?
Interesting! The reports are from people running the latest beta.
The only changes to Tradfri has been this. But that's only internal facing and should not make a difference.
I have been trying to get Home Assistant working with the IKEA gateway for a couple of days now. Unfortunatley I get the same "aiocoap.credentials.CredentialsMissingError: No suitable credentials for coaps:..." error when I try to register the gateways security key in the web interface.
I am running a fresh install of Home Assistant 0.98.5 on a RaspberryPi 3 and an IKEA Gateway 1.9.27.
@Jocke67 did you use one of the docker images or did you do a stand-alone install?
@ggravlingen I have tried both Hassbian and a manual install following these guides:
https://www.home-assistant.io/docs/installation/hassbian/installation/
https://www.home-assistant.io/docs/installation/raspberry-pi/
Both installations gave me the same error.
Then you are most likely missing dependencies as suggested above. I would strongly advise using this method: https://github.com/home-assistant/hassio-installer
@balloob agree, that’s not it. I’ll keep this issue open over the next release and if the comments don’t pour in, I’ll close it and the issue on the status page.
Hi, i'm at work at this moment so I can't give any details but wanted to let you know that I've got also a problem with it. It worked before, gave a faillure so I tried to add it again but now it gives an "unknown error". I'm running Home Assistant on a RPi 4 with the Hass.io supervisor 188 (beta) and HassOS 3.5. Can't acces the log from my location, if more info is needed I can give it later today (local time) .
Erik
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.
I have the same problem, don't know if it is a problem with 0.99b* or the new firmware on the gateway 1.9.27. Updated them simultaneously.
Error while trying to add the integration
Log Details (ERROR)
Wed Sep 18 2019 20:26:26 GMT+0200 (Midden-Europese zomertijd)
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 231, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 128, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 164, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 48, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 90, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 89, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 132, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/tradfri/config_flow.py", line 55, in async_step_auth
self.hass, host, user_input[KEY_SECURITY_CODE]
File "/usr/src/homeassistant/homeassistant/components/tradfri/config_flow.py", line 164, in authenticate
key = await api_factory.generate_psk(security_code)
File "/usr/local/lib/python3.7/site-packages/pytradfri/api/aiocoap_api.py", line 195, in generate_psk
self._psk = await self.request(command)
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://192.168.2.12:5684/15011/9063
Confirmation that HA 0.98.5 with Tradfri GW 1.9.27 still appears to work. No weird log entries (also after HA restart), automations and interactions still work. Running on RPi3B+, Hass.io v188, HassOS v2.12
On 0.99 release, HA in docker, Tradfri GW 1.9.27 Tradfri no longer works. "No suitable credentials..."
Same issue doesn‘t work on docker
@ggravlingen Did a new fresh install, according to your advice I followed this method: https://github.com/home-assistant/hassio-installer
This gave me a Home Assistant ver. 0.99 installation with the same "No suitable credentials for coaps" problem when I try to register the IKEA gateway security key.
Just updated to 0.99.0 on Raspberry Pi with docker and Ikea tradfri gateway Firmware: 1.9.27, got:
Error setting up entry x.x.x.x for tradfri
No suitable credentials for coaps:
According to the IKEA release notes the Gateway 1.9.27 version contains connectivity issues involving CoAP.
It seems an upstream dependency has changed so this is a possible solution: https://github.com/ggravlingen/pytradfri/pull/248.
Other than that, nothing has changed in pytradfri
since 0.98. I just read the release log of HA and as @balloob has already stated above, there is nothing obvious in there that would cause this.
I've pushed pytradfri 6.3.1 to pypi, holding a posible fix. Can someone please bump the version in their HA and test if it works?
I've pushed pytradfri 6.3.1 to pypi, holding a posible fix. Can someone please bump the version in their HA and test if it works?
I can, if you let me know how...
I have not updated my Tradfri gateway firmware for months... but HA to 0.99. With this new HA version I have this problem, too. With the last HA version 0.98 its still working fine. So this bug has nothing to do with the Tradfri firmware ;)
@nicx Can you confirm the version on your Tradfri GW? Mine updates itself if it has internet connectivity...
@magnusoverli I am at work so I can confirm it this evening ;) But mine is not auto updating, only when using the Tradfri app (which I dont use). I will get back to your question when I am at home.
Same here, gateway version 1.9.27 (it auto updates without opening the tradfri app) HA version 0.99
Error setting up entry 192.168.0.13 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://192.168.0.13:5684/15011/15012
I updated from HA 0.98.5 to 0.99 today, and the same occurred for me. I reverted to a snapshot of HA 0.98.5 and the Tradfri devices were available again. Gateway version 1.9.27 in both cases.
I rolled back to docker image 0.98.5 and the problem went away immediately.
The theory I'm working on is that upstream dependency DTLSSocket
has introduced a change that is breaking for us since the last Home Assistant image was built. We have not been strict with what versions of DTLSSocket
to use, which introduces this problem.
In pytradfri 6.3.1 we're being more strict, also using a version that seems to be working.
I don't know how to test this using HA docker images. I believe someone testing the new code for the blinds was using the custom component technique, but I'm not sure how that works.
Can confirm, same error happened to me overnight last night:
2019-09-19 09:19:06 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 172.16.32.58 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://172.16.32.58:5684/15011/15012
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.
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.
According to the IKEA release notes the Gateway 1.9.27 version contains connectivity issues involving CoAP.
do you have a link for these Ikea release notes please? really nice to be able to read these to know what updated
@Mariusthvdb I googled "ikea trådfri release notes" and found this link:
https://ww8.ikea.com/ikeahomesmart/releasenotes/releasenotes.html
@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.
@Mariusthvdb I googled "ikea trådfri release notes" and found this link:
https://ww8.ikea.com/ikeahomesmart/releasenotes/releasenotes.html
duh, that was easy. sorry for that...
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"
],
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" ],
Worked for me! Thx!
This error looks like to be back in the current versions:
File "/usr/local/lib/python3.8/site-packages/aiocoap/credentials.py", line 274, in credentials_from_request
raise CredentialsMissingError("No suitable credentials for %s" % uri)
More info about the setup:
bash-5.0# cat /usr/src/homeassistant/homeassistant/components/tradfri/manifest.json
{
"domain": "tradfri",
"name": "IKEA TRÅDFRI",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tradfri",
"requirements": ["pytradfri[async]==6.4.0"],
"homekit": {
"models": ["TRADFRI"]
},
"codeowners": ["@ggravlingen"]
}
with Hass running in a container homeassistant/raspberrypi3-homeassistant
:
bash-5.0# cat .HA_VERSION
0.115.0.dev20200825
Latest container:
$ docker pull homeassistant/raspberrypi3-homeassistant
Using default tag: latest
latest: Pulling from homeassistant/raspberrypi3-homeassistant
Digest: sha256:998533704d578fe935f72e2ad67e03304a7c299617a206d1699a487be3f59e98
Status: Image is up to date for homeassistant/raspberrypi3-homeassistant:latest
docker.io/homeassistant/raspberrypi3-homeassistant:latest
This is an old issue. Please open a new issue.
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):
Additional information: Related issue for upstream dependency: https://github.com/ggravlingen/pytradfri/issues/246