ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
511 stars 53 forks source link

incorrect program detection leads to error when starting program remotely #272

Closed nicx closed 9 months ago

nicx commented 9 months ago

Describe the bug

unfortunately, I often have the following problem:

I then go to washing machine I see the display black and remote start flashing. if I activate the display, everything is set correctly. if I then start the program on the washing machine, then also in HA the temperature updates correctly to 40 degrees.

what can I do to solve the problem? :)

Version of the custom_component

0.6.8

Configuration

home_connect_alt:
  client_id: !secret homeconnect_id
  client_secret: !secret homeconnect_secret

Debug log

2023-10-20 12:12:02.957 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [23095110161856] Failed to start the selected program: LaundryCare.Washer.Option.SpinSpeed validation failed with OutOfBounds.  (409)
Traceback (most recent call last):
  File "/config/custom_components/home_connect_alt/button.py", line 98, in async_press
    await self._appliance.async_start_program()
  File "/usr/local/lib/python3.11/site-packages/home_connect_async/appliance.py", line 338, in async_start_program
    return await self._async_set_program(program_key, options, 'active')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/home_connect_async/appliance.py", line 455, in _async_set_program
    raise HomeConnectError(response.error_description, response=response)
home_connect_async.common.HomeConnectError: ('LaundryCare.Washer.Option.SpinSpeed validation failed with OutOfBounds. ', None, 'SDK.Error.InvalidOptionValue', 'LaundryCare.Washer.Option.SpinSpeed validation failed with OutOfBounds. ', None)

During handling of the above exception, another exception occurred:

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/button/__init__.py", line 124, in _async_press_action
    await self.async_press()
  File "/config/custom_components/home_connect_alt/button.py", line 105, in async_press
    raise HomeAssistantError(f"Failed to start the selected program: {ex.error_description} ({ex.code})")
homeassistant.exceptions.HomeAssistantError: Failed to start the selected program: LaundryCare.Washer.Option.SpinSpeed validation failed with OutOfBounds.  (409)
ekutner commented 9 months ago

How do you start the program? Please do the following:

  1. Enable debug logging (see how in the README) and add log_mode: 7 to the home_connect_alt section in configuration.yaml
  2. Enable remote operation on the appliance
  3. Set the temperature
  4. Press the Home Connect Debug Info button in HA UI
  5. Start the program

Upload the log here

nicx commented 9 months ago

@ekutner after some more tests I think its a bug in home connect itself. the original app is showing the same wrong washing temperature.

The problem only persist if the washing machine is turned on and the temperature is not changed manually. so if you just want to keep the already shown temperature, the app shows "cold" instead of eg 40 degrees. same for the integration. the remote start is not working in this state.

workaround: if you want the temperature which is alredy shown when turning on the machine, you have to flip through all temperatures until you see the 40 degrees again. then the app and integration shows the correct value, and the remote start works as expected.

ekutner commented 9 months ago

I see. Feel free to report the issue to HA support. As a workaround which would probably work you can try to create an automation that selects the current program when an appliance becomes connected.