Bonjour,
depuis quelques jours j’ai des problèmes avec mes command rest. Lorsque je clic dessus, j’ai le message : An error occurred while requesting the resource qui apparait.
Dans le journal de log j’ai cette erreur :
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:240
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 'http://192.168.1.30/cgi-bin/domo.cgi?cmd=ON%20A1%20P10'
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 966, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 622, in read
await self._waiter
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_proto.py", 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/:
b'OK'
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 143, in async_service_handler
async with getattr(websession, method)(
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 605, in _request
await resp.start(conn)
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 968, in start
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message="Expected HTTP/:\n\n b'OK'\n ^", url=URL('http://192.168.1.30/cgi-bin/domo.cgi?cmd=ON%20A1%20P10')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 199, in async_service_handler
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Client error occurred when calling resource 'http://192.168.1.30/cgi-bin/domo.cgi?cmd=ON%20A1%20P10'
Voici comment je les lance. J’ai un switch qui e lance la commande :
- platform: template
switches:
volet_cuisine:
turn_on:
service: rest_command.volet_cuisine_on
turn_off:
service: rest_command.volet_cuisine_off
rest_command:
# Volet Cuisine ON
volet_cuisine_on:
url: 'http://192.168.1.30/cgi-bin/domo.cgi?cmd=ON%20A1%20P10'
# Volet Cuisine OFF
volet_cuisine_off:
url: 'http://192.168.1.30/cgi-bin/domo.cgi?cmd=OFF%20A1%20P10'
Quelqu’un aurait il une idée ?