Ikea Tradfri State not updating

Hey All,

Anyone got the Ikea tradfri updating the state in HA? if someone uses the controller to put the lights on the state isn’t being passed back to my HA so the switches are off even though the lights are on! Annoying, i see from posts this is has worked fine in the past, anyone else suffering the same problem?

Versions:
HA: 0.75.3
Tradfri Gateway: 1.4.15

the tradfri gateway is picking up the states so i guess its a HA problem?

Hi,

Also having Tradfri issues the last few weeks:
Setup:

  • group of 3 lights in office, group of 2 lights in living room
    Behaviour:
  • HA shows all office lights on, but they are off. HA shows living room group off but it’s on. State is correctly shows in Tradfri app.
  • clicking on a HA group sometimes does something, but it’s children entities are not updated or vice versa
  • sometimes it’s not possible to change the state anymore, and the lights are stuck (on or off)
  • the automations I have (turn on with this brightness and this color) always work reliably

Note: logs show various entries with
2018-08-27 12:42:59 WARNING (MainThread) [homeassistant.helpers.entity] Update of light.living_ikea is taking over 10 seconds
and
2018-08-27 12:33:01 WARNING (MainThread) [homeassistant.components.light.tradfri] Observation failed for living IKEA Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 92, in _get_response r = yield from pr.response File "/usr/local/lib/python3.6/site-packages/aiocoap/protocol.py", line 816, in _run_outer yield from cls._run(app_request, response, weak_observation, protocol, log, exchange_monitor_factory) File "/usr/local/lib/python3.6/site-packages/aiocoap/protocol.py", line 865, in _run blockresponse = yield from blockrequest.response aiocoap.error.RequestTimedOut

Any hints on how to debug this? Given that the tradfri app always shows the correct state I’m inclined to think this is a HA thing. It used to work correctly, somewhere before the lovelace introduction.

Versions:
HA: latest Hass.io
Tradfri Gateway: 1.4.15

Hi Mike,

My issue was a little easier, I had added the tradfri group to ha rather than using a custom ha group. I found there is a distinct difference. The state of the group of lights only works if you use a HA defined group. There is no such thing as the state of a tradfri group (not that I could see) other than the individual bulbs. I fixed my issue by defining my own groups and add each bulb to them within config. It then made the front end nicer in the fact when you click on the group it showed me each bulb.

See the icon with the three dots, when I switch a light on that state updates. Also when you select it, it expands all of the bulbs. Does your group icon look the same?

This might not be you’re issue but worth a try. I also read somewhere if your TRÅDFRI gateway is on a different subnet to ha it can cause problems as well.

thanks for the reply, I tried your suggestions but I had HA groups as well so that was fine.

Eventually, the problem was in my moonphase entity, this was giving an error regarding a missing template.
This apparently generated the funky behaviour in the light switches.

A bit unexpected, but be sure to scan your logs for seemingly unrelated errors if you have this behaviour.

Hi Mike!
I have the same problem with my Ikea trådfri lights as you are describing. Im not sure what to look for regarding this. If I restart HA everything works fine for a while but it doesnt take to long before the same behaviour is back.

Hi Fosselius,

My biggest problems came from an error in the logs, so make sure to click the information icon and then the refresh icon to see all the logs and errors.

Tradfri is still not perfect at the moment, but only very occasionally and probably to do with cycling power to the lamp - still looking to reproduce it reliably. Ikea app on android always shows the correct state so It should be possible to do equally well in HA.

Hope you find what’s giving the issues! A gateway restart sometimes helps, but of course not ideal solution.

Had another issue where I could turn on lights but not turn them of again, well I could in the UI but not in reality. A HA restart fixed the issue. Not a final solution of course, but it beats restarting the ikea gateway.

Mike

1 Like

Hi
Yeah, I have the same issues. A HA restart usually makes it better but not for long. I have a automation that should kick in when a TRÅDFRI lights is turned on but that never happens.

So, something in the communication between HA and the TRÅDFRI gateway is corrupt

Just ran into problem today. I know about the tradfri group not reporting state, but this is something different. The light switches in HA work, but the state is not saved/reported back. So I can turn on the light, but the state will switch back to off, so I cannot turn off the light with the same switch. Same other way around.

if I use the tradfri remote the state in HA is not updated. So seems like a communication issue, the commands are sent but they are not confirmed ?

Nothing in log, everything else is working normal.

1 Like

Has it just started happening?

It’s a first for this issue.

I’ve had issues where the gateway simply stops responding (ikea app not working either) seems to be related to a number of HA reboots (because of initial setup/config of HA). When this happens I have to reboot both gateway and HA.

Ah ok, so not the same issue as me then.

I’m putting it down to the fact that the tradfri stuff is only about a year old so not as mature as your Philips hue’s of the world

I been getting these issues in the last 2 months before that it was working fine. So I would say that something has happened in the communication between HA and the IKEA gateway.

Mine doesn’t look like that, and if I click on “Kitchen” the rest of the lights won’t appear there.

Say for example you turn on Kitchen WS 1. Does your main Kitchen switch turn on as well?

And if you turn the light on with the tradfri remote, does the Kitchen state change as well?

The issue I have is that I can turn on the light with the Tradfri remote, the individual lights show as on but the group is not changed. So if I want to turn it off from HA I have to switch the group on and then off.

Yes to both of your questions. Don’t use the default group imported when you integrated tradfri. Setup a separate group and add each bulb yourself. So I created a group like this

kitchen_group:
view: no
name: Kitchen
entities:
  - light.kitchen_ws_1
  - light.kitchen_ws_2
  - light.kitchen_ws_3
  - light.kitchen_ws_4
  - light.kitchen_ws_5
  - light.kitchen_ws_6
  - light.kitchen_ws_7
  - light.kitchen_ws_8

Notice view is set to no that’s because I add group.kitchen_group to my frontend instead. You end up with this, which works and alters the state of the master switch even if one bulb is on as well as if someone uses the remote.

1 Like

Thanks. So it’s a group within a group.

I have added it and now it’s working fine.

1 Like

Yep, no probs, I think the original group is part of the import of the lights and for some reason doesn’t operate the same

1 Like

Hello everyone
I’m having the same issue.
When i restart Home Assistant, the light status is in sync with the Tradfri App.
After a while the lights can not be turned off again. If the lights are being turned off with the Tradfri App the lights can be turned on again with Home Assistant, but the status will not be updated correctly.

A restart of Home Assistant is solving the problem for a few hours.
Has anyone found a solution to the problem?

Home Assistant Version 0.87.0
IKEA Tradfri Firmware: 1.4.15

1 Like

Hi,
Same thing happening a lot to me too. It’s been worse the last 2 months, but it occurred earlier as well. This morning it was out of sync so I restarted HA but this time Trådfri didn’t even start. See image attached.

How can we troubleshoot this?

I have the same issue as well.
After some hours Tradfri app and Home Assistant do not sync status. Restart Home Assistant do solve the issue for a couple of hours.

Even tried a fresh install (just Home Assistant and Tradfri) and the issue is there as well. The logs are blank…

Does anyone have a solution for this problem?

Home Assistant Ver 0.87.1