ChrisHaPunkt / ha-stihl-imow

Using https://github.com/ChrisHaPunkt/stihl-imow-webapi to provide STIHL iMow lawn mower information to Home Assistant
20 stars 1 forks source link

Error using the service startMowingFromPoint #16

Closed steve125125 closed 1 year ago

steve125125 commented 1 year ago

Hello Chris,

the integration works fine. All the sensors are working, but I have trouble with the service to start mowing ( action startMowingFromPoint ). The other services (edgeMowing, toDocking) are working.

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/stihl_imow/services.py:112 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 31. Mai 2023 um 11:29:41 (2 occurrences) Last logged: 31. Mai 2023 um 11:29:51

[548021381840] Error handling message: Unknown error (unknown_error) Stephan from 192.168.168.169 (Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2023.4 (io.robbie.HomeAssistant; build:2023.460; iOS 16.5.0) Mobile/HomeAssistant, like Safari) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 647, in handle_execute_script await script_obj.async_run(msg.get("variables"), context=context) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1533, in async_run await asyncio.shield(run.async_run()) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 410, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 477, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/config/custom_components/stihl_imow/services.py", line 34, in async_call_intent_service await intent_service(hass, entry, service_call, device_registry) File "/config/custom_components/stihl_imow/services.py", line 112, in intent_service await upstream_mower_state.intent( File "/usr/local/lib/python3.10/site-packages/imow/common/mowerstate.py", line 116, in intent await self.imow.intent( File "/usr/local/lib/python3.10/site-packages/imow/api/init.py", line 384, in intent response = await self.api_request(url, "POST", payload=payload) File "/usr/local/lib/python3.10/site-packages/imow/api/init.py", line 314, in api_request raise e File "/usr/local/lib/python3.10/site-packages/imow/api/init.py", line 309, in api_request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://api.imow.stihl.com/mower-actions/')

best regards

jwmaas commented 1 year ago

I have an iMow model 632 for which the startMowingFromPoint command is not recognised. It also generates an Error 403. The issue is that the "imow_action_object" is malformed for the 632 model. I have been doing tests on the imow api code and I believe I have figured out what the issue is. I have made changes to Chris' code (locally) which make it work for me. I have opened an issue above to describe what I did. I am a very inexperienced programmer, so I hope somebody experienced will look at my suggestions to see if these would not mess up the code for other models and perhaps could then be incorporated as a solution. I have not figured out what changes need to be made in the HA integration. I hope very little.

ChrisHaPunkt commented 1 year ago

Currently working on this: https://github.com/ChrisHaPunkt/stihl-imow-webapi/pull/14

ChrisHaPunkt commented 1 year ago

closed in favor of https://github.com/ChrisHaPunkt/ha-stihl-imow/issues/19