astrandb / miele

A modern integration for Miele devices in Home Assistant
MIT License
209 stars 31 forks source link

Cannot set temp via climate entity #516

Closed CFenner closed 3 months ago

CFenner commented 3 months ago

The problem

On the climate entity I cannot change the target temp like on e.g. my heating device:

Bildschirmfoto 2024-08-05 um 09 15 46

It would be nice, to use the UI to change the target temp and to have that reflected in the climate card.

Bildschirmfoto 2024-08-05 um 09 14 04 Bildschirmfoto 2024-08-05 um 09 19 39

Version of miele integration having the issue?

latest

Version of Home Assistant Core having the issue?

latest

Anything in the logs that might be useful for us?

No response

Additional information

No response

astrandb commented 3 months ago

I can confirm that setting of target temperature for freezers and refrigerators is no longer working in my devices either. I'll be back...

CFenner commented 3 months ago

I get this via the service:

DEBUG (MainThread) [custom_components.miele.climate] kwargs: {'temperature': 15.0, 'device_id': ['xxx']}
ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 400, message='Bad Request', url=URL('https://api.mcs3.miele.com/v1/devices/yyy/actions')
File "/config/custom_components/miele/climate.py", line 266, in async_set_temperature
File "/usr/local/lib/python3.12/site-packages/pymiele/pymiele.py", line 85, in set_target_temperature
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://api.mcs3.miele.com/v1/devices/yyy/actions')
File "/config/custom_components/miele/climate.py", line 266, in async_set_temperature
File "/usr/local/lib/python3.12/site-packages/pymiele/pymiele.py", line 85, in set_target_temperature
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://api.mcs3.miele.com/v1/devices/yyy/actions')
CFenner commented 3 months ago

On the entity the temperature is null, once I set this to anything, I at least see the +/- buttons and the target temp on the UI.

hvac_modes:
  - cool
min_temp: -28
max_temp: -15
target_temp_step: 1
current_temperature: -18
temperature: null
friendly_name: Gefrierschrank
supported_features: 1
CFenner commented 3 months ago

@astrandb it works again if I remove that condition (see pr).

astrandb commented 3 months ago

I just found the problem. The argument to get() should not be quoted. I will fix when I get back to keyboard.

CFenner commented 3 months ago

Great, works fine. I also adjusted my PR, if you don't mind to merge that..