Too many sensors? network bogged down?

Hi,
I’m getting loooooooads of errors in my log relating to sensor update timeouts like these…

2019-01-12 20:43:16 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:16 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:17 WARNING (MainThread) [homeassistant.components.media_player] Updating sonos media_player took longer than the scheduled update interval 0:00:10
2019-01-12 20:43:18 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:18 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:19 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2019-01-12 20:43:20 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:20 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:21 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:05
2019-01-12 20:43:22 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from unifi took longer than the scheduled scan interval 0:00:12
2019-01-12 20:43:22 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:22 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:24 WARNING (MainThread) [homeassistant.components.switch] Updating tplink switch took longer than the scheduled update interval 0:00:30
2019-01-12 20:43:24 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:24 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:25 WARNING (MainThread) [homeassistant.components.sensor] Updating uk_transport sensor took longer than the scheduled update interval 0:00:30
2019-01-12 20:43:25 WARNING (MainThread) [homeassistant.components.sensor] Updating darksky sensor took longer than the scheduled update interval 0:00:30
2019-01-12 20:43:26 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:26 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:27 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:05
2019-01-12 20:43:28 WARNING (MainThread) [homeassistant.components.media_player] Updating sonos media_player took longer than the scheduled update interval 0:00:10
2019-01-12 20:43:28 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rest binary_sensor took longer than the scheduled update interval 0:00:01
2019-01-12 20:43:28 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:00:01

I recently upgraded to 0.85 and I thought this might be the reason behind it but I’ve since rolled back to a version on 0.84 (using a VM recovery tool I use - Veeam) and there’s no change.

I also originally thought this was purely a Philips HUE connectivity issue however HA seems to also struggle with other sensors I have too.
It makes me think this is more to do with my network under-performing however (as far as I’m aware) there’s been no change in Firewall rules on my IoT VLAN (where HA sits).

Can anyone point me in the right direction to diagnose this? The HA VM can ping all the relevant services it needs to so I know there’s working connections between them.

FYI HA is running in docker-compose

PS I’ve tried deleting the v2.DB and rebooting but there’s no improvement

What hardware and base operating system are you running on?

What are the CPU and memory usage looking like?

How much cores and ram?
And network layout/specs?

I have HASS.IO running on FreeNAS Bhyve VM with 5 virtual cores (ryzen 1700x) and 2000MB RAM, 30+ tasmota devices and loads of components and sensors, it only starts up slow but no problem after that. CAT6 cables and a high end tplink router. No problems on this side.

My logs do show some similar to yours, (timeouts) but after startup it retries i guess…

4 vCPUs @ 2.2GHz
4 GB RAM

Total of 8-10 Hue light bulbs and 6 motion sensors and a couple of Sonos speakers. Nothing that I would consider taxing by any stretch of the imagination ?!

Well below capacity looking at the vCentre running stats for this VM (circa less than 25% on both CPU and RAM)

It probably has more to do with network traffic than your CPU power…how many devices are you running on wifi?

i would be inclined to agree. fortuitously we’ve actually had a power cut here this morning which knocked out all my servers and entire network (lasted too long for the UPS batteries). I’ve since brought everything back online and the problem has vanished !!

For future reference, if you struggle with similar problems, put in a word with God to blast some trees down near a substation and you’ll sort it !!

if rebooting the network (router and switches) fixed the problem, it could be that you had too many devices trying to talk on your network and causing a broadcast storm. Power cycling everything fixes it, but the fix might only be temporary. I am having to remove some of my wifi devices because of this and replacing some of them with zigbee devices. This improved the stability tremendously.

Thanks for the info. I only generally have between 15-20 WiFi clients at any one time unless you think this is too many?
I’ve been wondering whether to finally push the button on moving all my networking gear over to Unifi line - this may well be the end result from all this.

On a positive note, HA has been ticking along just fine for months now so if this happens again I’m hoping at least the same amount of time / use will be had!

Fingers crossed and let’s see…

It really depends on your router. Some routers can’t handle too many concurrent connections on wifi, especially if they are talking to a server in the cloud. If your devices are only talking to HA, then you might want to see about getting another access point. I have a Buffalo Airstation Pro, which can accept up to 25 concurrent connections guaranteed with no issues. I have heard of others who run 50 or more wifi devices on Netgear products (but probably not concurrently) but with little to no issues.

1 Like

I thoroughly recommend ubiquiti/unifi access points. They have solved almost all my wifi problems. (There is still a dead spot in one bathroom, but not a real life problem.)

yeah, I already run them (UAP-LR’s) so don’t actually think this was the problem. I’m thinking of a total network overhaul however at the Layer 2 level. 10G is looking mighty tempting !

Great to hear. Hope it lasts. For me i run a 4 core 1.9 4gb ram router with OPNsense (PFsense fork) and a TPlink POE switch and TPlink wifi access point.

I have 48 Sonoff devices and around another 34 other wifi devices (phones laptops, raspberrys etc) and Network bandwith has never been a problem for me. as soon as it will be I’ll put the sonoffs in a different port with a dedicated wifi AP

similar setup here but might have something to do with the 30+ other VM’s I have running at any one time :rofl:

Yeah, it might ^^ anyway you know what to do, i guess haha. good luck.