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

Tolerance does not work #1314

Open
IvoryBalboa opened this issue Mar 12, 2024 · 31 comments
Open

Tolerance does not work #1314

IvoryBalboa opened this issue Mar 12, 2024 · 31 comments
Assignees
Labels
bug Something isn't working

Comments

@IvoryBalboa
Copy link

IvoryBalboa commented Mar 12, 2024

Prerequisites

{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2024.3.0",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.12.2",
"docker": true,
"arch": "aarch64",
"timezone": "Europe/Berlin",
"os_name": "Linux",
"os_version": "6.1.73-haos-raspi",
"supervisor": "2024.02.1",
"host_os": "Home Assistant OS 12.0",
"docker_version": "24.0.7",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"better_thermostat": {
"version": "1.5.0-beta7",
"requirements": []
},
"spook_inverse": {
"version": "2.2.1",
"requirements": []
},
"alexa_media": {
"version": "4.9.1",
"requirements": [
"alexapy==1.27.10",
"packaging>=20.3",
"wrapt>=1.14.0"
]
},
"fordpass": {
"version": "0.1.66",
"requirements": []
},
"multiscrape": {
"version": "6.5.0",
"requirements": [
"lxml>=4.9.1",
"beautifulsoup4>=4.12.2"
]
},
"hacs": {
"version": "1.34.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"powercalc": {
"version": "v1.10.5",
"requirements": [
"numpy>=1.21.1"
]
},
"robovac": {
"version": "1.0.0",
"requirements": []
},
"spook": {
"version": "2.2.1",
"requirements": []
},
"waste_collection_schedule": {
"version": "1.45.1",
"requirements": [
"icalendar",
"recurring_ical_events",
"icalevents",
"beautifulsoup4",
"lxml"
]
}
},
"integration_manifest": {
"domain": "better_thermostat",
"name": "Better Thermostat",
"after_dependencies": [
"climate"
],
"codeowners": [
"@KartoffelToby"
],
"config_flow": true,
"dependencies": [
"climate",
"recorder"
],
"documentation": "https://github.com/KartoffelToby/better_thermostat",
"iot_class": "local_push",
"issue_tracker": "https://github.com/KartoffelToby/better_thermostat/issues",
"requirements": [],
"version": "1.5.0-beta7",
"is_built_in": false
},
"data": {
"info": {
"name": "Badezimmer",
"temperature_sensor": "sensor.luftsensor_badezimmer_temperatur",
"off_temperature": 20,
"tolerance": 0.3,
"target_temp_step": "0.1",
"humidity_sensor": "sensor.luftsensor_badezimmer_luftfeuchtigkeit",
"outdoor_sensor": "sensor.temperatur_aussen",
"window_sensors": "binary_sensor.fenster_badezimmer",
"window_off_delay": 10,
"window_off_delay_after": 300,
"weather": null,
"cooler": null,
"model": "lumi.airrtc.agl001"
},
"thermostat": {
"climate.hk_badezimmer": {
"name": "HK Badezimmer",
"state": "heat",
"attributes": {
"hvac_modes": [
"off",
"heat"
],
"min_temp": 7.0,
"max_temp": 30.0,
"current_temperature": 22.7,
"temperature": 22.5,
"system_mode": "[4]/heat",
"occupied_cooling_setpoint": 700,
"occupied_heating_setpoint": 2250,
"friendly_name": "HK Badezimmer",
"supported_features": 385
},
"bt_config": {
"calibration": "target_temp_based",
"calibration_mode": "default",
"protect_overheating": true,
"no_off_system_mode": false,
"heat_auto_swapped": false,
"child_lock": true,
"homaticip": false
},
"bt_adapter": "zha",
"bt_integration": "zha",
"model": "lumi.airrtc.agl001"
}
},
"external_temperature_sensor": {
"entity_id": "sensor.luftsensor_badezimmer_temperatur",
"state": "21.3",
"attributes": {
"state_class": "measurement",
"unit_of_measurement": "\u00b0C",
"device_class": "temperature",
"friendly_name": "Badezimmer Temperatur"
},
"last_changed": "2024-03-12T10:38:30.400117+00:00",
"last_updated": "2024-03-12T10:38:30.400117+00:00",
"context": {
"id": "01HRS3W2G0JHNX03S11FF9QDG8",
"parent_id": null,
"user_id": null
}
},
"window_sensor": {
"entity_id": "binary_sensor.fenster_badezimmer",
"state": "off",
"attributes": {
"device_class": "window",
"icon": "mdi:window-closed-variant",
"friendly_name": "Fenster Badezimmer"
},
"last_changed": "2024-03-11T08:10:36.381863+00:00",
"last_updated": "2024-03-11T08:10:36.381863+00:00",
"context": {
"id": "01HRP90HEX4H2BJXS3NS6CJD0F",
"parent_id": null,
"user_id": null
}
}
}
}

