From b532d7760a9377ccc7774254b65a9e5c2ecf311d Mon Sep 17 00:00:00 2001 From: TBSniller Date: Sun, 15 Sep 2024 16:09:16 +0000 Subject: [PATCH 1/2] stop changing BT HVACMode after temperatur change --- custom_components/better_thermostat/events/trv.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/custom_components/better_thermostat/events/trv.py b/custom_components/better_thermostat/events/trv.py index 876ffe0f..56f5b06c 100644 --- a/custom_components/better_thermostat/events/trv.py +++ b/custom_components/better_thermostat/events/trv.py @@ -201,13 +201,6 @@ async def trigger_trv_change(self, event): _main_change = True - if self.real_trvs[entity_id]["advanced"].get("no_off_system_mode", False): - if _new_heating_setpoint == self.real_trvs[entity_id]["min_temp"]: - self.bt_hvac_mode = HVACMode.OFF - else: - self.bt_hvac_mode = HVACMode.HEAT - _main_change = True - if _main_change is True: self.async_write_ha_state() return await self.control_queue_task.put(self) From 3365c60f720447c73a91f331ddf38f3cbad65e04 Mon Sep 17 00:00:00 2001 From: Tobias Haber Date: Sun, 3 Nov 2024 21:36:33 +0100 Subject: [PATCH 2/2] Update trv.py --- custom_components/better_thermostat/events/trv.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/custom_components/better_thermostat/events/trv.py b/custom_components/better_thermostat/events/trv.py index 56f5b06c..ed86168f 100644 --- a/custom_components/better_thermostat/events/trv.py +++ b/custom_components/better_thermostat/events/trv.py @@ -157,7 +157,10 @@ async def trigger_trv_change(self, event): if ( _new_heating_setpoint is not None and _old_heating_setpoint is not None - and self.bt_hvac_mode is not HVACMode.OFF + and ( + self.bt_hvac_mode is not HVACMode.OFF + or self.real_trvs[entity_id]["advanced"].get("no_off_system_mode", False) + ) ): _LOGGER.debug( f"better_thermostat {self.name}: trigger_trv_change test / _old_heating_setpoint: {_old_heating_setpoint} - _new_heating_setpoint: {_new_heating_setpoint} - _last_temperature: {self.real_trvs[entity_id]['last_temperature']}" @@ -201,6 +204,13 @@ async def trigger_trv_change(self, event): _main_change = True + if self.real_trvs[entity_id]["advanced"].get("no_off_system_mode", False): + if _new_heating_setpoint == self.real_trvs[entity_id]["min_temp"]: + self.bt_hvac_mode = HVACMode.OFF + else: + self.bt_hvac_mode = HVACMode.HEAT + _main_change = True + if _main_change is True: self.async_write_ha_state() return await self.control_queue_task.put(self)