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
69.84k stars 28.95k forks source link

Wled integration cause wled lag every ~10s #90676

Open PolestarWx opened 1 year ago

PolestarWx commented 1 year ago

The problem

The Wled integration in HA is causing lag every ~10s on my wled ruinning on esp32c3 (tested on esp32s3 and same problem). This is very notticeable when using ledfx.

Disableing Wled integration and reboot HA system (it seems not completely off otherwise) and lag disappear.

Wled 0.14.b19 but problem already present on 0.13

What version of Home Assistant Core has the issue?

core-2023.3.6

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

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)

horstefan commented 1 year ago

i had a feeling it wasnt running smooth and now i cannot unsee... same issue Home Assistant: core-2023.4.1 WLED 0.14.0-b2 (build 2303240)

PolestarWx commented 1 year ago

Same for me. I have disabled many wled entity which seems to help but now the integration fails to connect to wled about 10mn after reboot, restart the integration and it works 10mn, then nothing

msfuture commented 1 year ago

Same problem here but even worse. Polling of WLED data from HomeAssistant integration causes the WLED controller to freeze LED output for a moment. As I'm using TM1814 stripes this leads to a sudden red flash, as the stripe loses the data signal and switches to demo mode. As soon as I remove the integration from HA the red flashes/freezes are completely gone. This is already being discussed on the WLED github: https://github.com/Aircoookie/WLED/issues/2480

PolestarWx commented 1 year ago

I don't remember where I post that but there is a workaround, you can set the timing you want for polling in wled integration in HA, wled is still controllable but will not report external change to HA fastly (depending of the time you set for polling) I have no computer but will post how to do that later ;)

msfuture commented 1 year ago

I already raised the value for the scan_interval setting in configuration.yaml manually to 300 seconds. It's a small improvement as the red flash only happens every 5 minutes, but no solution. I'm not quite sure if this might indeed be something to rather fix in the WLED firmware than in the HA component...

PolestarWx commented 1 year ago

It's more from ha side or python wled library because wled app works great. Ha do too many request it's why it's freezing, wled struggle to answer. I haven't try it but maybe mqtt integration solve it

cthunberg commented 1 year ago

It's more from ha side or python wled library because wled app works great. Ha do too many request it's why it's freezing, wled struggle to answer. I haven't try it but maybe mqtt integration solve it

Switching to MQTT integration does indeed appear to address or greatly improve the issue.

issue-triage-workflows[bot] commented 11 months 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.

PolestarWx commented 11 months ago

Problem is still present

PolestarWx commented 11 months ago

It's more from ha side or python wled library because wled app works great. Ha do too many request it's why it's freezing, wled struggle to answer. I haven't try it but maybe mqtt integration solve it

Switching to MQTT integration does indeed appear to address or greatly improve the issue.

Can you share your mqtt config in ha to integrate weld ? Since we cannot use auto discovery in last weld version for ha mqtt don't know which topic to add

rgregrowe commented 10 months ago

I've been struggling with this "flashing red" issue for the past couple weeks. I've added data boosters, power injection and triple checked all my wiring. I happened upon this open issue and sure enough removing the WLED integration and restarting fixed the problem. I'm running the latest HA and the latest WLED with TM1814 puck lights at 12 volts. The controller is a Planet Laterna ESP32 board, but also was failing on a DIG-Quad. I do have MQTT somewhat controlling the board now and that works fine.

n2vsb commented 9 months ago

I have noticed the same using a DIG-quad as well with Quindor's ESP32 chip and 12V TM1814 outdoor string lights. Initially I thought it was a noise on the data line issue from a power supply problem. In order to rule that out, I used some filtering capacitors on the power lines going to the DIG-quad. That did not seem to help. Thanks to this thread, I disabled this WLED instance in HA, and rebooted HA. I have NOT noticed this "flashing red" issue since doing so. It has only been about 8 hours, but it was doing way too regularly previously, though it didn't appear to be in any particular cadence. I'm keeping an eye on this thread to see any fixes that may be posted.

Hannes-Beckmann commented 9 months ago

I already raised the value for the scan_interval setting in configuration.yaml manually to 300 seconds. It's a small improvement as the red flash only happens every 5 minutes, but no solution. I'm not quite sure if this might indeed be something to rather fix in the WLED firmware than in the HA component...

Hi, I have the same problem but I am not able to raise the scan interval in the configuration.yaml. @msfuture can you please provide your configuration?

YvesLev commented 7 months ago

Hello,

Just found this thread... I also have brief pauses every 10sec to all my WLED controlled led strips that are integrated to HA. It's quite annoying. (But practical to have them in HA).

I did not realize that HA integration could generate such behaviour... I played around with WLED config and thought I found some tweaks to eliminate the pauses like disabling NTP server etc... I think that going in some WLED config menus and just press save without modifications may affect the intensity of the pauses...

I may try the MQTT control suggested above...

kic68 commented 7 months ago

I am also affected by this. Dig-Quad from QuinLED and TM1814 24V. Happened with both the original WLED and QuinLED firmwares (13.x and 14.x). Took me a weekend to find this thread. Disabled the integration - and the flashes are gone. Thanks for that hint!

mariusCZ commented 6 months ago

Same issue here with WLED and ESP32.

dmonty2 commented 5 months ago

Could the up-stream WED project implement xTaskCreatePinnedToCore() code to utilize the ESP32 2 cores?

  1. to handle all API network requests
  2. to run the led strip

Would this fix the issue?

Here is an overview of pinned to core: https://randomnerdtutorials.com/esp32-dual-core-arduino-ide/

https://github.com/Aircoookie/WLED/issues/2480#issuecomment-1904162418

fantnhu commented 5 months ago

Hi guys! I have the same problem, but when I use the switch from the integration, the device reacts immediately. However, when I call it from service, there is often a 10sec lag. I tried with HA service, node-red too. Unfortunately it is slow to respond.

dmonty2 commented 5 months ago

Some have mentioned that switching from the WLED Integration interface to a MQTT interface causes the white flashing to go away. Here are some experiments with MQTT and my results.
https://github.com/dmonty2/homeassistant_wled_mqtt/

issue-triage-workflows[bot] commented 2 months 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.

YvesLev commented 2 months ago

After the discovery of this annoying bug, I removed all my wled integrations from HA... After receiving the notif of the stale flag on this thread I decided to try it out on one of my wled strip with the latest version.

I updated WLED to 15.0-b2 audioreactive and my HA is always up to date. The wled controller uses a ESP32 (WROOM32).

I confirm that the LAG every 10-12 seconds is still there. It is very visible with the "SAW" effect with effect speed at 165 for exemple.

Removing the integration, the lag stops right away.

For me, WLED is not yet fully compatible with HA...

disconn3ct commented 2 months ago

many of them have already been resolved with the latest updates

I'd love to see the actual numbers on that. @frenck

NFTechC commented 1 week ago

Hey guys I have the same issue, searching through the wohle www I couldnt find a solution. Im running ESP32 with WLED connected to hyperhdr realising ambilight which is extremely annoying. Wled pauses every 40secs for 2 seconds and plays the leds missed in the 2 secs quickly until its live again. Wled updated to latest version. Any ideas?