Description

The tolerance (0.3 in my case) does not work. The temperature is set to 21.5° and if current temperature drops to 21.4°, the BT switches from idle to heating. I tried different settings for the tolerance, but none of them worked.

@IvoryBalboa IvoryBalboa added the new bug incoming bug issue label Mar 12, 2024
@kirush0280
Copy link

I can confirm, tolerance set to 1
image

@icex2
Copy link

icex2 commented Apr 28, 2024

Tested 1.5.0 and 1.5.1 with the currently latest core HA version 2024.4.4 and the tolerance value of any of my better thermostat entities is not considered. Downgrading to better thermostat 1.4.0 mitigates the issue for me. Tested with different better thermostat entities and tolerance values (0.5, 1, 2, 5).

Would be great to get this fixed, since my heating keeps turning on and off on minor temperature drops in my basement where I set the tolerance value to 2 to avoid this.

Let me know if I can further support the debugging process, e.g. providing information such as logs or testing anything.

@Mkyuu10
Copy link

Mkyuu10 commented Oct 20, 2024

Same Problem here, but downgrading to BT 1.4.0 does not help.
I'm using temperature calibration mode.

@Soukyuu
Copy link

Soukyuu commented Nov 3, 2024

So from what I gathered, what happens is the following (running 1.6.0):

  • create a new better thermostat entity
  • leave tolerance at default value
  • finish the setup
  • realize you forgot to adjust the tolerance value
  • enter configure dialog
  • change the tolerance value
  • confirm the tolerance value is displayed in the enitity's attributes
  • tableflip at thermostat still opening and closing all the time if temp drops 0.1° below setpoint

-> it seems that the tolerance value is not correctly applied upon re-configuring the entity, even though the entity itself thinks it is. The only fix is to delete the BT device and restart.

Additionally, please consider setting a sane default value for tolerance, a value of 0 is really not useful. Something like 0.3 could be a good balance.

@Soukyuu
Copy link

Soukyuu commented Nov 3, 2024

Actually, scratch the fix part. Still happening even after re-creating with correct values. Downgrading does not help. Tolerance is sadly broken.

@KartoffelToby
Copy link
Owner

@Soukyuu can you prove its still broken with 1.6.1?

@KartoffelToby KartoffelToby added bug Something isn't working under investigation If its not clear whats the problem and removed new bug incoming bug issue labels Nov 3, 2024
@Soukyuu
Copy link

Soukyuu commented Nov 4, 2024

@KartoffelToby sadly yes. Temp just dropped from 21 (setpoint) to 20.9 and BT changed to "heat", TRV opened (and now it closed again). Tolerance on a freshly created instance is set to 0.3

@mirddin
Copy link

mirddin commented Nov 5, 2024

I wasn't taking part in the this thread before, but I can confirm as well, tolerance doesn't work for me with v.1.6.1. Regardless of the setup, it turns on/off with 0.1 changes.

@KartoffelToby
Copy link
Owner

Some trv has internal alg. That can lead to issues. So make sure you enable the overheat protection in BT config.

Anyway there are some possible Bugs and i currently running testings.

@mirddin
Copy link

mirddin commented Nov 6, 2024

Thanks a lot, @KartoffelToby! I tried overheat protection and the behavior is the same.
With built-in generic thermostat tolerance works fine.
Just in case, here's the image of what I use
sterownik_ogrzewania_pogodowego_zigbee

@kirush0280
Copy link

kirush0280 commented Nov 6, 2024

image
image
Tolerance = 1C, but its turn on/off too often. Mode: Offset/Aggresive.
Version: 1.6.1
I changed tolerance to 2 and restart thermostate in garagge, but graph hasn't changed

@kirush0280
Copy link

upgraded to z2m 1.41 - without changes

@szokezoltan95
Copy link

szokezoltan95 commented Nov 8, 2024

Had the same issue on the latest version. For me downgrading to 1.4 and reconfiguring all the thermostats from scratch seems to have helped.
The last part of the graphs is on 1.4, (temperature, humidity and offset for 4 rooms)

Screenshot_20241108-210203

@KartoffelToby
Copy link
Owner

