Upgrade to 0.55.0 Ikea Tradfri not working anymore

same here :frowning:

What about Tradfri and hass.io, which is already running Python 3.6?

1 Like

Hi could you please share your steps ? Thanks

Here also. Hassbian 1.3 on Stretch. I tried some of the above scripts. None of them worked. Then afterwards I updated the Hassbian scripts and installed the Tradfri script. The following errors still occurring.

okt 09 16:06:51 Hassbian hass[512]: 2017-10-09 16:06:51 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn’t installed!
okt 09 16:06:51 Hassbian hass[512]: Traceback (most recent call last):
okt 09 16:06:51 Hassbian hass[512]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py”, line 115, in _setup_gateway
okt 09 16:06:51 Hassbian hass[512]: from pytradfri.api.aiocoap_api import api_factory
okt 09 16:06:51 Hassbian hass[512]: File “/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py”, line 9, in
okt 09 16:06:51 Hassbian hass[512]: from aiocoap.transports import tinydtls
okt 09 16:06:51 Hassbian hass[512]: ImportError: cannot import name ‘tinydtls’
okt 09 16:06:51 Hassbian hass[512]: 2017-10-09 16:06:51 ERROR (MainThread) [homeassistant.setup] Setup failed for tradfri: Component failed to initialize.

indent preformatted text by 4 spaces
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 115, in _setup_gateway
from pytradfri.api.aiocoap_api import api_factory
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 9, in <module>
from aiocoap.transports import tinydtls
ImportError: cannot import name 'tinydtls'

Same error here !

I did like @morberg said in his post. So basically you need to install tinydtls and aiocoap. In order to do so you first need to install cython. So stop HA, activative your virtual environment (if you’ve installed HA in one) and execute the following command:

pip3 install cython

This may take a while - even though it looks nothing happens, just wait for it to finish.
Afterwards enter the following commands (taken from here: https://github.com/ggravlingen/pytradfri/blob/4d4a682f2f646d41d2a6e4a65858e376f56e24ed/script/install-aiocoap.sh)

git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
./configure --with-ecc --without-debug
cd cython
python3 setup.py install

cd ../..
git clone https://github.com/chrysn/aiocoap
cd aiocoap
git reset --hard 3286f48f0b949901c8b5c04c0719dc54ab63d431
python3 -m pip install --upgrade pip setuptools
python3 -m pip install .

Afterwards I restarted HA and TRADFRI was back. I hope these steps will help you!


i get the error

aclocal: warning: autoconf input should be named ‘configure.ac’, not ‘configure.in’
autom4te: cannot open autom4te.cache/requests: Permission denied
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

when at the ./configure --with-ecc --without-debug step

Hi @Daigo

Are you on Jessie or Stretch? Can you tell us your python version?

python -V
python3 -V

Ah, sorry, forgot to mention that!
I’m on Stretch after updating yesterday (instruction from here). So my version of python is 3.5.3.

@Dean_James Seems like you are in a directory you don’t have access to?

If I try this, might this mess up later Home Assistant updates when it is actually fixed in a newer release?
Or is it safe enough to run this manual commands and installations?

Sorry, maybe I’m the wrong person to be asked about this. I can’t imagine this would cause any harm, because you’re just installing some packages, but on the other hand maybe I’m wrong about this…

This worked for me, thanks a lot :slight_smile:

with the latest hassbian image?

Mine is a stand alone install on Raspbian

Thanks to @Daigo i got it working finally.

five caveats:

  1. you have to stop home assistant before upgrading
  2. you need a recent python version. Update to stretch (link)
  3. if you are in a virtual python env, be sure to activate that
  4. execute the steps from Upgrade to 0.55.0 Ikea Tradfri not working anymore from the /tmp directory
  5. pip3 install cython takes 15-20 minutes on my pi3. And there is no progress bar…

After installing there are nice new features:

You can pass a transition time and simulate a wakeup light:


So, is there an easy way to fix this when running HA in a docker container on a Synology nas?
Justr bought new bulbs today and can’t automate them :wink:
I need my automating fix going!
But dem lights no work! :frowning:

Thanks to @rubyan and @Daigo.
With your tips it now works perfectly again for me :slight_smile:

My HA is running on Openmediavault (Debian Jessie) with manually installed Python 3.6.3.

1 Like

I have been trying all the step recommended here and it says that I have the a the right things installed.
But when starting HA AIO again I get ImportError:No module named ‘aiocoap’

when doing autoreconf I get
aclocal: warning: autoconf input should be named ‘configure.ac’, not ‘configure.in’

The installation instructions are in the process of being updated: https://github.com/home-assistant/home-assistant.github.io/pull/3558

I got it working by re-making my home-assistant virtual-env (note that aiocoap needs python >= 3.4.4, and virtual environments may package the python binary inside them too), and followed the upstream pytradfri async installation scripts, in addition to installing cython with pip (again inside the venv), Note that, as some comments in the PR above states, you need to install autoconf to build too…

Thanks to @rubyan and @Daigo got it working also, new snapshot of the envr, coming up!