Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't turn off BTRV after the lowest setpoint temperatur is reached (ex. window was opened) #1393

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion custom_components/better_thermostat/events/trv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}"
Expand Down Expand Up @@ -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"]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is a bad comparison for floats - check equality / non-equality with (not) math.isclose(a, b)

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)
Expand Down
Loading