1.7.0 Beta 1 should address the problem, but remember that with small tolerances it is difficult to determine whether external influences are simply driving the temperature up. So if 20 is set with a tolerance of 0.1, for example, the temperature should never fall below 19.8. But if the room continues to heat up, it can also go over 20.1. The crucial thing is that the thermostat is no longer actively heating. And this bug should actually be fixed with 1.7.0.

@Soukyuu
Copy link

Soukyuu commented Nov 9, 2024

Screenshot_20241109_093551

Sadly, 1.7.0b1 does not fix the behavior for me. I have manually dropped the temperature on the thermometer entity from 21.1 to 20.9 and BT entity instantly turned to heating mode, despite tolerance value of 0.3. I have also tried re-creating the entity from scratch and same thing.

@kirush0280
Copy link

Agree, I have tolerance 2, not 0.2. And its work wrong:
image

@IvoryBalboa
Copy link
Author

IvoryBalboa commented Nov 11, 2024

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.

Example:
My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle

This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

@kirush0280
Copy link

kirush0280 commented Nov 17, 2024

image
Its doesn't work. I deleted thermostat, and added again.
Tolerance = 1
MOES TS0601 / _TZE200_e9ba97vf
Mode: Offset/Aggresive.
Version: 1.7.0b1

@ss8n
Copy link

ss8n commented Dec 5, 2024

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.

Example: My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle

This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

I find the same behavior in 1.6.1, but my automation are based on the real thermostats' hvac action, however in my displayed cards, the better thermostats show as heating, but valves are closed.
Would be nice if this can be fixed based on the tolerance value set.

@ss8n
Copy link

ss8n commented Dec 7, 2024

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.

Example: My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle

This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

I've looked a bit into the BT files, and I found out that the tolerance was missing from the HVAC action of BT, so modifying the file climate.py in your custom components > BT folder, lines 1122 and 1125 in my case (Version 1.6.1) to add the tolerance will fix the issue (in bold below):
"""Return the current HVAC action"""
if self.bt_target_temp is not None and self.cur_temp is not None:
if self.hvac_mode == HVACMode.OFF:
self.attr_hvac_action = HVACAction.OFF
elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False:
self.attr_hvac_action = HVACAction.HEATING
elif (
self.bt_target_temp > self.cur_temp + self.tolerance
and self.window_open is False
and self.bt_hvac_mode is not HVACMode.OFF
):
self.attr_hvac_action = HVACAction.HEATING
else:
self.attr_hvac_action = HVACAction.IDLE
return self.attr_hvac_action

@mirddin
Copy link

mirddin commented Dec 7, 2024

@ss8n your patch seems to be working for me. Thanks a lot for your contribution!

@PatrikPihrt
Copy link

@ss8n Nice catch! I was already finding a workaround but this was much easier. This should definitely be part of the production code in the next release.

@ss8n
Copy link

ss8n commented Dec 7, 2024

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.
Example: My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle
This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

I've looked a bit into the BT files, and I found out that the tolerance was missing from the HVAC action of BT, so modifying the file climate.py in your custom components > BT folder, lines 1122 and 1125 in my case (Version 1.6.1) to add the tolerance will fix the issue (in bold below): """Return the current HVAC action""" if self.bt_target_temp is not None and self.cur_temp is not None: if self.hvac_mode == HVACMode.OFF: self.attr_hvac_action = HVACAction.OFF elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False: self.attr_hvac_action = HVACAction.HEATING elif ( self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.HEATING else: self.attr_hvac_action = HVACAction.IDLE return self.attr_hvac_action

Plus, if you'd like the thermostat to reach the set temperature and not idle at: set minus tolerance, I think replacing the last "else:" should in theory do just that (changes in bold), but not sure how the interaction with the real thermostat impacts the opened or closed valve based on tolerance, but will look into that at some point if it isn't fixed by then:

"""Return the current HVAC action"""
if self.bt_target_temp is not None and self.cur_temp is not None:
if self.hvac_mode == HVACMode.OFF:
self.attr_hvac_action = HVACAction.OFF
elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False:
self.attr_hvac_action = HVACAction.HEATING
elif (
self.bt_target_temp > self.cur_temp + self.tolerance
and self.window_open is False
and self.bt_hvac_mode is not HVACMode.OFF
):
self.attr_hvac_action = HVACAction.HEATING
#else:
elif (
self.bt_target_temp <= self.cur_temp
and self.window_open is False
and self.bt_hvac_mode is not HVACMode.OFF
):
self.attr_hvac_action = HVACAction.IDLE

