Skip to content

Service error in Home Assistant if more than 2 segments are added #3447

@syndikatss

Description

@syndikatss

What happened?

On version wled 0.14, when adding more than 2 segments to the home assistant while turning on the segments, a service error appears (Could not call the light/turn_on service. unexpected character: line 1 column 851 (char 850)

To Reproduce Bug

Add more than 2 segments

Expected Behavior

Operation of more segments

Install Method

Binary from WLED.me

What version of WLED?

WLED 0.14.0

Which microcontroller/board are you seeing the problem on?

ESP8266

Relevant log/trace output

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:226
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 21:43:25 (46 occurrences)
Last logged: 22:44:35

[139642857590848] invalid literal: line 1 column 854 (char 853)
[139642857590848] unexpected character: line 1 column 855 (char 854)
[139642117643584] unexpected end of data: line 1 column 1097 (char 1096)
[139642117643584] unexpected character: line 1 column 852 (char 851)
[139642130458816] unexpected character: line 1 column 851 (char 850)
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 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 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 851 (char 850)

Anything else?

Sorry if the text looks stupid, I wrote it through a translator

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    HomeAssistantbugexternalNot part of WLED itself - an external plugin/remote etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions