Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wled integration sometimes errors with Invalid response from WLED API #132284

Open
mrLeonTheMaster opened this issue Dec 4, 2024 · 30 comments
Open
Assignees

Comments

@mrLeonTheMaster
Copy link

The problem

I installed WLED on an esp8266 and it mostly works, but sometimes when i try to run an action from Home Assistant, I get an Invalid response from WLED API error. The error is not always the same. My WLED version: WLED 0.15.0-b7 (build 2410270)

What version of Home Assistant Core has the issue?

core-2024.11.3

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

config_entry-wled-01JE13YVFPF6P31CXSAXQPNZFC.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

There are a couple of errors in the logs:

Error fetching wled data: Invalid response from API: (503, {'error': 3})

Error while executing automation automation.<my-automation>: Invalid response from WLED API

<my-automation>: Choose at step 1: choice 2: Repeat at step 1: Error executing script. Error for call_service at pos 1: Invalid response from WLED API
<my-automation>: Choose at step 1: choice 2: Error executing script. Error for repeat at pos 1: Invalid response from WLED API
<my-automation>: Error executing script. Error for choose at pos 1: Invalid response from WLED API

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Dec 4, 2024

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.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


wled documentation
wled source
(message by IssueLinks)

@Scoff123
Copy link

I've also started getting these errors crop up - possibly only since updating WLED to 0.15.0 build 2412100

Logger: homeassistant.components.automation.desk_light
Source: helpers/script.py:2032
integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 16:23:03 (2 occurrences)
Last logged: 16:23:03

Desk Light: Choose at step 1: choice 1: Error executing script. Error for call_service at pos 1: Invalid response from WLED API
Desk Light: Error executing script. Error for choose at pos 1: Invalid response from WLED API

@oblivioncth
Copy link

+1

Was on 0.14.x without issue, now have seen this at least once since updating to WLED 0.15.0 (build 2412100)

2024-12-12 19:31:16.205 ERROR (MainThread) [homeassistant.components.automation.turn_on_theater_accent_lights_while_no_activity_is_running] Automation] Turn on theater accent lights while no activity is running: Error executing script. Error for call_service at pos 1: Invalid response from WLED API
2024-12-12 19:31:16.205 ERROR (MainThread) [homeassistant.components.automation.turn_on_theater_accent_lights_while_no_activity_is_running] Error while executing automation automation.turn_on_theater_accent_lights_while_no_activity_is_running: Invalid response from WLED API

Also using esp8266 for all my WLED controllers.

@syrisara
Copy link

On version 15 I have the same errors. Previous versions did not show this error. When using scenes and added as device the problem occurs but when using entitys it is not.

@mrLeonTheMaster
Copy link
Author

I don't know if this matters, but i have 3 segments configured in WLED.

@KimpiegamesYT1
Copy link

Having the same issue here, Nodered often reports: HomeAssistantError: Invalid response from WLED API

@syrisara
Copy link

I don't know if this matters, but i have 3 segments configured in WLED.

Coincidence? Me to!

@Nunak
Copy link

Nunak commented Dec 22, 2024

I have same issue after upgrade to 0.15 and I am not ussing segments (I have only one) and I am on esp8266

@daernsinstantfortress
Copy link

daernsinstantfortress commented Dec 24, 2024

I don't know if this matters, but i have 3 segments configured in WLED.

I have two WLED devices controlled by a HA scene. Both failed to come on this evening as they should reporting "Invalid response from WLED API". One has three segments defined, the other just a single segment, so I don't think that this problem is limited to just those running with multiple segments.

Edit: Downgraded back to 0.14.3 and the problem has disappeared and everything working well again. These are xmas lights so will be back in the box this week. I guess I'll see if it's fixed next year :)

@marleyjaffe
Copy link

Also experiencing this issue. Error while executing automation automation.turn_lights_off: Invalid response from WLED API

@RandomGHUser
Copy link

Experiencing this same issue as well. Sometimes (but not every time) my WLED automations will fail with the message.

@imaerials
Copy link

Same here , 0.15 version

@OptimusGREEN
Copy link

Yup, 0.15 broke it gor me, had to downgrade all my lights to 0.14.x to fix it.

@Tommatheussen
Copy link
Contributor

I tried running debug logging to see if anything more useful popped up, it wasn't easy because it just randomly happens (so a lot of logging happens before it triggers). Attached the log file, nothing meaningful (in my eyes), running lots of different WLED devices (both ESP8266 and ESP32). Seems to have started as soon as I upgraded my devices to 0.15
home-assistant_wled_2025-01-03T10-10-39.704Z.log

@KentuckyMC
Copy link

Same issue on my side. Everything worked rock solid, no issues there with my automations. Now it seems like some lights are staying on with the invalid response error. Guess best for now is rolling back the update?

@ChrisToxz
Copy link

For me the issues are resolved in 0.15 after I erased the flash of my ESP and reflashed WLED 0.15, so not just a regular reflash.

I used esptool CLI to do this.
Command: python -m esptool --port COMx erase_flash
First I made a backup of my config of course.
After that I flashed 0.15 again, restored my back up and all the unreliability issues were resolved. (At least for now, 6+ hours)

@Tekwyzard
Copy link