return self.attr_hvac_action

@PatrikPihrt
Copy link

PatrikPihrt commented Dec 7, 2024

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.

Example: My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle

This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

I've looked a bit into the BT files, and I found out that the tolerance was missing from the HVAC action of BT, so modifying the file climate.py in your custom components > BT folder, lines 1122 and 1125 in my case (Version 1.6.1) to add the tolerance will fix the issue (in bold below): """Return the current HVAC action""" if self.bt_target_temp is not None and self.cur_temp is not None: if self.hvac_mode == HVACMode.OFF: self.attr_hvac_action = HVACAction.OFF elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False: self.attr_hvac_action = HVACAction.HEATING elif ( self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.HEATING else: self.attr_hvac_action = HVACAction.IDLE return self.attr_hvac_action

Plus, if you'd like the thermostat to reach the set temperature and not idle at: set minus tolerance, I think replacing the last "else:" should in theory do just that (changes in bold), but not sure how the interaction with the real thermostat impacts the opened or closed valve based on tolerance, but will look into that at some point if it isn't fixed by then:

"""Return the current HVAC action"""

    if self.bt_target_temp is not None and self.cur_temp is not None:

        if self.hvac_mode == HVACMode.OFF:

            self.attr_hvac_action = HVACAction.OFF

        elif self.bt_target_temp > self.cur_temp + self.tolerance  and self.window_open is False:

            self.attr_hvac_action = HVACAction.HEATING

        elif (

            self.bt_target_temp > self.cur_temp + self.tolerance

            and self.window_open is False

            and self.bt_hvac_mode is not HVACMode.OFF

        ):

            self.attr_hvac_action = HVACAction.HEATING

        **_#else:

        elif (

            self.bt_target_temp <= self.cur_temp

            and self.window_open is False

            and self.bt_hvac_mode is not HVACMode.OFF

        ):

            self.attr_hvac_action = HVACAction.IDLE_**

    return self.attr_hvac_action

I noticed that when it went from lower temperature (lower than target - tolerance) it turned to idle when it went into tolerance zone. That new elif seems to deal with it correctly. I'm testing it now and if some tuning will be needed I will try to solve it and post it here.

@ss8n Thanks again. This solved my problem so far and saved me a lot of time😊

@icex2
Copy link

icex2 commented Dec 7, 2024

I updated to 1.7.0b1 and hot-patched one missing + self.tolerance as outlined above. Been testing this for the last 24h and my heating appears to be functioning correctly thus far. Thanks for looking into this @ss8n.

@ss8n
Copy link

ss8n commented Dec 8, 2024

Also commented lines 95, 96 and 97 from calibration.py because I want my real TRVs to mimic the external sensor temperature and not take in account the tolerance, as that is handled by the changes in BT from above.
FYI i'm using offset calibration mode on my TRVs, not sure this works for target temp based. Changes in bold:
# Respecting tolerance in all calibration modes, delaying heat
#if self.attr_hvac_action == HVACAction.IDLE:
#if _new_trv_calibration < 0.0:
#_new_trv_calibration += self.tolerance

LE: plus lines 188, 189, 190:

**#if self.attr_hvac_action == HVACAction.IDLE:
     #if _calibrated_setpoint - _cur_trv_temp_s > 0.0:
         #_calibrated_setpoint -= self.tolerance**

@andyxpert
Copy link

https://github.com/andyxpert/better_thermostat/releases/tag/Rewrote-hvac

A different take on the hvac method
Configured the entity with No Calibration and used the same Tolerance as the original climate entity (generic thermostat).
Works as expected.

However due to personal preference I'm switching to Versatile Thermostat as it doesn't use an underlying thermostat and can control the switch directly.

@IvoryBalboa
Copy link
Author

WARNING, THIS IS UNTESTED CODE!!!!

I think it should be something like this:

    if self.bt_target_temp is not None and self.cur_temp is not None:
        if self.hvac_mode == HVACMode.OFF:
            self.attr_hvac_action = HVACAction.OFF
        elif (
            self.bt_target_temp > self.cur_temp + self.tolerance
            and self.window_open is False
            and self.bt_hvac_mode is not HVACMode.OFF
        ):
            self.attr_hvac_action = HVACAction.HEATING
        elif (
            self.bt_target_temp > self.cur_temp
            and self.attr_hvac_action is HVACAction.HEATING
            and self.window_open is False
            and self.bt_hvac_mode is not HVACMode.OFF
         ):
            self.attr_hvac_action = HVACAction.HEATING
        else:
            self.attr_hvac_action = HVACAction.IDLE
    return self.attr_hvac_action

