Make sure you are running the latest version of Home Assistant before reporting an issue.
You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:
Home Assistant release (0.55
):
Python release (3.5.3
):
Component/platform: Ubuntu 17.04
Description of problem:
I see "[light.tradfri] async support with resource observation. (@lwis - #7815) (tradfri docs) (light.tradfri docs) (breaking change)" in the release note for 0.55
But how do I fix so Tradfri starts working after upgrading?
I followed the installation instructions in https://home-assistant.io/components/tradfri/ again. (hade to rename the libcoap directory.
But I still get the message:
The following components and platforms could not be set up:
tradfri
Please check your config
What should I do?
Expected:
Problem-relevant configuration.yaml
entries and steps to reproduce:
Traceback (if applicable):
Additional info:
Got the same problem, running HA on Ubuntu 16.04
Found this error in the log:
2017-10-08 09:40:18 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
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 6, in <module>
from aiocoap import Message, Context
ImportError: No module named 'aiocoap'
Looks like HA is missing module aiocoap,
I manually installed aiocoap (Debian 9). That got rid of that error, but now I have this:
2017-10-08 01:36:39 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
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'
I've rebuilt libcoap and tried to install tinydtls with pip - no luck.
I've ran into the same error. Following commands from this script helped to fix the problem: https://github.com/home-assistant/home-assistant/blob/master/virtualization/Docker/scripts/aiocoap
It also looks like libcoap
is no longer needed. Apparently, the documentation wasn't updated.
I had the same issue, but now it's working again. Running on hassbian.
@leppa refers to a script, I found the script over here install-aiocoap.sh from /tmp
In my case I had to install Cython as a prerequisite, which takes forever to install/compile on RPI2, 30 mins
I had to install Cython as a prerequisite, which takes forever to install/compile on RPI2
apt-get install cython3
was enough for me.
You need to have specific versions of tinydtls and aoicap installed. See this installation script for details.
I couldn't install tinydtls on macOS without modifications, detailed in https://github.com/ggravlingen/pytradfri/issues/64
Sorry folks, didn't realise we had installation instructions on the component page. I'll update the instructions shortly.
I don't understand, will the tradfri component work with hass.io 0.55?
@ceejii we ran into the same over here (although also python3.5->3.6 here yesterday) - but running the aforementioned script seems to fix it. Maybe wait a little or watch @lwis updates to the docs before upgrading
I can't confim/deny as they sold out of remotes over here and anxiously waiting to pick one up to get started (didn't realise no remotes meant no lights)
home-assistant/home-assistant.github.io#3558
I believe @pvizeli has added support in hass.io.
Hi
I'm running Ubuntu 17.04
Even after executing this script I get the same error:
#!/bin/sh
# Installs a modified coap client with support for dtls for use with IKEA Tradfri
# Stop on errors
set -e
python3 -m pip install cython
cd /usr/src/app/
mkdir -p build && cd build
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls
cd tinydtls
autoreconf
./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 .
After server restart:
2017-10-08 15:09:27 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/tradfri.py", line 115, in _setup_gateway
from pytradfri.api.aiocoap_api import api_factory
File "/home/brunonogueira/.homeassistant/deps/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 9, in <module>
from aiocoap.transports import tinydtls
ImportError: cannot import name 'tinydtls'
2017-10-08 15:09:27 ERROR (MainThread) [homeassistant.setup] Setup failed for tradfri: Component failed to initialize.
It doesn't give me any error during the installation.
Only this warning:
The directory '/home/brunonogueira/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Same here. followed the instructions. but the same error reappears:
2017-10-08 16:10:09 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
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 6, in <module>
from aiocoap import Message, Context
ImportError: No module named 'aiocoap'
@bram2202
I fixed the first aiocoap error with this command: sudo pip3 install --upgrade "aiocoap[all]"
After that I had no longer the aiocoap error but now it gives the tinydtls error :(
I got the tradfri working again with some changes to this script:
https://github.com/ggravlingen/pytradfri/blob/master/script/install-aiocoap.sh
Script after my modifications:
#!/bin/sh
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
mv configure.in configure.ac
autoreconf
./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 --upgrade .
Also the version of tinydtls specified in the script only works with Python 3.4.4+, which won't work for default Raspbian installation (Python 3.4.2).
EDIT: upgrade to stretch may make it work :)
@BrunoN17
used your command, installed some packages.
but still the same error ImportError: No module named 'aiocoap'
@bram2202
Even after sudo pip3 install --upgrade "aiocoap[all]"
?
@BrunoN17 yes, event after the install. tried a second time, everything was up to date.
Same here :(
This script worked for me.
#!/bin/sh
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
mv configure.in configure.ac
autoreconf
./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 --upgrade .
Make sure you run it in the venv if that's how HASS is set up on your machine.
@bram2202
Your HomeAssistant run in a virtual environment?
If yes try to execute the commands in the venv like @mconway said.
My HomeAssistant is not installed in a virtual environment.
@BrunoN17 tried it in venv, still no aiocoap
After installation in the virtual environment I get:
2017-10-08 20:27:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component tradfri
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 107, in async_setup
allow_tradfri_groups))
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 121, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 160, in api_factory
yield from request(Command('get', ['status']))
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 125, in request
result = yield from _execute(api_commands[0])
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 115, in _execute
_, res = yield from _get_response(msg)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 77, in _get_response
r = yield from pr.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/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 "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 863, in _run
blockresponse = yield from blockrequest.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 693, in _init_phase2
yield from self.protocol.fill_remote(self.app_request)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 426, in fill_remote
raise RuntimeError("No transport could route message")
Thanks @BrunoN17! Your lines worked for me!
I'm using virtualenv to run hass and I modified the original script slightly to fit my workflow (I use Ansible to deploy hass to Raspbian)
#!/bin/bash
# need 'apt-get install dh-autoreconf'
# need 'pip3 install cython'
source /srv/hass/bin/activate
set -euxo pipefail
cd /tmp
function install_tinydtls {
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
cp configure.in configure.ac
autoreconf
./configure --with-ecc --without-debug
cd cython
python3 setup.py install
cd ../..
}
function install_aiocoap {
git clone https://github.com/chrysn/aiocoap
cd aiocoap
git reset --hard 3286f48f0b949901c8b5c04c0719dc54ab63d431
# python3 -m pip install --upgrade pip setuptools
python3 -m pip install .
cd ..
}
pip3 show tinyDTLS || install_tinydtls
pip3 show aiocoap || install_aiocoap
The above script will first load virtualenv (in my case /srv/hass), then build and install tinydtls and aiocoap only when they are not present in the site-packages of the virtualenv.
Hi:
Same Tradfri errors after upgrading to 0.55.0.
My environment is an Ubuntu 16.04 server running Home Assistant with virtualenv.
To solve the issue I follow these steps:
1.- Go into virtualenv
2.- Install cython
python3 -m pip install cython
3.- Run modified script from @BrunoN17
4.- Restart Home Assistant
Working fine again!
My environment is Debian 9 and virtualenv.
I follow above instructions and a new error appears (same as @Reidar6)
2017-10-09 13:25:31 ERROR (MainThread) [homeassistant.setup] Error during setup of component tradfri
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 107, in async_setup
allow_tradfri_groups))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 121, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 160, in api_factory
yield from request(Command('get', ['status']))
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 125, in request
result = yield from _execute(api_commands[0])
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 115, in _execute
_, res = yield from _get_response(msg)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 77, in _get_response
r = yield from pr.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/lib/python3.5/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 "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/protocol.py", line 863, in _run
blockresponse = yield from blockrequest.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/protocol.py", line 693, in _init_phase2
yield from self.protocol.fill_remote(self.app_request)
File "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/protocol.py", line 426, in fill_remote
raise RuntimeError("No transport could route message")
RuntimeError: No transport could route message
Hi!
I get these errors on my Hassio 0.55.0
Anyone know how to fix?
2017-10-09 17:17:16 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform tradfri
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 352, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
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/light/tradfri.py", line 54, in async_setup_platform
async_add_devices(TradfriGroup(group, api) for group in groups)
Having the same issue here have tried the fixes. I am running the latest hassbian and homeassistant 0.55
2017-10-09 17:36:32 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
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'
I can see in my python 3.5 folder i have tinydtls installed.
OK I got it working again.
I run Ubuntu 17.04 with HA in a Virtual Environment
To solve the issue I follow these steps (almost as droneando) :
1.- Go into virtualenv
2.- Install cython
python3 -m pip install cython
#!/bin/sh
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
mv configure.in configure.ac
autoreconf
./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 --upgrade .
5.- Restart Home Assistant
In Sweden IKEA will sell all Tradfri with 20% discount from 16 October :)
When I compile (according to @BrunoN17) tinydtls I get this warning:
NU_SOURCE=1 -UNDEBUG -I. -I/usr/include/python3.5m -I/srv/homeassistant/include/python3.5m -c ../sha2/sha2.c -o build/temp.linux-x86_64-3.5/../sha2/sha2.o
../sha2/sha2.c: In function ‘dtls_sha256_final’:
../sha2/sha2.c:641:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
*(sha2_word64*)&context->buffer[DTLS_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/dtls.o build/temp.linux-x86_64-3.5/../dtls.o build/temp.linux-x86_64-3.5/../crypto.o build/temp.linux-x86_64-3.5/../ccm.o build/temp.linux-x86_64-3.5/../hmac.o build/temp.linux-x86_64-3.5/../netq.o build/temp.linux-x86_64-3.5/../peer.o build/temp.linux-x86_64-3.5/../dtls_time.o build/temp.linux-x86_64-3.5/../session.o build/temp.linux-x86_64-3.5/../dtls_debug.o build/temp.linux-x86_64-3.5/../mc-helper.o build/temp.linux-x86_64-3.5/../aes/rijndael.o build/temp.linux-x86_64-3.5/../sha2/sha2.o -o build/lib.linux-x86_64-3.5/dtls.cpython-35m-x86_64-linux-gnu.so
running install_lib
copying build/lib.linux-x86_64-3.5/dtls.cpython-35m-x86_64-linux-gnu.so -> /srv/homeassistant/lib/python3.5/site-packages
copying build/lib.linux-x86_64-3.5/DTLSSocket.py -> /srv/homeassistant/lib/python3.5/site-packages
byte-compiling /srv/homeassistant/lib/python3.5/site-packages/DTLSSocket.py to DTLSSocket.cpython-35.pyc
running install_egg_info
Removing /srv/homeassistant/lib/python3.5/site-packages/tinyDTLS-0.0.0.egg-info
Writing /srv/homeassistant/lib/python3.5/site-packages/tinyDTLS-0.0.0.egg-info
(homeassistant) homeassistant@server:~/tinydtls/cython $
When starting Home Assistant the log shows:
2017-10-10 15:18:44 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:18:45 ERROR (MainThread) [homeassistant.components.climate.generic_thermostat] Unable to update from sensor: could not convert string to float: 'unknown'
2017-10-10 15:18:47 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:18:51 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:18:54 WARNING (MainThread) [homeassistant.setup] Setup of tradfri is taking over 10 seconds.
2017-10-10 15:19:00 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:19:16 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:19:49 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 1016, in _read_ready
self._protocol.datagram_received(data, addr)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 30, in _patched_datagram_received
self.parent._dtls_socket.handleMessage(self.parent._connection, data, 0)
File "DTLSSocket/dtls.pyx", line 258, in DTLSSocket.dtls.DTLS.handleMessage
TypeError: handleMessage() takes exactly 2 positional arguments (3 given)
2017-10-10 15:20:17 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-10-10 15:20:17 ERROR (MainThread) [homeassistant.components.tradfri] Tradfri setup failed.
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 77, in _get_response
r = yield from pr.response
File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/srv/homeassistant/lib/python3.5/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 "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/protocol.py", line 863, in _run
blockresponse = yield from blockrequest.response
File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
aiocoap.error.RequestTimedOut
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 121, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 160, in api_factory
yield from request(Command('get', ['status']))
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 125, in request
result = yield from _execute(api_commands[0])
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 115, in _execute
_, res = yield from _get_response(msg)
File "/srv/homeassistant/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 83, in _get_response
raise RequestTimeout('Request timed out.', e)
pytradfri.error.RequestTimeout: ('Request timed out.', RequestTimedOut())
2017-10-10 15:20:17 ERROR (MainThread) [homeassistant.setup] Setup failed for tradfri: Component failed to initialize.
2017-10-10 15:21:50 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/transports/tinydtls.py", line 157, in _run
yield from self._connecting
File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 266, in result
raise CancelledError
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/transports/tinydtls.py", line 169, in _run
self.coaptransport.new_error_callback(-1, self)
File "/srv/homeassistant/lib/python3.5/site-packages/aiocoap/protocol.py", line 203, in _dispatch_error
for key, (monitor, cancellable_timeout) in self._active_exchanges.items():
AttributeError: 'NoneType' object has no attribute 'items'
This is HA 0.55 in VE on Ubuntu 16.04.3.
Still not working on my installation....
Any idea??
2017-10-13 18:25:55 ERROR (MainThread) [homeassistant.setup] Error during setup of component tradfri
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 107, in async_setup
allow_tradfri_groups))
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 121, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 160, in api_factory
yield from request(Command('get', ['status']))
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 125, in request
result = yield from _execute(api_commands[0])
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 115, in _execute
_, res = yield from _get_response(msg)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 77, in _get_response
r = yield from pr.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/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 "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 863, in _run
blockresponse = yield from blockrequest.response
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 693, in _init_phase2
yield from self.protocol.fill_remote(self.app_request)
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/aiocoap/protocol.py", line 426, in fill_remote
raise RuntimeError("No transport could route message")
RuntimeError: No transport could route message
@Reidar6 you can always rollback to 0.54 until a fix is released
pip3 install homeassistant==0.54.0
@nicxe thanks, did a rollback and it works like before.
I had the same problem as @Reidar6.
I
apt-get remove cython3
and in the venv:
pip uninstall aiocoap
pip uninstall cython3
then repeated @Pethson script.
Not sure which step fixed it but it works now.
Tried again, still wrong. Feels like an idiot. Just returning to 0.54 again ... Does anyone have a step-by-step (just to cut and paste line by line) guide for Dummys? :) I probably use wrong User/command/path or whatever somewhere.
I can't believe that this isn't fixed after a week. I'm stuck with 0.54.0. Did the developers are reading those issues?
Still stuck at 0.54 because of this. If cython3
is now a dependency (and indeed a very specific dependency) for this component and it must be installed in the hass virtualenv, then it should be clearly stated in the official documentation here: https://home-assistant.io/components/tradfri/
Is this is just a transition problem or a regression hope this will be fixed soon...
I can’t believe your comment @vpnmaster . Home assistant is a free softwear developed by people spending there free time without any payment.
If you so badley need the issue to be sorted I recommend that you contribute with a solution your self instead of complaining.
However, there is plenty of way to fix the issue if it’s a game changer for you to run 0.55 instead of 0.54 for a week or two. Maby not that convenient as you wish but there is ways!
Hi folks,
cython
will be a dependency for DTLSSocket
, and the docs will be updated in due course to reflect the new installation process for the component.
@Nicxe Sorry, I didn't want to be rude. It made me nervous to try to install the new version and then rollback. Several times. And it's the lights component. The most important in automation.
@vpnmaster I have successfully installed 0.55 with working tradfri on a fresh install of both Hassbian and Hass.io. So if you desperately need 0.55 right now do a fresh install and copy over your config files
As @javefang mentioned, Raspbian Jessie with its python-3.4.2
does not fulfill aiocoap
's requirement for python->=3.4.4
So I upgraded to Raspbian Stretch with python-3.5.3 and ran the commands in install-aiocoap.sh
.
After that, homeassistant-0.54.1
did still not work (same error as @Reidar6).
I then upgraded to homeassistant-0.56.0
with tradfri
based on pytradfri-3.0
. This new version requires cython as dependency of DTLSSocket==0.1.3
, so do: pip3 install cython
before (takes a loooong time).
With this tradfri
on homeassistant-0.56.0
seems to work for now!
version 0.56 is not working for me. When I try and run pytradfri directly. I get error with pytradfri
python3 -i -m pytradfri gatewaypi key
https://github.com/ggravlingen/pytradfri/issues/72
I did try installing DTLSSocket==0.1.3 and pip3 install cython directly however didn't seem to help.
pytradfri 2.2.3 works for me but I think hass reinstalls pytradfri 3.0.2 on start
@tactmaster what's the error you're seeing in HA? We don't use libcoap in HA, so the issue raised (albeit valid) can't be relevant to the issue you're seeing in HA.
tinydtls is installed via
#!/bin/sh
git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git
cd tinydtls
autoreconf
./configure --with-ecc --without-debug
cd cython
python3 setup.py install
2017-10-24 17:42:22 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 119, in _setup_gateway
from pytradfri.api.aiocoap_api import api_factory
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 9, in <module>
from aiocoap.transports import tinydtls
ImportError: cannot import name 'tinydtls'
2017-10-24 17:42:22 ERROR (MainThread) [homeassistant.setup] Setup failed for tradfri: Component failed to initialize.
2017-10-24 17:42:30 WARNING (MainThread) [homeassistant.setup] Setup of media_player is taking over 10 seconds.
2017-10-24 17:42:36 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-10-24 17:42:58 ERROR (MainThread) [homeassistant.components.tradfri] Looks like something isn't installed!
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 119, in _setup_gateway
from pytradfri.api.aiocoap_api import api_factory
File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 9, in <module>
from aiocoap.transports import tinydtls
ImportError: cannot import name 'tinydtls'
You shouldn't install anything other than cython, the component installs everything for you.
Well apologies , obvious something has got mess up with the dependency on in my venv on my system. I set up a new venv (https://home-assistant.io/docs/installation/virtualenv/) using the same setting. It worked perfectly, 👍
Good stuff 👍
Still no luck with this. After upgrading to any version > 0.54.0 Ikea Tradfri component stops working.
Tried to reinstall all in a fresh virtualenv, tried with cython (before installing hass), tried to install tinydtls and aiocoap with the previous procedure but still no luck.
Hope this will be fixed soon...
Note: the python version in my virtualenv is 3.5.3
For the moment there the new firmware to IKEA´s gateway are causing home assistant to stop working with Trådfri. The developers have just completed the fix that will be integrated in 0.57 that releases this weekend. So you can try and try but in would not work until the next release.
@Nicxe I've tried all this before the gateway firmware upgrade.
However I'll wait the 0.57 and hope for a improvement in this.
PS. Any chance to remove the cython/libcoap/tinydtls binary requirements? Ideally a pure-python package to manage all Tradfri components will avoid all these issues!
@fabfurnari libcoap is only a requirement if you're using the lib directly in a sync way. cython is a dependency of DTLSSocket, and pyDTLS doesn't support Python 3 due to some outstanding bugs in the Python TLS stack. Basically, these were not choices.
@lwis thanks for clarification. Do you think the new turn in hass involvement with official Ikea Tradfri team will lead some benefit for this particular scenario?
It's unlikely, but good to know they are aware people are using the coap
API.
On Thu, 2 Nov 2017, 8:34 pm Fabrizio Furnari, notifications@github.com
wrote:
@lwis https://github.com/lwis thanks for clarification. Do you think
the new turn in hass involvement with official Ikea Tradfri team will lead
some benefit for this particular scenario?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/9752#issuecomment-341549631,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA1TO_t4rWTfUXj4j6QFIsyrkviOBNfyks5syidMgaJpZM4Pxn63
.
Hi. struggling with this also... after fw upgrade on tradfri gateway.
now I did try it out on HA 0.57.3 and still no luck.
Also tried using examply_sync.py from this location and could not make it work.
Traceback (most recent call last):
File "example_sync.py", line 107, in <module>
run()
File "example_sync.py", line 49, in run
psk = api_factory.generate_psk(sys.argv[2])
File "/home/xt/Desktop/pytradfri-master/pytradfri/api/libcoap_api.py", line 156, in generate_psk
self._psk = self.request(command)
File "/home/xt/Desktop/pytradfri-master/pytradfri/api/libcoap_api.py", line 93, in request
return self._execute(api_commands)
File "/home/xt/Desktop/pytradfri-master/pytradfri/api/libcoap_api.py", line 82, in _execute
raise RequestTimeout() from None
pytradfri.error.RequestTimeout
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:
Closing this as there have been no updates since last November. Please open a new issue if this issue persists.
Most helpful comment
I can’t believe your comment @vpnmaster . Home assistant is a free softwear developed by people spending there free time without any payment.
If you so badley need the issue to be sorted I recommend that you contribute with a solution your self instead of complaining.
However, there is plenty of way to fix the issue if it’s a game changer for you to run 0.55 instead of 0.54 for a week or two. Maby not that convenient as you wish but there is ways!