Rest command error occured when calling ressource


between some days i have some error whith my rest command :

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:31:46 (1 occurrences)
Last logged: 10:31:46

[547109836736] Client error occurred when calling resource ''
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 966, in start
    message, payload = await  # type: ignore[union-attr]
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 622, in read
    await self._waiter
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 224, in data_received
    messages, upgraded, tail = self._parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message:
  Expected HTTP/:


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/rest_command/", line 143, in async_service_handler
    async with getattr(websession, method)(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 1194, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 605, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/", line 968, in start
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message="Expected HTTP/:\n\n  b'OK'\n    ^", url=URL('')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/", line 240, in handle_call_service
    response = await
  File "/usr/src/homeassistant/homeassistant/", line 2279, in async_call
    response_data = await coro
  File "/usr/src/homeassistant/homeassistant/", line 2316, in _execute_service
    return await target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/rest_command/", line 199, in async_service_handler
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Client error occurred when calling resource ''

this is my switch to pass the order in my other box :

- platform: template
         service: rest_command.volet_cuisine_on
         service: rest_command.volet_cuisine_off
# Volet Cuisine ON
    url: ''
# Volet Cuisine OFF
     url: ''

Could you help me please ? I don’t find the solution …


Hi, nobody could help me please ?

I’ve been having issues in the last days with one of my restful command. It worked for years and all of a sudden it stopped working. I’m thinking that an update broke it.

url: “” - this works
url: “” - this does not work anymore - if I access the link in a normal browser the command works

Any ideas? Anyone?

I have exactly the same problem. With a error message in each action…

Strange, someone could help us please ?

Same problem over here but with two restful commands in a row (in the same automation) the first one is well executed (but with an error in the log) and all following commands are neglected.

Same problem after upgrade to 2024.2.3.

Filed bug report

My problem was due to the target device responding with the obsolete HTTP/0.9 protocol. Home Assistant now reports an error on the unexpected response. Adding continue_on_error to the service call resolves the problem, although the log continues to record the error.

hello @BobS

i have the same problem for my switch :grinning:

  - platform: template
        unique_id: old_radio_macro
          service: switch.turn_on
            entity_id: switch.on_off_old_radio
        - service:  rest_command.turn_off_http_old_radio
        - delay: '00:03:00'
        - service: switch.turn_off
            entity_id: switch.on_off_old_radio

in my case where i add " continue_on_error" ligne please