home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.45k stars 30.68k forks source link

Activating a scene that includes WLED with multiple segments causes unrecoverable looping of call_service #90304

Closed chicagoandy closed 1 year ago

chicagoandy commented 1 year ago

The problem

I have a WLED integration, the strip light includes multiple segments. These WLED entities are included in a scene.

Activating the scene will result in 150,000+ 'call_service' entries in events table. The looping of call_service will consume all resources and the system will hang. Unable to use 'script.turn_off" to abort the script. The only recover I've been able to find is a power-cycle of the server.

Note: attached logs and data below represent after attempting to abort the script & power_cycling the server

SELECT e.data_id, count(e.data_id), ed.shared_data FROM events e join event_data ed on e.data_id = ed.data_id where event_type = 'call_service' group by e.data_id order by count(e.data_id) desc

data_id count(e.data_id) shared_data
1316081 155740 {"domain":"light","service":"turn_on","service_data":{"brightness":255,"effect":"Blends","rgb_color":[255,215,96],"entity_id":["light.ellie_bed_lights","light.ellie_lower_bed_lights","light.ellie_desk_light"]}}

wled_debug.log wled_debug.log

What version of Home Assistant Core has the issue?

0.13.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

wled

Link to integration documentation on our website

https://www.home-assistant.io/integrations/wled/

Diagnostics information

wled_debug.log

Example YAML snippet