I'm having the same issue, to the extent that I've even tried running WLED 0.16.0-alpha on one of my instances an esp-01, thinking that maybe the WLED developers are aware and fixed it in a nightly version, and it's still throwing the same error occasionally, along with my other various esps running WLED 0.15.0. The only stable one is running 0.14.4. I'm on Home Assistant 2024.12.5, and I'm not updating to the latest version of HA until they get their act together to fix some of the many issues that they rushed it out with, so I don't know if HA 2025.1.x has fixed the WLED issue, or not.

For me the issues are resolved in 0.15 after I erased the flash of my ESP and reflashed WLED 0.15, so not just a regular reflash.

I used esptool CLI to do this.
Command: python -m esptool --port COMx erase_flash
First I made a backup of my config of course.
After that I flashed 0.15 again, restored my back up and all the unreliability issues were resolved. (At least for now, 6+ hours)

I've tried that, a few times actually, but the issue remains. For me at least, it seems to be related to HA 2024.12.x as I don't recollect having the same issue with the prior version I ran (2024.10.4).

@wjb178
Copy link

wjb178 commented Jan 20, 2025

Same occasional error for me.
Home Assistant 2025.1.2
WLED
Firmware: 0.15.0
Hardware: esp8266

I only have one esp32. I haven't seen errors on it.

@mrLeonTheMaster
Copy link
Author

I recently found out, that sometimes when I am controlling the lights from the wled web interface, a red bar shows up on the bottom with the text Invalid response from API, so i think, that this is not a home assistant issue, but a wled issue. @Aircoookie

@swampdogmash
Copy link

Seeing similar issues too. I have an automation that turns on 2 lights in my back garden and also a wled driven set of leds under my steps. Occasionally the script fails and the ights remain on with this same error shown in the trace preventing the second half of the scruot from running. I am also running 0.15.0. I also occasionally get the red bar at the bottom of the wled gui saying connection to eled failed when it never even dropped a ping. I strongly suspect wled rather than home assistant also...

@FGOD1983
Copy link

FGOD1983 commented Feb 5, 2025

I am having the same issue with my ledstrip in yard. Sometimes when the automation triggered by a motion sensor is turning the ledstrip on, it fails to turn it on with the mentioned Invalid response from WLED API error. When I then manually try to turn it on, there is no issue at all.

But as @mrLeonTheMaster mentions, I also have been seeing a similar thing on the web interface, so could be more related to WLED itself then it is about issues with the integration/HA.

@KentuckyMC
Copy link

Is there already something like a issue on the side of WLED itself? I haven't found something? Otherwise we can refer it here maybe?

@imaerials
Copy link

Im testing with 0.14.4 seems to be more stable than 0.15 , at least with the no response issue.

@FGOD1983
Copy link

FGOD1983 commented Feb 9, 2025

I have reverted the particular device I noticed these issues on to 0.14.4 too and created an issue on the WLED git about this too: wled-dev/WLED#4546

as for the device I have this issues on, it is a ESP8266

@FGOD1983
Copy link

from the looks of it the 0.16 nightly build fixes this issue and it is caused as suspected by the esp8266 module not being fast enough to handle more requests from HA in time. You can read more about it in the mentioned issue I created on the WLED git

@wjb178
Copy link

wjb178 commented Feb 13, 2025

That makes sense.
I haven't seen the error in a few days since I tried a few changes. Still on 0.15.0

Changes:

  1. I disabled wifi sleep on esp8266 wled devices.
    Visit device then Config > WiFi setup > Disable Wifi sleep checkbox
    (my esp32 devices were set for Disable Wifi sleep by default)

  2. Home Assistant 2025.1.2 > I updated to 2025.2.2

  3. In automations where I was turning on wled I was using the light turn on action followed by the select preset action. I
    found only using the select preset action turns on the light with the preset

WLED
Firmware: 0.15.0
Hardware: esp8266

@FGOD1983
Copy link

That makes sense. I haven't seen the error in a few days since I tried a few changes. Still on 0.15.0

Changes:

  1. I disabled wifi sleep on esp8266 wled devices.
    Visit device then Config > WiFi setup > Disable Wifi sleep checkbox
    (my esp32 devices were set for Disable Wifi sleep by default)
  2. Home Assistant 2025.1.2 > I updated to 2025.2.2
  3. In automations where I was turning on wled I was using the light turn on action followed by the select preset action. I
    found only using the select preset action turns on the light with the preset

WLED Firmware: 0.15.0 Hardware: esp8266

I think point 3 makes the most sense here. Never thought about this, but I was doing the same the other way around. Set preset, then turn on the ledstrip. But if the preset is saved including the on state, it indeed also turns it on. So having a turn on right after that could indeed cause issues. If the saved state with the preset was set to off, it probably has no issues with this

@wjb178
Copy link

wjb178 commented Feb 14, 2025

Could be. But I was getting most of my errors when an automation that simply turned off the wled after it had been on for a long time. So I was thinking the wifi sleep might be a culprit too.

@stephanedupont
Copy link

All my WLED strips have Wifi sleep disabled, and yet I was encountering the problem with 0.15.

@wjb178
Copy link

wjb178 commented Feb 14, 2025

That's interesting. I did forget about another thing I did. On each wled device webpage I had flashed 0.14.4
About a day later on each wled device webpage I flashed 0.15 again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests