Get current LED color while running effect - Websockets not working on ESP8266 - WLED 0.15.0
I would like to be able to get the current color of at least one LED while the "random colors" effect is running. Seems like the JSON API is not capable of this and I will need to use websockets. I have the below code, which I believe should work, however the WLED device returns a 404 error.
Code:
import asyncio
import websockets
async def main():
async with websockets.connect(f"ws://<WLED IP>/ws") as websocket:
await websocket.send('{"lv":true}')
response = await websocket.recv()
print(f"Received state: {response}")
if __name__ == "__main__":
asyncio.run(main())
The exact error returned is "websockets.exceptions.InvalidStatus: server rejected WebSocket connection: HTTP 404"
Any help is greatly appreciated. I'm also open to other methods of retrieving live LED color info while an effect is running.
Posted Jul 6, 2025, 7:32 PM UTC
10