- id: '1649851686816'
  name: Ellie - Bedtime
  entities:
    switch.ellie_heart:
      icon: mdi:heart-circle
      friendly_name: Ellie heart
      state: 'off'
    light.framelight:
      effect_list:
      - Android
      - Aurora
      - Blends
      - Blink
      - Blink Rainbow
      - Bouncing Balls
      - Bpm
      - Breathe
      - Candle
      - Candle Multi
      - Candy Cane
      - Chase
      - Chase 2
      - Chase 3
      - Chase Flash
      - Chase Flash Rnd
      - Chase Rainbow
      - Chase Random
      - Chunchun
      - Colorful
      - Colorloop
      - Colortwinkles
      - Colorwaves
      - Dancing Shadows
      - Dissolve
      - Dissolve Rnd
      - Drip
      - Dynamic
      - Dynamic Smooth
      - Fade
      - Fairy
      - Fairytwinkle
      - Fill Noise
      - Fire 2012
      - Fire Flicker
      - Fireworks
      - Fireworks 1D
      - Fireworks Starburst
      - Flow
      - Glitter
      - Gradient
      - Halloween
      - Halloween Eyes
      - Heartbeat
      - ICU
      - Juggle
      - Lake
      - Lighthouse
      - Lightning
      - Loading
      - Meteor
      - Meteor Smooth
      - Multi Comet
      - Noise 1
      - Noise 2
      - Noise 3
      - Noise 4
      - Noise Pal
      - Oscillate
      - Pacifica
      - Palette
      - Percent
      - Phased
      - Phased Noise
      - Plasma
      - Police
      - Popcorn
      - Pride 2015
      - Railway
      - Rain
      - Rainbow
      - Rainbow Runner
      - Random Colors
      - Ripple
      - Ripple Rainbow
      - Running
      - Running Dual
      - Saw
      - Scan
      - Scan Dual
      - Scanner
      - Scanner Dual
      - Sine
      - Sinelon
      - Sinelon Dual
      - Sinelon Rainbow
      - Solid
      - Solid Glitter
      - Solid Pattern
      - Solid Pattern Tri
      - Sparkle
      - Sparkle Dark
      - Sparkle+
      - Spots
      - Spots Fade
      - Stream
      - Stream 2
      - Strobe
      - Strobe Mega
      - Strobe Rainbow
      - Sunrise
      - Sweep
      - Sweep Random
      - TV Simulator
      - Tetrix
      - Theater
      - Theater Rainbow
      - Traffic Light
      - Tri Fade
      - Tri Wipe
      - Twinkle
      - Twinklecat
      - Twinklefox
      - Twinkleup
      - Two Dots
      - Washing Machine
      - Wipe
      - Wipe Random
      supported_color_modes:
      - rgb
      color_mode: rgb
      brightness: 3
      hs_color:
      - 0
      - 100
      rgb_color:
      - 255
      - 0
      - 0
      xy_color:
      - 0.701
      - 0.299
      effect: Twinklefox
      icon: mdi:white-balance-iridescent
      friendly_name: FrameLight
      supported_features: 36
      state: 'on'
    light.ellie_bed_lights:
      effect_list:
      - Android
      - Aurora
      - Blends
      - Blink
      - Blink Rainbow
      - Bouncing Balls
      - Bpm
      - Breathe
      - Candle
      - Candle Multi
      - Candy Cane
      - Chase
      - Chase 2
      - Chase 3
      - Chase Flash
      - Chase Flash Rnd
      - Chase Rainbow
      - Chase Random
      - Chunchun
      - Colorful
      - Colorloop
      - Colortwinkles
      - Colorwaves
      - Dancing Shadows
      - Dissolve
      - Dissolve Rnd
      - Drip
      - Dynamic
      - Dynamic Smooth
      - Fade
      - Fairy
      - Fairytwinkle
      - Fill Noise
      - Fire 2012
      - Fire Flicker
      - Fireworks
      - Fireworks 1D
      - Fireworks Starburst
      - Flow
      - Glitter
      - Gradient
      - Halloween
      - Halloween Eyes
      - Heartbeat
      - ICU
      - Juggle
      - Lake
      - Lighthouse
      - Lightning
      - Loading
      - Meteor
      - Meteor Smooth
      - Multi Comet
      - Noise 1
      - Noise 2
      - Noise 3
      - Noise 4
      - Noise Pal
      - Oscillate
      - Pacifica
      - Palette
      - Percent
      - Phased
      - Phased Noise
      - Plasma
      - Police
      - Popcorn
      - Pride 2015
      - Railway
      - Rain
      - Rainbow
      - Rainbow Runner
      - Random Colors
      - Ripple
      - Ripple Rainbow
      - Running
      - Running Dual
      - Saw
      - Scan
      - Scan Dual
      - Scanner
      - Scanner Dual
      - Sine
      - Sinelon
      - Sinelon Dual
      - Sinelon Rainbow
      - Solid
      - Solid Glitter
      - Solid Pattern
      - Solid Pattern Tri
      - Sparkle
      - Sparkle Dark
      - Sparkle+
      - Spots
      - Spots Fade
      - Stream
      - Stream 2
      - Strobe
      - Strobe Mega
      - Strobe Rainbow
      - Sunrise
      - Sweep
      - Sweep Random
      - TV Simulator
      - Tetrix
      - Theater
      - Theater Rainbow
      - Traffic Light
      - Tri Fade
      - Tri Wipe
      - Twinkle
      - Twinklecat
      - Twinklefox
      - Twinkleup
      - Two Dots
      - Washing Machine
      - Wipe
      - Wipe Random
      supported_color_modes:
      - onoff
      - rgb
      color_mode: rgb
      brightness: 3
      hs_color:
      - 0
      - 100
      rgb_color:
      - 255
      - 0
      - 0
      xy_color:
      - 0.701
      - 0.299
      effect: Twinklefox
      entity_id:
      - light.ellie_bed_lights
      - light.ellie_lower_bed_lights
      - light.ellie_desk_light
      icon: mdi:lightbulb-group
      friendly_name: Ellie Bed Lights
      supported_features: 36
      state: 'on'
    light.ellie_lower_bed_lights:
      effect_list:
      - Android
      - Aurora
      - Blends
      - Blink
      - Blink Rainbow
      - Bouncing Balls
      - Bpm
      - Breathe
      - Candle
      - Candle Multi
      - Candy Cane
      - Chase
      - Chase 2
      - Chase 3
      - Chase Flash
      - Chase Flash Rnd
      - Chase Rainbow
      - Chase Random
      - Chunchun
      - Colorful
      - Colorloop
      - Colortwinkles
      - Colorwaves
      - Dancing Shadows
      - Dissolve
      - Dissolve Rnd
      - Drip
      - Dynamic
      - Dynamic Smooth
      - Fade
      - Fairy
      - Fairytwinkle
      - Fill Noise
      - Fire 2012
      - Fire Flicker
      - Fireworks
      - Fireworks 1D
      - Fireworks Starburst
      - Flow
      - Glitter
      - Gradient
      - Halloween
      - Halloween Eyes
      - Heartbeat
      - ICU
      - Juggle
      - Lake
      - Lighthouse
      - Lightning
      - Loading
      - Meteor
      - Meteor Smooth
      - Multi Comet
      - Noise 1
      - Noise 2
      - Noise 3
      - Noise 4
      - Noise Pal
      - Oscillate
      - Pacifica
      - Palette
      - Percent
      - Phased
      - Phased Noise
      - Plasma
      - Police
      - Popcorn
      - Pride 2015
      - Railway
      - Rain
      - Rainbow
      - Rainbow Runner
      - Random Colors
      - Ripple
      - Ripple Rainbow
      - Running
      - Running Dual
      - Saw
      - Scan
      - Scan Dual
      - Scanner
      - Scanner Dual
      - Sine
      - Sinelon
      - Sinelon Dual
      - Sinelon Rainbow
      - Solid
      - Solid Glitter
      - Solid Pattern
      - Solid Pattern Tri
      - Sparkle
      - Sparkle Dark
      - Sparkle+
      - Spots
      - Spots Fade
      - Stream
      - Stream 2
      - Strobe
      - Strobe Mega
      - Strobe Rainbow
      - Sunrise
      - Sweep
      - Sweep Random
      - TV Simulator
      - Tetrix
      - Theater
      - Theater Rainbow
      - Traffic Light
      - Tri Fade
      - Tri Wipe
      - Twinkle
      - Twinklecat
      - Twinklefox
      - Twinkleup
      - Two Dots
      - Washing Machine
      - Wipe
      - Wipe Random
      supported_color_modes:
      - rgb
      icon: mdi:led-strip-variant
      friendly_name: Ellie  Lower Bed Lights
      supported_features: 36
      state: unavailable
    light.ellie_bedroom_main_lights:
      supported_color_modes:
      - brightness
      color_mode: brightness
      brightness: 2
      device_id: '23'
      zone_id: '17'
      icon: mdi:dome-light
      friendly_name: Ellie Bedroom Main Lights
      supported_features: 32
      state: 'on'
  metadata:
    light.framelight:
      entity_only: true
    light.ellie_bed_lights:
      entity_only: true
    light.ellie_lower_bed_lights:
      entity_only: true
    light.ellie_bedroom_main_lights:
      entity_only: true

