Closed joelegg closed 2 months ago
Hey there @djelibeybi, mind taking a look at this issue as it has been labeled with an integration (lifx
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
lifx documentation lifx source (message by IssueLinks)
I am sitting each individual bulb in one call so perhaps I could break the call out
I have many individual downloads I have not grouped them. I just tried using groups and I get the same error.
Could you please paste the YAML you're using that's causing the issue and the type of LIFX multizone lights you're targetting, i.e. is it a Lightstrip, Beam, Neon or String?
sure thing thanks for your reply
alias: 'Pantry Light Automation'
description: 'Controls pantry lights based on motion and mode'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.pantry_occupancy
to: 'on'
- platform: state
entity_id: binary_sensor.pantry_occupancy
to: 'off'
for: '00:02:00'
condition:
- condition: state
entity_id: input_boolean.enable_theme_lighting
state: 'off'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.pantry_occupancy
state: 'on'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.mode
state: 'Day'
sequence:
- service: light.turn_on
data:
entity_id:
- light.pantry_1
- light.pantry_2
brightness: 254
color_temp: 200
transition: 1
- conditions:
- condition: state
entity_id: input_select.mode
state: 'Evening'
sequence:
- service: light.turn_on
data:
entity_id:
- light.pantry_1
- light.pantry_2
brightness: 200
color_temp: 550
transition: 1
- conditions:
- condition: state
entity_id: input_select.mode
state: 'Morning'
sequence:
- service: light.turn_on
data:
entity_id:
- light.pantry_1
- light.pantry_2
brightness: 125
color_temp: 500
transition: 1
- conditions:
- condition: state
entity_id: input_select.mode
state: 'Asleep'
sequence:
- service: light.turn_on
data:
entity_id:
- light.pantry_1
- light.pantry_2
brightness: 20
color_temp: 1000
transition: 1
- conditions:
- condition: state
entity_id: binary_sensor.pantry_occupancy
state: 'off'
for: '00:02:00'
sequence:
- service: light.turn_off
data:
entity_id:
- light.pantry_1
- light.pantry_2
transition: 5 # Increased transition time for turning off the lights
- service: logbook.log
data:
name: "Pantry Lights"
message: "Lights turned off due to no motion detected for 2 minutes."
this is with the GU10 downlights.
thanks
similar issue with someone else some time ago: https://community.home-assistant.io/t/what-is-timeout-setting-power-error-lifx-error/502069
its' odd as updating the lifx light manually in HA with the devie directly works very fast. but the atuomations just seem to be slow
I originally had this issue in node red too but moved to automations calling the lifx lan integration and same issue. just not consistant.
I'm not seeing any reason why this would be calling set_extended_color_zones
though. These are all just light.turn_on
calls. There don't seem to be any lifx.set_state
calls, which (I thought) were the only way to trigger set_extended_color_zones
.
Can you please paste the diagnostic output from both of those bulbs? We had an issue a while back where the LIFX-provided product definitions were incorrect and a bulb was marked as having multiple zones when it didn't and this feels like the same problem.
Essentially, there's no reason why we should be anywhere near that function with GU10 bulbs, so something else is going on here.
good point! very odd.
I do have many lifx lights. (60) including z strip. but in this case its only calling pantry 1 and 2.
config_entry-lifx-01J60EVR5X4G3DSK8MH33MXKNE.json config_entry-lifx-01J60EXY0JFHFWAN3PJWK492AF.json
sure here you go - thank you
Ok, so both of those bulbs are reporting the correct capabilities. Neither of them have either multizone
or extended_multizone
features flagged as enabled incorrectly.
Did this just start happening out of the blue or has this automation always had this problem?
Do you have any automations that target your Z Strip? I suspect that the last error shown in the interface is not being caused by this automation.
I didn't have this issue prior no. not sure when it started as i moved to a fresh install as we lived away without HA for a while.
lighting is run for z strip via node red. As when i hit this issue in node red i moved a couple to ha automations to see if it was a node red issue.
If this is reproducible, can you please enable debug logging, trigger it and then disable logging and upload the log? I can't work out why Home Assistant would be instantiating these as Multizone lights.
you want me to that in ha? sure
Are you driving the lighting changes from Node-RED via Home Assistant or some other plugin?
in home asissant for the one i'm having this issue with (but i also had the same issue occuring in node red)
I'm also concerned about how long it takes your config entries to set up. Almost all of mine are < 2 seconds. Most of yours are over 10.
what do you mean by that sorry?
If you look at all the config_entry_setup
values in your .json
files, they are all very high, many over 20 seconds. Which does correlate with timeout errors as that's longer than the integration would try to send messages.
I don't know why it's trying to use the extended color zones function, but it does look like your Home Assistant instance and your bulbs are really having a hard time communicating.
yeah the color zones function is odd.
I have unifi firewalls going on here with Iot vlan etc. and they are talking but yes that could also be it. i'll take a good look
i also thought that perhaps it was a ram/cpu issue with the VMM i'm running ha on (synology nas 1019+) so i increaed that.
i can't reproduce it tho (it did happen once afer i increase the ram and cpu count tho) but yeah its running quite fast now.
i've introduced too many variables :)
I use Ubiquiti gear as well. Your Home Assistant instance and LIFX bulbs should be on the same VLAN and the Wi-Fi the bulbs are connected to should have all features disabled except BSS Transition and be set to WPA2 Only.
Also, if your Synology is multi-homed, make sure the NIC connected to the VLAN the bulbs are on is marked as the active network connection in Settings -> System -> Network.
Ah so you have your vlan for Home assistant on the same network lifx (iot in this case ). Rather than opening up sharing rules. Got it! I can tweak this shortly. Thanks so much I really appreciate your advice.
If you're going to move your bulbs, keep in mind that it could take some time for Home Assistant to discover their new IP address. It's a lot faster if you delete them first, then let Home Assistant rediscover them completely. Just make a note of the entity IDs beforehand and if necessary, change them back to the same one afterwards and all your automations should keep working as before.
BTW, could you let me know what Node-RED node you're using to automate your LIFX bulbs? I'd like to check it out to see if it could be involved in any way, i.e. by being too chatty or something.
The bulbs are already on iot. I just need to work out how to move my virtual machine which has a unique IP connected to unifi to the iot vlan.
Yep I'll send the node over shortly
ok it just replicated the error with debug logging on - but i dont see any lifx logs in system - logs? just normal logs?
Moving Home Assistant to a different VLAN will require it to have a different IP address, so you'll have to decide which is easier: changing the IP address of Home Assistant or reconfiguring your bulbs. My advice would be to move a couple of bulbs to the same VLAN as Home Assistant to see if that makes any significant difference before doing all of them or moving Home Assistant itself.
Or, if your Synology allows for this, create another vNIC on that VLAN so your Home Assistant instance is connected to both VLANs. Though, this does require some advanced networking config on Home Assistant that isn't exposed via the web interface.
There should be a bunch of LIFX entries in the debug output. If there are no debug entries, then debug logging wasn't enabled for the LIFX integration.
i just use the standard call service node:
Ok, so that's using Home Assistant as well, not a Node-RED specific method. Moving automation back and forth in this case wouldn't make a difference as both are relying on Home Assistant. On the plus side, debug logging on Home Assistant will show us what happens for both automation types.
enabled lifx debug but i'm no t seeing any logs in there when the issue occured again
the errore occured at 853 a
When you disable debug logging, it should download the logs for the period.
2024-09-03 08:40:46.844 DEBUG (MainThread) [homeassistant.components.lifx] Finished fetching Dining Room 2 (192.168.2.160) data in 23.682 seconds (success: True)
2024-09-03 08:40:47.664 ERROR (MainThread) [homeassistant.components.automation.pantry_light_automation] Pantry Light Automation: Choose at step 1: choice 2: Error executing script. Error for call_service at pos 1: Timeout setting power for None
2024-09-03 08:40:47.665 ERROR (MainThread) [homeassistant.components.automation.pantry_light_automation] Pantry Light Automation: Error executing script. Error for choose at pos 1: Timeout setting power for None
2024-09-03 08:40:47.668 ERROR (MainThread) [homeassistant.components.automation.pantry_light_automation] Error while executing automation automation.pantry_light_automation: Timeout setting power for None
2024-09-03 08:40:49.417 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140020071381696] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/lifx/light.py", line 303, in set_color
await self.coordinator.async_set_color(merged_hsbk, duration)
File "/usr/src/homeassistant/homeassistant/components/lifx/coordinator.py", line 379, in async_set_color
await async_execute_lifx(
File "/usr/src/homeassistant/homeassistant/components/lifx/util.py", line 188, in async_execute_lifx
await async_multi_execute_lifx_with_retries(
File "/usr/src/homeassistant/homeassistant/components/lifx/util.py", line 239, in async_multi_execute_lifx_with_retries
raise TimeoutError(f"{failed_methods} timed out after {attempts} attempts")
TimeoutError: functools.partial(<bound method Light.set_color of <aiolifx.aiolifx.Light object at 0x7f58f89a2000>>, [0, 0, 65278, 5000], duration=0) timed out after 5 attempts
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 626, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/lifx/light.py", line 204, in async_turn_on
await self.set_state(**{**kwargs, ATTR_POWER: True})
File "/usr/src/homeassistant/homeassistant/components/lifx/light.py", line 261, in set_state
await self.set_color(hsbk, kwargs, duration=fade)
File "/usr/src/homeassistant/homeassistant/components/lifx/light.py", line 305, in set_color
raise HomeAssistantError(f"Timeout setting color for {self.name}") from ex
homeassistant.exceptions.HomeAssistantError: Timeout setting color for None
Ok, so that's more like what I expected to see. The log in your original post was caused by your Z strip (I'm fairly sure). We need to get your bulbs responding a lot faster than they are now, because given the setup times, there's definitely a lot of network traffic or delay somewhere. I've got a Synology but I've never used the VMM service, so I have no idea how much (if any) network delay that adds to the stack.
yeah that could be it. i was running it in docker originally on my synology but had lots of trouble getting z2m going. so i just spun up a vmm.
I am tempted to just buy a dedicated pc to run home assisant as i have 2 RU's spare on my rack. and HOME ASSISTANT is super important lol
I have mine running as a VM on Proxmox on a Beelink Mini-PC with a bunch of other things running as LXD instances, including Z2M, Node-RED, Scrypted, etc. Highly recommended, especially as mini-PCs are shipping with 2.5GB LAN ports these days.
I looked into proxmox looks great. I would want to mount it tho. so need to find a min ipc that is rack mountable without any custom mounts.
just trying to move my nas over to iot lan now.
Good luck! And that problem sounds like a perfect reason to buy a new 3D printer, even if you already have one. 😉
ok i've moved over. lifx integration is not liking the move tho. its not finding the lifx lights now. I have firewall allow rule for ha IP to the IOT network.
You can't move Home Assistant to another VLAN without changing its IP address. It has to have an IP address on that VLAN, otherwise it can't communicate with the network to which it's connected.
The point of putting things on the same VLAN is to remove the firewall and routing requirements, which is achieved by having everything on the same IP subnet.
yeah i moved it over and home assistant now has ip address that is on IOT vlan. i moved the whole nas over to IOT vlan (I run plex and ha on nas)
If Home Assistant and the LIFX bulbs are on the same IP subnet, there is no firewall between them, unless you're running one specifically on your NAS.
Check Settings -> System -> Network to ensure that Home Assistant has noticed the changed IP address.
yep it has. for some reason lifx app itself is showing all the lifx lights offline. so i've stuffed something somewhere all i did was move the nas over to the vlan. and update its up. i can access the nas etc fine. but the lifx lights have gone away. still looking into it.
That is ... odd. Switch your phone to the IoT VLAN to see if that helps. If so, it means the bulbs are having a hard time connecting to the LIFX Cloud (which is what the app falls back to if a direct connection to a bulb fails).
ok done that. and most are offline - only one is showing as online. very odd.
That is indeed quite odd. I'm not sure what to suggest here, as I don't know how your VLANs are configured, but I'd check things like your Ubiquiti logs to see if DHCP is working, etc.
The problem
I'm experiencing a recurring issue with the LIFX integration in Home Assistant where I receive a
TimeoutError
when attempting to set color zones on my LIFX lights. The issue manifests as a request timeout error, specifically when trying to apply multiple color zones using the LIFX light component. This error occurs multiple times and results in an exception, causing the command to fail entirely.Error Log:
The following error is logged:
What version of Home Assistant Core has the issue?
Haos
What was the last working version of Home Assistant Core?
2024-8-3
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?
Additional information
No response