core: Lifx integration with many devices frequently goes unavailable
The problem
Since the latest integration update I have a lot of occurrences of LIFX light becoming “not available”. This is happening on most (but not all) of them (I have 20+ lights).
The behavior is not consistent during the day which makes me suspect there is some relation with the wifi environment (I have 3 AP broadcasting the same SSID on 1-6-11 channel), but by AP logs it doesn’t seem to be related to LIFX disconnecting from one AP and reconnecting to the other.
Also I see they usually become unavailable for 10s then coming back online: I ask myself if this has something to do with polling rate cycle of the integration as I see from integration discovery interval is 10 (seconds?)
"""Const for LIFX."""
import logging
DOMAIN = "lifx"
TARGET_ANY = "00:00:00:00:00:00"
DISCOVERY_INTERVAL = 10
MESSAGE_TIMEOUT = 1.65
MESSAGE_RETRIES = 5
OVERALL_TIMEOUT = 9
UNAVAILABLE_GRACE = 90
so could it be that discovery, in my environment, simply can’t keep the pace and drops connections?
What version of Home Assistant Core has the issue?
2022.9.5
What was the last working version of Home Assistant Core?
the one before LIFX integration update
What type of installation are you running?
Home Assistant OS
Integration causing the issue
LIFX
Link to integration documentation on our website
https://www.home-assistant.io/integrations/lifx/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 137 (87 by maintainers)
Commits related to this issue
- Recreate lifx socket when connection times out maybe fixes #78876 — committed to bdraco/home-assistant by bdraco a year ago
- Only declare lifx update failure after 3 attempts These devices sometimes flakey and generate a lot of noise from drop outs since communication is UDP best-effort. We should only mark them unavailabl... — committed to home-assistant/core by bdraco a year ago
- Only declare lifx update failure after 3 attempts These devices sometimes flakey and generate a lot of noise from drop outs since communication is UDP best-effort. We should only mark them unavailabl... — committed to Djelibeybi/home-assistant-core by bdraco a year ago
- Only declare lifx update failure after 3 attempts These devices sometimes flakey and generate a lot of noise from drop outs since communication is UDP best-effort. We should only mark them unavailabl... — committed to Djelibeybi/home-assistant-core by bdraco a year ago
- Only declare lifx update failure after 3 attempts These devices sometimes flakey and generate a lot of noise from drop outs since communication is UDP best-effort. We should only mark them unavailabl... — committed to Djelibeybi/home-assistant-core by bdraco a year ago
- Only declare lifx update failure after 3 attempts These devices sometimes flakey and generate a lot of noise from drop outs since communication is UDP best-effort. We should only mark them unavailabl... — committed to Djelibeybi/home-assistant-core by bdraco a year ago
- Bump aiolifx to 0.8.10 changelog: https://github.com/frawau/aiolifx/compare/0.8.9...0.8.10 fixes mentioned in https://github.com/home-assistant/core/issues/78876#issuecomment-1502032856 — committed to home-assistant/core by bdraco a year ago
I’ve seen similar behaviour, so I’ll see if I can reproduce it reliably enough to be confident with any potential fix/workaround.
Yeah, I have a hypothesis as to the cause of this, I just need some spare time to refactor things to see if it’s valid or not. I’m hoping to get to it this weekend.
If you haven’t disconnected your bulbs from the LIFX Cloud, that’s another thing you should do to reduce the CPU load on the bulbs themselves. This assumes you don’t use themes or schedules defined in the LIFX app, as those require cloud connectivity.
Also https://github.com/home-assistant/core/pull/91157 isn’t in a public build yet though which is the bigger change.
Good catch @bdraco!
Both of our statements can be true.
Now that they are all static, I am going to do that and have them re-discovered.
That’s an interesting observation. So the lights are going into access point mode when they shouldn’t? I will try and keep an eye on mine and see if I notice anything similar.
As an interim/alternative option, I may publicly release my custom integration that leverages the Photons Interactor addon-on which will do all the heavy lifting of handling the LIFX stuff and the integration just presents that to Home Assistant. I need to bring that up-to-date with all the new stuff the current LIFX core integration does first.
@Djelibeybi 24 hours into installing ha-lifx-beta 2022.11.0-dev with no dropouts at all. It has solved all my issues. TY
I am having the same issue as well. 2+ years of ~99.9% uptime, now im experiencings multiple long dropouts across my 20 bulbs every day
I’m not getting any timeouts when running the latest
dev
that uses extended multizone messages and considering the issue is with a strip, I’d like to see if this is still an issue once that code is in a stable release.TL;DR: this may already be fixed in dev via https://github.com/home-assistant/core/pull/79444