Hey there,
I can’t help myself anymore and I BET the first answer somebody throws in will be “It’s your Wi-Fi!”. But listen first
I’m using HA since a few months now and I freaking love it, but one issue drives me F’ING CRAZY!!!
But here’s my setup first:
- HA running using Hassio, using a Raspberry Pi 4 Model B, 4GB Ram (everything always kept up2date)
** The RPi is connected via LAN cable to a TP-Link DLAN adapter (see below). But I also tried connecting it directly to the FritzBox (via LAN) for around a week, which had no effect on the issue - SD Card: SanDisk Extreme microSDXC 64GB, Class A2
- Router: Fritz!Box 7530
** The Fritz!Box is located pretty much in the middle of my 85qm² apartment - Two TP-Link D-LAN Adapters, newest Gen, 1300MBit (effectively doing only 300-600, but whatever…).
Wi-Fi setup:
After having the issues I will report below since ever using HA, I thought: “Maybe IT IS your Wi-Fi…”. So I switched away from this:
- Fritz!Box provides a 2.4GHz and a 5GHz Wi-Fi (with different SSIDs, but they join the same network, so devices can see each other)
- Both TP-Link D-LANs act as a Mesh-Repeaters for both 2.4 and 5GHz Wi-Fi, but send the data over D-LAN to an adapter directly connected to the Fritz!Boxs LAN Port. So the standard setup for D-LAN range extending.
To this:
- Fritz!Box still provides a 2.4GHz and a 5GHz Wi-Fi,
- But the D-LAN adapters only repeat the 5GHz Wi-Fi.
So all 2.4 GHz devices (so 90% of all smart home devices) connect directly to the Fritz!Box. With that, I was hoping to eliminate the below, but it is still persistent. This is also a reason why I think it is not my Wi-Fi, as it happened when they had a super strong / excellent signal (because of the D-LAN repeaters) and now with a still great to excellent signal.
My actual issue:
Since I use HA, I have devices / entities that keep changing to “unavailable”, just to come back after 25-30 seconds. I see this across (not all, but) many Wi-Fi devices, 2.4 stronger affected than 5GHz. But overall, they all have this at least once per day or every few days.
Devices that are affected super strong by this are my Yeelight Bedside Lamps (obviously located in the bedroom). They change to unavailable 50-70 times a day(!!) / around 5-7 times per hour, just to come back 25-30 seconds after. I also have a couple of Yeelight Smart Color Bulbs and Ceiling lights. Also they have that issue, but way less frequent. Even the Ceiling lamp in the same room as the Bedside lamps have this waaay less often.
The next more frequent device having this issue is my Chromecast Ultra (located in the living room, conencted to the 5GHz Wi-Fi to a DLAN repeater right next to it). It does that also a couple of times per hour. Actually it got worse in the last week: Before, I didn’t even realize it doing this. Now I see it happening more often, as I have an automation that reacts on the Chromecast changing inputs or changing to “playing” or “not playing”. And I see this automation now triggering 2-3 times per hour, as it changes color of a few lights…
Another device that does that pretty often is an ESP running WLED (located in the office). Also becomes unavailable very often just to come back ~30 seconds after.
So what I actually see in the log book is this:
But for a lot of entities / devices. If I look into the actual log file, I see this for the bedside lamps most of the time:
2020-09-16 20:43:29 ERROR (SyncWorker_49) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: Bulb closed the connection.
2020-09-16 20:43:29 ERROR (SyncWorker_49) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: Bulb closed the connection.
2020-09-16 20:58:54 ERROR (SyncWorker_50) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: Bulb closed the connection.
2020-09-16 20:58:54 ERROR (SyncWorker_50) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: Bulb closed the connection.
But sometimes also this:
2020-09-16 20:37:41 ERROR (SyncWorker_16) [homeassistant.components.yeelight] Unable to update device 192.168.178.40, [Living Room] Big Lamp: A socket error occurred when sending the command.
2020-09-16 20:37:41 ERROR (SyncWorker_16) [homeassistant.components.yeelight] Unable to update device 192.168.178.44, [Living Room] Small Lamp: A socket error occurred when sending the command.
2020-09-16 20:37:54 ERROR (SyncWorker_16) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.
2020-09-16 20:37:54 ERROR (SyncWorker_16) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.
That’s the WLED error:
2020-09-16 20:37:56 ERROR (MainThread) [homeassistant.components.wled] Error fetching wled data: Invalid response from API: Timeout occurred while connecting to WLED device.
I also see other kinds of connection issues for various devices (but maybe like ~5 times a day), like
- the tado bridge (for my room thermostats),
- the Reolink E1 Zoom camera
- My Shelly 2.5s (controlling my roller blinds) and a Shelly 1
- I even see things like this for the NabuCasa cloud I’m testing since this month:
2020-09-16 02:51:12 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
2020-09-16 02:51:17 ERROR (MainThread) [snitun.client.client_peer] Can't connect to SniTun server eu-central-1.ui.nabu.casa:443
2020-09-16 02:51:17 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
or:
2020-09-16 03:11:10 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
While I agree this absolutely smells like my Wi-Fi is crap, I have to say: I have zero issues with my network at home, neither does my Chromecast, nor any lamp I’m using (when I was using it via the Yeelight app), nor any PC conencted to Wi-Fi or via LAN to one of the D-LAN adapters. I even work from home since April, constantly having a VPN connection open that tunnels my whole PC traffic, including a Twitch stream sometimes and I have ZERO issues.
I also tried pinging both bedside lamp simultaneously from my PC and from the console within HA: 2000 packets sent, ZERO packet loss. But HA kept saying the bulb is unavailable and comes back…
It’s only HA having issue reaching all of these devices quite often and I’m really out of ideas.
Do you have any suggestions where I could still try to find what the issue is?
- If you really still think it’s the Wi-Fi: How would I reliably test / verify it and find the cause?
- Is the RPi 4B with 4GB RAM to underpowered maybe?
Please help me. I am so overwhelmed with HA and full of joy. But on the other hand, this issue makes me soooooo frustrated and more often now interferes with my automations logic or things just happen randomly, as an automation gets triggered because a Shelly or the Chromecast comes back…
Thanks and greetings,
Andy!