This ensures the hvac_action stays on heating if cur_temp is rising. if bt_target_temp is reached the hvac_action goes to idle. if cur_temp+tolerance falls below bt_target_temp the hvac_action goes back to heating.

If someone wants to try, please let me know if it works. I am currently not at home and dont want to mess with my system.
Only thing i tried is kind of sandbox-mode in developer-mode->template:

    {% set ziel = 22 %}
    {% set aktuell = 22 %}
    {% set toleranz = 0.1 %}
    {% set mode = 'heating' %}
    
    {% if ziel > aktuell + toleranz %}
    heating
    {% elif ziel > aktuell and mode == 'heating' %}
    heating
    {% else %}
    idle
    {% endif %}

With this template you can 'simulate' my attempt above

@IvoryBalboa
Copy link
Author

With 1.7.0b1 it seems that the tolerance is working, but the BT-climate does not show 'idle' in hvac-action.
Example: My BT-climate is set to 18° with tolerance 0.3°, measured temperature is 17.7° and the "real" TRV is set to 11.5°. BT-climate says hvac_action: heating instead of hvac_action: idle
This kind of breaks my automations, because i use the hvac_action: heating to turn my boiler on. but now, the "real" TRVs in each room might be closed, because the heating_action in BT stays heating.

I've looked a bit into the BT files, and I found out that the tolerance was missing from the HVAC action of BT, so modifying the file climate.py in your custom components > BT folder, lines 1122 and 1125 in my case (Version 1.6.1) to add the tolerance will fix the issue (in bold below): """Return the current HVAC action""" if self.bt_target_temp is not None and self.cur_temp is not None: if self.hvac_mode == HVACMode.OFF: self.attr_hvac_action = HVACAction.OFF elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False: self.attr_hvac_action = HVACAction.HEATING elif ( self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.HEATING else: self.attr_hvac_action = HVACAction.IDLE return self.attr_hvac_action

Plus, if you'd like the thermostat to reach the set temperature and not idle at: set minus tolerance, I think replacing the last "else:" should in theory do just that (changes in bold), but not sure how the interaction with the real thermostat impacts the opened or closed valve based on tolerance, but will look into that at some point if it isn't fixed by then:

"""Return the current HVAC action""" if self.bt_target_temp is not None and self.cur_temp is not None: if self.hvac_mode == HVACMode.OFF: self.attr_hvac_action = HVACAction.OFF elif self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False: self.attr_hvac_action = HVACAction.HEATING elif ( self.bt_target_temp > self.cur_temp + self.tolerance and self.window_open is False and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.HEATING #else: elif ( self.bt_target_temp <= self.cur_temp and self.window_open is False and self.bt_hvac_mode is not HVACMode.OFF ): self.attr_hvac_action = HVACAction.IDLE return self.attr_hvac_action

This works if current temperature is rising, but after that the hvac_action is none until it gets heating again.
My code above solves this, but someone needs to test like i said above

@IvoryBalboa
Copy link
Author

IvoryBalboa commented Dec 12, 2024

I just did some testing and came up with this:

@property
def hvac_action(self):
    """Return the current HVAC action"""
    if self.bt_target_temp is not None and self.cur_temp is not None:
        if self.hvac_mode == HVACMode.OFF:
            self.attr_hvac_action = HVACAction.OFF
        elif (
            self.bt_target_temp > self.cur_temp + self.tolerance
            and self.window_open is False
            and self.bt_hvac_mode is not HVACMode.OFF
        ):
            self.attr_hvac_action = HVACAction.HEATING
        elif (
            self.bt_target_temp <= self.cur_temp
            and self.window_open is False
            and self.bt_hvac_mode is not HVACMode.OFF
         ):
            self.attr_hvac_action = HVACAction.IDLE
        else:
            self.attr_hvac_action = self.old_attr_hvac_action
    return self.attr_hvac_action

This works like a charm! If cur_temp rises, hvac_action stays heating until target_temp=cur_temp and then goes to idle. It stays in idle until target_temp>=cur_temp+tolerance. With this code the hvac_action is always defined an doesnt become none in some cases like the code from @ss8n

This is at least how i personally think the tolerance should work

@MaJerle
Copy link

MaJerle commented Feb 9, 2025

Is there an intent to merge this to master branch and make a release? With TRVs, it drains unnecessary battery for motor movements, when temperature oscillates around the target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests