ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
338 stars 49 forks source link

Error on calling climate.set_preset_mode from an automation #28

Closed ejalal closed 2 years ago

ejalal commented 2 years ago

Hello

I just replaced one of my generic_thermostat(s) with this smart_thermostat to experiment with and see if it could be a long term replacement for all my other thermostats, and I'm having an error fitting it with my existing automations (with node red)

I have this error when I call climate.set_preset_mode (inherited from the old generic_thermostat), any help would be much appreciated.

Testing from HA Developer Tools gives the same result

service: climate.set_preset_mode
data:
  preset_mode: none
target:
  entity_id:
    - climate.bathroom
2021-11-29 08:57:04 ERROR (SyncWorker_17) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 863, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 704, in _handle_entity_call
    await result
  File "/config/custom_components/smart_thermostat/climate.py", line 649, in async_set_preset_mode
    self._target_temp = self.presets[preset_mode]
KeyError: 'none'
ScratMan commented 2 years ago

Hi, issue confirmed. It occurs when trying to switch preset mode from 'none' to 'none'. A commit will be added to next release.

ScratMan commented 2 years ago

Closed with release v2021.11.9