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.
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…
short update: I tried to figure out if there is something network-related which keeps the Tradfri from updating. So i added specific rules to the Raspberry’s ufw firewall for the coap port and added a switch so the Fritzbox shouldn’t be in the way when communication with the Tradfri gateway. But in fact, this doesn’t make any difference. I still have errors logged:
2019-08-04 18:45:57 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal read error on socket transport
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 801, in _read_ready__data_received
data = self._sock.recv(self.max_size)
OSError: [Errno 113] No route to host
Sometimes it says “[Errno 110] Connection timed out” instead of “[Errno 113] No route to host” but it’s always selector_events.py at line 801. When pinging the gateway from the commandline, everything shows up well.
Hi All,
My problem is similar, but still different; I have set group import to true and the Tradfri GW Groups are correctly imported into HA, but they do not get state information unless i trigger them (on/off) manually in the Lovelace interface. Each individual bulb in each group correctly shows state information.
Now, the reason I expect this to work, is because it did work correctly the first time I set up the Tradfri integration. But then a few weeks later into the project, I had to reset the GW and start over again. And since then, Groups never show state info unless triggered manually.
I have tried to delete the integration and re-initialize it, but to no avail. I have also manually deleted the groups from core.entity_registry and let HA add the groups again automatically, but they still fail to show state change.
Any ideas anyone?
Next Update: Since running 98.0 everything woorks as expected. Did regular updates on the machine via apt and updated Home Assistant - works finde now since 3 weeks, no more log entries… I have literally no idea what fixed this, because the 98.0 changelog doesn’t tell anything related to the Tradfri integration…
I don’t think so. Tradfri hub was restartet regularly while i was diagnosing the error and never made it more than 8 hours - now we have 3 weeks, so i suspect something was changed or maybe a python upgrade on my machine “fiexd” the issue…
The update issue when switching (TURNED-ON) lights off with a regular switch is really bogging me from the beginning of this year. I have more then 20 tradfri light devices and about 5 tradfri switches.
For long I have used the following YAML for each light:
This worked perfect for the last months. Since this week I have set this kind of trick over to node-red where it is easier to chain those tricks to avoid overloading of the tradfri gateway.
Sadly this trick is not working with the tradfri switches as there are no extra attributes to push out. I guess that the gateway is trying to be smart…
Because I have invested quit a lot in the IKEA crap I’m thinking to bring everything back but I guess customer service has no clue what we are talking about.
Hey thanks for your idea, to solve the problem. Because i have several lights i’ve wrote an python_script (Python Service Call in HomeAssistant), that filters all lights that are state ‘on’ and sends a fake call_service to check if they are unavailable.
The code (file: update_tradfri_lights.py in config folder)
# Script: Check lights if they are still on
# Iterate through all lights
for entity_id in hass.states.entity_ids('light'):
# Filter lights who are in state 'on'
if hass.states.get(entity_id).state == 'on':
# get brightness of light
brightness_of_entity = hass.states.get(entity_id).attributes['brightness']
# Make a Fake Service Call to update the light
# logger.info(f"{entity_id} is {hass.states.get(entity_id).state} with brightness level of {brightness_of_entity}")
service_data = {'entity_id': entity_id, 'brightness': brightness_of_entity}
hass.services.call('light', 'turn_on', service_data, False)
I gave up on this and have found that there are two scenarios that Trådfri enters when it gets unresponsive. It is not an optimal way of solving it but I got fed up that I’m not able to turn on an of lamps and that my automations got stuck due to that I was not able to read states from my entities.
Scenario 1:
Light entities enters state: unknown, none or unavailable. Choose one entity that you want to have as verification entity. I also use this for some other integrations to make sure that they get restarted when they stop working. Please note that the script for restart is below in this text.
For this scenario I made this automation:
Scenario 2:
Trådfri is working but state is not updated for entities.
First select one entity as your verification entity. Preferably it is a lamp in a wardrobe that is ok to turn on and of at a regular pattern for 1 second. Please note that the script for restart is below in this text.
For this scenario I made this automation.
Hi guys, I have same issue with Ikea Tradfi Integration in my Home Assistant. If a bulb was lights off with the regular switch the status remain ON also if unavailable. How to solve?
I tried all the last 3 solutions of this thread but (if I didn’t wrong) without success.
Please, help me. This driving me crazy. Thanks to all