Anything in the logs that might be useful for us?

2023-03-26 10:18:08.480 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.105 seconds (success: True)
2023-03-26 10:18:10.258 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.066 seconds (success: True)
2023-03-26 10:18:16.330 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.089 seconds (success: True)
2023-03-26 10:18:18.506 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.131 seconds (success: True)
2023-03-26 10:18:20.282 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.088 seconds (success: True)
2023-03-26 10:18:26.335 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.094 seconds (success: True)
2023-03-26 10:18:28.547 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.173 seconds (success: True)
2023-03-26 10:18:30.255 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.063 seconds (success: True)
2023-03-26 10:18:36.373 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.132 seconds (success: True)
2023-03-26 10:18:38.504 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.130 seconds (success: True)
2023-03-26 10:18:40.348 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.155 seconds (success: True)
2023-03-26 10:18:46.332 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.091 seconds (success: True)
2023-03-26 10:18:48.618 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.244 seconds (success: True)
2023-03-26 10:18:50.249 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.057 seconds (success: True)
2023-03-26 10:18:56.348 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.107 seconds (success: True)
2023-03-26 10:18:58.474 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.099 seconds (success: True)
2023-03-26 10:19:00.254 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.062 seconds (success: True)
2023-03-26 10:19:06.329 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.089 seconds (success: True)
2023-03-26 10:19:08.450 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.075 seconds (success: True)
2023-03-26 10:19:10.258 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.065 seconds (success: True)
2023-03-26 10:19:15.572 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:15.768 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:16.350 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.109 seconds (success: True)
2023-03-26 10:19:17.817 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:17.831 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:19.786 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:21.798 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:24.249 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:25.820 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:26.354 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.113 seconds (success: True)
2023-03-26 10:19:27.472 DEBUG (MainThread) [homeassistant.components.wled] Finished fetching wled data in 0.097 seconds (success: True)
2023-03-26 10:19:27.830 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:29.853 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:32.051 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data
2023-03-26 10:19:33.868 DEBUG (MainThread) [homeassistant.components.wled] Manually updated wled data

Additional information

WLED strip has multiple segments, and all 3 are included in the scene.

Community Forum Post with Screenshots: https://community.home-assistant.io/t/help-event-firing-160-000-times/552343/2

home-assistant[bot] commented 1 year ago

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (wled) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `wled` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign wled` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


wled documentation wled source (message by IssueLinks)

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

chicagoandy commented 1 year ago

Still happens.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.