ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
353 stars 50 forks source link

Preset remains unchanged after changing target temperature #54

Closed TTLucian closed 2 years ago

TTLucian commented 2 years ago

If a preset is activated, when manually changing the target temperature the preset should be automatically changed to "none" but actually it remains unchanged.

To Reproduce Steps to reproduce the behavior:

  1. Activate a preset
  2. Change target temperature
  3. The preset remains the same instead of switching to "none"

This behaviour creates confusion among users and problems for schedules and automations. Would be useful if it would change to "none". Or even better, keep in sync with target temperature.

ScratMan commented 2 years ago

Hello, I agree with the option to return the preset to None when target temperature is changed.

IMHO, syncing the preset with target temperature is not recommended. If you set the thermostat in away mode at 16°C before leaving the house, then your child comes back from school and he/she manually sets the temperature to 20°C ; if the temperature is synced to the active preset mode, the away mode will be set to 20°C. Then if a scheduler sets the preset mode to comfort at the end of the day, you won't see that when back at home. The next day when leaving the house, by enabling the away mode, it would set the target temperature to 20°C...

Your first proposal is the best one in my opinion: a preset temperature is defined by the set_preset_temp service only, and when preset is called, it should be reverted to None whenever the target temperature is changed, either manually or by a scheduler. There should be only one limitation: the away mode should not allow temperature to be changed, to avoid having a scheduler setting it back to comfort temperature while you're away for long period. Do you agree ?

bamnoru commented 2 years ago

Just for information : Actually, I used also a Zigbee thermostat, and, I can't change the target temperature when a preset is active. I need to change the preset to "manual", and, then, I'm able to change the target temperature.

TTLucian commented 2 years ago

I'm saying that the sync should be the other way around. Meaning if Away=16 and Home =20 and I activate away, by manually changing to 20 the active preset should be automatically changed to home, or changing to 21 should set the preset to none. I don't think it's a good idea to lock the set temperature to a specific preset because this would limit automations (would need to add extra actions for a geofencing automation, for example, to make sure the temperature gets set as intended) and scheduling (I would rather have the schedule component running as intended rather than getting cold realising that a preset was activated by someone) functionalities not to mention that setting the temperature via Google Assistant, for example, won't work if the preset is active. Locking the target temperature would also limit the "customizability" of the ui, being forced to also add preset buttons along with any custom temperature controls. I'm thinking that the presets are there to be used just as a shortcut to quickly change the target temperature and not anything else, right!? Or, better yet, we can have both by adding an extra list parameter to the config, something like "locked_presets:"... Just saying...

ScratMan commented 2 years ago

I don't think it's a good idea to lock the set temperature to a specific preset because this would limit automations

I agree, not a big issue to manage it in Home Assistant, but it require to carefully develop the automations to manage it while there are already scheduler integration to easily make the heating schedules.

Meaning if Away=16 and Home =20 and I activate away, by manually changing to 20 the active preset should be automatically changed to home, or changing to 21 should set the preset to none.

I really like this approach. Need to think about it.

Or, better yet, we can have both by adding an extra list parameter to the config, something like "locked_presets:"

This should be easy to add once the preset sync is available.

ScratMan commented 2 years ago

The first step is included in v2021.12.5-beta3: automatic sync between temperature and presets.

TTLucian commented 2 years ago

Great! Working as expected! 😃