IKEA Trådfri Gateway [Zigbee]

Does anyone know the answer on this?

I bought Tradfri specifically to have a quicker “motion sensor -> turn on light via Hass” solution.

and I was waiting before buying it, for the same :smiley:

The motion sensor works like a remote control. I don’t think that it will communicate with the hub about their status.

If i’m right then there is no chance to integrate it into home assistant.

I read on heise.de (in german) that this system differs from hue and lightify.

Anyone else struggeling with the “FileNotFoundError: [Errno 2] No such file or directory: ‘coap-client’” error?

I’m just about to give up and reinstall HA completely.
I’ve used the component on my hass.io instance, but decided to setup a regular installation because I’m missing alot of stuff in the hass.io, so I know how it works and that it actually works :slight_smile:

I have removed autoconf + libtool, deleted the .git archive from my machine, removed any config lines refering to tradfri, rebooted the server.
I’m running it on a Ubuntu 17.04 Zesty and the latest version of hass running in a python virtual environment

Reseted the gateway (pushed the pinhole for 5 seconds untill it stopped blinking and I had to rescan my remote+lights)

I reinstalled libtool+autoconf, downloaded the git, executed the instructions found at the IKEA tradfri component page.

But i still get below errormessage.

2017-06-29 19:05:38 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 97, in gateway_discovered
allow_tradfri_groups)
File “/usr/lib/python3.5/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tradfri.py”, line 116, in _setup_gateway
api = retry_timeout(cli_api_factory(host, key))
File “/home/homeassistant/.homeassistant/deps/pytradfri/coap_cli.py”, line 104, in api_factory
request(‘get’, [‘status’])
File “/home/homeassistant/.homeassistant/deps/pytradfri/coap_cli.py”, line 56, in request
return_value = subprocess.check_output(command, **kwargs)
File “/usr/lib/python3.5/subprocess.py”, line 316, in check_output
**kwargs).stdout
File “/usr/lib/python3.5/subprocess.py”, line 383, in run
with Popen(*popenargs, **kwargs) as process:
File “/usr/lib/python3.5/subprocess.py”, line 676, in init
restore_signals, start_new_session)
File “/usr/lib/python3.5/subprocess.py”, line 1282, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: ‘coap-client’

If i type

coap-client

in the terminal as normal user (not in virtual environment I get a list of command i can use.
If i stop HA and login as the homeassistant user and activate the virtual enviroment I get the same commands list

If I do a “which coap-client”, this is the results

/usr/local/bin/coap-client

I’ve checked the .py files that shows up in the error logs, but I cant find any pointers to the actual path, so not sure If i need to edit anything there maybe.

Any suggestions?

Just installed a fresh Ubuntu 16.04 server with only the latest hass version running in pything virtual env, then followed the IKEA tradfri component instruction again, and I keep getting the exact same errormessage.

If i dont try to “push” my IP+API key I dont get an errormessage, but if i do either of these two, the message appears… :confused:

  1. Adding the lines to configuration.yaml (with my info of course)
 tradfri:
   host: IP_ADDRESS
   api_key: API_KEY
  1. Or creating a tradfri.conf file in the root folder (same as configuration.yaml) with the line

{"192.168.1.XX": {"key": "xxxxxx"}}

Exactly this configuration is working on the hass.io version, but in that version I didn’t have to use the instruction, I just enabled the tradfri component using any of the 2 ways above.

Hello!
I’m having a problem with only trådfri and I’m assuming that is a little bug.
I can’t use the option scan_interval on the trådfri configuration on configuration.yaml.

More info in this topic: Refresh Time

Thanks

Tried reinstalling it again (10th time now i think), did a apt-get remove --purge of libtool + autoconf before.

When executing the ./autogen.sh command

pi@HomeAssistant:~/libcoap$ ./autogen.sh

[HINT] You can run ‘autogen.sh --clean’ to remove all generated files by the autotools.

Found ‘autoconf’.
Found ‘aclocal’.

Couldn’t find ‘libtool’!
Found ‘libtoolize’.

—> Found all needed tools! That’s fine.

Could this be a reason for my issues?

I finally found the reason for my issues by misstake, I were troubleshooting another component (ICMP ping) and went deeper into permissions and PATH issues, it seems like I’ve added a line to my systemd service which disabled the use of my original OS path’s

It was the rows with ‘#’ before them, except the first row of course since thats an actual comment.
I hope this might help someone else who’s making stupid misstakes :wink:

[Unit]
Description=Home Assistant
After=network.target

[Service]
Type=simple
User=homeassistant
# Make sure the virtualenv Python binary is used
# Environment=VIRTUAL_ENV="/srv/homeassistant"
#Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Have you got an answer on this ? I would also like to know.

From the looks of it, the motion sensor communicates directly with the bulbs without going through the gateway so it’s currently not possible to do what you look for.

I thought I answered in this thread as well, but it seems i didn’t: At this point (who knows what’ll happen when Ikea releases their update) it is not possible to capture motion state from the PIR sensor. it triggers the light directly.

Recently, my gateway starts to stop responding to pings (which I check via HASS) and is therefore also unavailable for HASS. I then need to power it off and on to make it work and respond again. Does someone encounter similar issues?

Before it worked weeks without this issue, know I need to power it off once or twice a week.

I’ve got that one as well. Haven’t been able to pin down the source yet.

I also have not been able to find any source. But its really annoying if the gateway stops working. I am already considering to power it on/off via a controllable power socket in order to prevent it from being unresponsive.

Anyone else having this issue?

A contributor to OpenHAB has figured out that Tradfri will allow you to have “empty” groups that contain only a switch but no lights - and that the state of the group (off/on) is still updated when the button is pressed, even though there are no lights. (See: https://community.openhab.org/t/ikea-tradfri-gateway/26135/75 and see also pull request to that project here: https://github.com/eclipse/smarthome/pull/3799). Thus, other components can be controlled with the Tradfri switch.

I’ve fiddled around with my Tradfri in HA with the “allow_tradfri_groups” config directive but the status of the group reported in HA doesn’t seem to be updated on button presses - I need to test this more to be sure if it’s HA or something about the way I’ve set Tradfri up.

There’s no mention of motion sensor in the above links but maybe it works the same way? I.e. An empty group is still turned “on” by motion?

8 Likes

I have retested and can confirm: Tradfri switch in a group by itself in the Tradfri app will toggle the group’s state on and off in HA when the group is passed to HA with the “allow_tradfri_groups: True” directive in the config.

The same does not appear to be true for the motion sensor, sadly.

This is really cool news! Mind adding it to the site documentation for Tradfri?

(This page: https://home-assistant.io/components/tradfri/)

@marthocoo I just tried this but it seems VERY slow on updating the status from off->on / on->off and that means its unusable, is that also your experience ?

Yes it is currently slow (5-10 seconds) and unreliable (a button press may or may not change the HA state either off or on). So not usable to trigger automations at the moment, but I put this down to the implementation in HA, which should improve.

The interesting part though is that, at least when the switch is in a group by itself, it does communicate with the bridge, which previously was not thought to be the case.

1 Like

So i’d like to know from users that have the IKEA Remote (5 button) if they see that occasionally the lights does not react to the button push like it’s misses the button push ? I see the remote using my own implementation together with RaspBee gateway occasional misses a button press and i’d like to know if anybody also experience that with the IKEA HUB/Gateway