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 - Unexpected characters reported when controlling LEDs #102988

Closed
geofffarmer opened this issue Oct 29, 2023 · 10 comments
Closed

WLED - Unexpected characters reported when controlling LEDs #102988

geofffarmer opened this issue Oct 29, 2023 · 10 comments

Comments

@geofffarmer
Copy link

The problem

After updating my WLED ESP8266 boards to firmware 0.14.0 I have a problem with one of the boards. When HA sends commands to the board I get errors like the following. How can I begin to resolve.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:226
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 08:39:17 (4 occurrences)
Last logged: 08:40:58

[140319262996800] unexpected character: line 1 column 862 (char 861)
[140319262996800] 'utf-8' codec can't decode byte 0x9a in position 865: invalid start byte
[140319262996800] 'utf-8' codec can't decode byte 0xef in position 861: invalid continuation byte
[140319262996800] 'utf-8' codec can't decode byte 0xd8 in position 861: invalid continuation byte
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 580, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/wled/helpers.py", line 28, in handler
await func(self, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/wled/light.py", line 97, in async_turn_on
await self.coordinator.wled.master(
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 368, in master
await self.request("/json/state", method="POST", data=state)
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 211, in request
response_data = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 72, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1120, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 862 (char 861)

What version of Home Assistant Core has the issue?

2023.10.5

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?

See above

Additional information

No response

@home-assistant
Copy link

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)

@antonyslater
Copy link

antonyslater commented Oct 30, 2023

I too have the same issue having just upgraded both of myESP8266 from v0.13.3 to v0.14.0.

Automations/scripts in HA need to be run twice to action the required change to the board.

@margatemarcel
Copy link

I too am experiencing this issue with a new ESP8266 WLED controller I've just added to HA. I have 3 segments and toggling them individually, or the main control, results in an 'unexpected character' error >90% of the time (occasionally no error).

@geofffarmer
Copy link
Author

Yes, @margatemarcel , I experience this too. It is only for my WLED controller that has segments defined. I too have three segments. My other - non-segmented - WLED controllers seem okay.

@Alfagek
Copy link

Alfagek commented Nov 21, 2023

Same problem over here. And only the one with multi segments when i call a service to toggle the light on/off for one segment.

Got 2 error's in my log. Read something on the github of WLED https://github.com/Aircoookie/WLED/issues/3447 but not the sollution, only to go back to .13

`Logger: homeassistant.components.automation.slaapkamer_verlichting_kast
Source: helpers/script.py:468
Integration: Automatisering (documentation, issues)
First occurred: 16 november 2023 om 21:06:15 (82 occurrences)
Last logged: 16:42:52

Slaapkamer: Verlichting Kast: Choose at step 1: choice 1: Error executing script. Unexpected error for device at pos 1: no digit after exponent sign: line 1 column 863 (char 862)
Slaapkamer: Verlichting Kast: Error executing script. Unexpected error for choose at pos 1: no digit after exponent sign: line 1 column 863 (char 862)
Slaapkamer: Verlichting Kast: Choose at step 1: choice 5: Error executing script. Unexpected error for device at pos 1: unexpected character: line 1 column 862 (char 861)
Slaapkamer: Verlichting Kast: Error executing script. Unexpected error for choose at pos 1: unexpected character: line 1 column 862 (char 861)
Slaapkamer: Verlichting Kast: Choose at step 1: choice 8: Error executing script. Unexpected error for device at pos 1: unexpected character: line 1 column 862 (char 861)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
await device_action.async_call_action_from_config(
File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
await platform.async_call_action_from_config(hass, config, variables, context)
File "/usr/src/homeassistant/homeassistant/components/light/device_action.py", line 93, in async_call_action_from_config
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 580, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/wled/helpers.py", line 28, in handler
await func(self, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/wled/light.py", line 251, in async_turn_on
await self.coordinator.wled.segment(**data)
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 515, in segment
await self.request("/json/state", method="POST", data=state)
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 211, in request
response_data = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 84, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1120, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: no digit after exponent sign: line 1 column 863 (char 862)
`

`Logger: homeassistant.components.automation.slaapkamer_verlichting_kast
Source: components/automation/init.py:655
Integration: Automatisering (documentation, issues)
First occurred: 16 november 2023 om 21:06:15 (41 occurrences)
Last logged: 16:42:52

While executing automation automation.slaapkamer_verlichting_kast
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 655, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 924, in _async_choose_step
await self._async_run_script(script)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1069, in _async_run_script
await self._async_run_long_action(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
await device_action.async_call_action_from_config(
File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
await platform.async_call_action_from_config(hass, config, variables, context)
File "/usr/src/homeassistant/homeassistant/components/light/device_action.py", line 93, in async_call_action_from_config
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 580, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/wled/helpers.py", line 28, in handler
await func(self, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/wled/light.py", line 251, in async_turn_on
await self.coordinator.wled.segment(**data)
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 515, in segment
await self.request("/json/state", method="POST", data=state)
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 211, in request
response_data = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 84, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1120, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: no digit after exponent sign: line 1 column 863 (char 862)
`

@botfixer
Copy link

I have the same effect. I have 3 segments.
Switching via light service on and off multiple times results in the error message unexpected character: line 1 column 862 (char 861).

After downgrading to 0.13.3 the problem was resolved.

`Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:230
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 17:37:10 (3 occurrences)
Last logged: 17:51:39

[140378849156928] unexpected character: line 1 column 862 (char 861)
[140378833582784] invalid literal: line 1 column 858 (char 857)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 591, in async_handle_light_off_service
await light.async_turn_off(**filter_turn_off_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/wled/helpers.py", line 28, in handler
await func(self, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/wled/light.py", line 208, in async_turn_off
await self.coordinator.wled.segment(
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 515, in segment
await self.request("/json/state", method="POST", data=state)
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/wled/wled.py", line 211, in request
response_data = await response.json()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 84, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1120, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 862 (char 861)
`

@botfixer
Copy link

Looks like ist correlating with Aircoookie/WLED#3447

@Alfagek
Copy link

Alfagek commented Nov 29, 2023

Looks like ist correlating with Aircoookie/WLED#3447

See 2 comments above this post 🫣

@botfixer
Copy link

Looks like ist correlating with Aircoookie/WLED#3447

See 2 comments above this post 🫣

Ups :)

@issue-triage-workflows
Copy link

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.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants