jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
329 stars 34 forks source link

Service set_preset_temperature requires preset #269

Closed I-Would-Like-To-Report-A-Bug-Please closed 11 months ago

I-Would-Like-To-Report-A-Bug-Please commented 11 months ago

Version of the custom_component

4.2.1

Configuration

My VTherm attributes are the following:

hvac_modes: auto, heat, off
min_temp: 7
max_temp: 35
target_temp_step: 1
preset_modes: none
current_temperature: 19.8
temperature: 18.5
hvac_action: heating
preset_mode: none
is_on: true
hvac_mode: heat
type: null
eco_temp: 0
boost_temp: 0
comfort_temp: 0
eco_away_temp: null
boost_away_temp: null
comfort_away_temp: null
power_temp: null
target_temperature_step: 1
ext_current_temperature: 11.36
ac_mode: false
current_power: null
current_power_max: null
saved_preset_mode: none
saved_target_temp: 18.5
saved_hvac_mode: null
window_state: off
motion_state: null
overpowering_state: null
presence_state: null
window_auto_state: off
window_bypass_state: false
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: 2023-12-12T05:10:33.008971+00:00
last_ext_temperature_datetime: 2023-12-12T05:47:51.048170+00:00
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: null
total_energy: 55.33
last_update_datetime: 2023-12-12T05:50:17.464071+00:00
timezone: Europe/London
window_sensor_entity_id: binary_sensor.data_window_livingroom_door
window_delay_sec: 30
window_auto_enabled: false
window_auto_open_threshold: null
window_auto_close_threshold: null
window_auto_max_duration: null
motion_sensor_entity_id: null
presence_sensor_entity_id: null
power_sensor_entity_id: null
max_power_sensor_entity_id: null
temperature_unit: °C
is_device_active: true
ema_temp: 19.71
is_over_climate: true
start_hvac_action_date: 2023-12-12T05:49:47.536409+00:00
underlying_climate_0: climate.heating_trv_livingroom
underlying_climate_1: null
underlying_climate_2: null
underlying_climate_3: null
is_regulated: true
regulated_target_temperature: 18
auto_regulation_mode: auto_regulation_medium
regulation_accumulated_error: -20
friendly_name: Versatile Living Room
supported_features: 17

Describe the bug

I'm trying to automatically set the thermostat temperature to 17 degrees via set_preset_temperature service.

According to the documentation:

None is always added in the list of modes, as it is a way to not use the presets modes but a manual temperature instead.

So my automation call looks like this:

    then:
      - service: versatile_thermostat.set_preset_temperature
        data:
          temperature: 17.5
          preset: none
        target:
          device_id: 8d51f3c5e5029800bb7458a0a8a9ed2d

But when tracing the call I can see in the log:

"value must be one of ['boost', 'boost_ac', 'comfort', 'comfort_ac', 'eco', 'eco_ac'] for dictionary value @ data['preset']"

I have tried as well without setting the preset but it pretty much drops the same information.

Additionally, you can't select None in Service call automatically in HA UI.

jmcollin78 commented 11 months ago

Hello,

set_preset_temperature is not for changing the target temperature but for changing the programmed preset temperature.

To change the target temperature, you just have to use : climate.set_temperature (or something like that)