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" not working #1136

Open
andreaconfa opened this issue Nov 12, 2023 · 9 comments
Open

"Tolerance" not working #1136

andreaconfa opened this issue Nov 12, 2023 · 9 comments
Assignees
Labels
new bug incoming bug issue

Comments

@andreaconfa
Copy link

Hi all

I'm using BT with 6x Aqara TRV Smart Radiator Thermostat E1.

Everythig is working great exept for the "Tolerance" configuration.

There is no way to make it work.

I tried even to set it to 5, but the BT thermostat entity start heating as soon as the current setpoint is above the current temperature, without considering the tolerance parameter.

Maybe there is something that i'm missing?

Here an export of one of the six BT entities:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.11.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Rome",
    "os_name": "Linux",
    "os_version": "6.1.59",
    "supervisor": "2023.11.0",
    "host_os": "Home Assistant OS 11.1",
    "docker_version": "24.0.6",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "better_thermostat": {
      "version": "1.4.0",
      "requirements": []
    }
  },
  "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.4.0",
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "Calorifero Anticamera",
      "temperature_sensor": "sensor.temperatura_anticamera_zigbee_temperature",
      "off_temperature": 20,
      "tolerance": 1.0,
      "humidity_sensor": "sensor.temperatura_anticamera_zigbee_humidity",
      "window_off_delay": 600,
      "window_off_delay_after": 600,
      "weather": "weather.casa",
      "window_sensors": null,
      "outdoor_sensor": null,
      "cooler": null,
      "model": "SRTS-A01"
    },
    "thermostat": {
      "climate.calorifero_anticamera_zigbee": {
        "name": "Calorifero Anticamera ZigBee",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "target_temp_step": 0.5,
          "preset_modes": [
            "none",
            "manual",
            "away",
            "auto"
          ],
          "current_temperature": 24.6,
          "temperature": 23.5,
          "preset_mode": "manual",
          "friendly_name": "Calorifero Anticamera ZigBee",
          "supported_features": 17
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "default",
          "protect_overheating": false,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": true,
          "homaticip": false
        },
        "bt_adapter": "mqtt",
        "bt_integration": "mqtt",
        "model": "SRTS-A01"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.temperatura_anticamera_zigbee_temperature",
      "state": "18.76",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Temperatura Anticamera ZigBee Temperature"
      },
      "last_changed": "2023-11-12T13:43:52.024405+00:00",
      "last_updated": "2023-11-12T13:43:52.024405+00:00",
      "context": {
        "id": "01HF1WCGERWE2AHH6T284QQ7N7",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }
}
@andreaconfa andreaconfa added the new bug incoming bug issue label Nov 12, 2023
@kirush0280
Copy link

Yes, and please add description of the item tolerance to the site https://better-thermostat.org/configuration
there is no item in the description, and no in the screenshot.

@meowmoo
Copy link

meowmoo commented Nov 26, 2023

I have the same issue

"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.11.3",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.11.6",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Berlin",
"os_name": "Linux",
"os_version": "6.1.59",
"supervisor": "2023.11.3",
"host_os": "Home Assistant OS 11.1",
"docker_version": "24.0.6",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"sleep_as_android": {
"version": "2.3.0",
"requirements": [
"pyhaversion"
]
},
"spotcast": {
"version": "v3.6.30",
"requirements": []
},
"hyperhdr": {
"version": "0.0.6",
"requirements": [
"hyperhdr-py==0.0.3"
]
},
"spook": {
"version": "1.3.2",
"requirements": []
},
"google_fit": {
"version": "v2.1.2",
"requirements": [
"oauth2client==4.1.3",
"google-api-python-client==2.82.0"
]
},
"hacs": {
"version": "1.33.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"home_connect_alt": {
"version": "1.0.0-b3",
"requirements": [
"home-connect-async==0.7.15"
]
},
"watchman": {
"version": "0.5.1",
"requirements": [
"prettytable==3.0.0"
]
},
"browser_mod": {
"version": "2.3.0",
"requirements": []
},
"versatile_thermostat": {
"version": "4.0.0",
"requirements": []
},
"govee": {
"version": "2023.11.1",
"requirements": [
"govee-api-laggat==0.2.2",
"dacite==1.8.0"
]
},
"better_thermostat": {
"version": "1.4.0",
"requirements": []
},
"meross_lan": {
"version": "4.4.0",
"requirements": []
},
"xiaomi_cloud_map_extractor": {
"version": "v2.2.0",
"requirements": [
"pillow",
"pybase64",
"python-miio",
"requests",
"pycryptodome"
]
},
"anniversaries": {
"version": "5.2.0",
"requirements": [
"python-dateutil>=2.8.1",
"integrationhelper>=0.2.2",
"voluptuous>=0.12.1"
]
},
"spook_inverse": {
"version": "1.3.2",
"requirements": []
}
},
"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.4.0",
"is_built_in": false
},
"data": {
"info": {
"name": "K\u00fcche BT",
"temperature_sensor": "sensor.kuche_govee_temperature",
"off_temperature": 0,
"outdoor_sensor": null,
"window_sensors": null,
"humidity_sensor": null,
"weather": null,
"window_off_delay": 0,
"model": "SEA801-Zigbee/SEA802-Zigbee",
"tolerance": 0.4,
"window_off_delay_after": 0
},
"thermostat": {
"climate.kuchen_thermostat": {
"name": "K\u00fcchen Thermostat ",
"state": "heat",
"attributes": {
"hvac_modes": [
"off",
"heat",
"auto"
],
"min_temp": 5.0,
"max_temp": 30.0,
"target_temp_step": 0.5,
"current_temperature": 23.1,
"temperature": 25.5,
"anti_scaling": "ON",
"away_mode": "OFF",
"battery_low": false,
"child_lock": "LOCK",
"current_heating_setpoint": 25.5,
"frost_detection": "ON",
"heating": null,
"last_seen": "2023-11-26T11:27:07+01:00",
"linkquality": 255,
"local_temperature": 23.1,
"local_temperature_calibration": 0,
"system_mode": "heat",
"window_detection": "ON",
"friendly_name": "K\u00fcchen Thermostat ",
"supported_features": 1
},
"bt_config": {
"calibration": "target_temp_based",
"calibration_mode": "heating_power_calibration",
"protect_overheating": false,
"no_off_system_mode": false,
"heat_auto_swapped": false,
"child_lock": false,
"homaticip": false
},
"bt_adapter": "mqtt",
"bt_integration": "mqtt",
"model": "SEA801-Zigbee/SEA802-Zigbee"
}
},
"external_temperature_sensor": {
"entity_id": "sensor.kuche_govee_temperature",
"state": "20.9",
"attributes": {
"state_class": "measurement",
"unit_of_measurement": "\u00b0C",
"device_class": "temperature",
"friendly_name": "K\u00fcche Govee Temperature"
},
"last_changed": "2023-11-26T10:26:58.274590+00:00",
"last_updated": "2023-11-26T10:26:58.274590+00:00",
"context": {
"id": "01HG5JP1K2MD1VH6Z5MZNP8APN",
"parent_id": null,
"user_id": null
}
},
"window_sensor": "-"
}
}

@folfy
Copy link

folfy commented Nov 28, 2023

Currently the "tolerance" seems to be only considered in:

  • fixed calibration, only target temp. based
  • "AI" calibration, offset and target temp. based
    But even then, the way this is implemented, this only increases the originally calculated setpoint/calibration by the tolerance values, if the calculated calibration is below 0, and if BT is not in heating mode (i.e. the target temperature is above the setpoint). Soooo, not rly clear about this tolerance, I mean essentially this is just a different kind of overheat protection like this rn. In my view it'd be best to discard the existing implementation, and implemented such feature properly from scratch, cause I no real usecase for it the way it is rn. I mean even if properly implenting it in the calibration now, the heating mode and everything in HA for BT would not correctly represent the thermostats state.

@wtom
Copy link
Collaborator

wtom commented Nov 28, 2023

It's not an overheat protection. It's working as a tolerance after heating, so when BT is in idle and the room cools down.

@folfy
Copy link

folfy commented Nov 29, 2023

Please correct me @wtom, but it's working when it's idle, i.e. when t_sense > t_setpoint, like the overheat protection, and it's adding an offset/"tolerance" to t_target/t_offset (depending on the mode/type of TRV), like the overheat protection, or not? Sooo, the only difference I see, is the tolerance being a fixed value, and only being applied if the calculated offset would be negative, while the overheat protection is a dynamic offset based on the temperature, which is always adding 10*(t_sense - t_setpoint).

@wtom
Copy link
Collaborator

wtom commented Nov 29, 2023

It's working on idle, yes. To have the tolerance when it's not heating.
Target = 20.0
Tolerance = 0.5
External Sensor = 20.0

Now the tolerance keeps the TRV and BT on idle until external sensor < target - tolerance.
https://github.com/KartoffelToby/better_thermostat/blob/master/custom_components/better_thermostat/events/trv.py#L248:L252
Here then starts the heating again, if external sensor is below target - tolerance

@folfy
Copy link

folfy commented Nov 29, 2023

Oh, so it is setting the mode to idle correctly. My fault, didn't rly check, because still, it's not applied in all calibration modes, plus there's thermostats that also would heat before the sensor drops to the setpoint temperature, i.e. I think the tolerance at least should always be applied in idle, like why not?

@andreaconfa, @meowmoo:
Can you post your target temperatures in addition, or maybe a screenshot of the graphs of the climate entity for BT and your TRV? Like would be good to see t_setpoint and t_sensor each for the TRV and better thermostat in parallel, to see what's going on.

@andreaconfa
Copy link
Author

Oh, so it is setting the mode to idle correctly. My fault, didn't rly check, because still, it's not applied in all calibration modes, plus there's thermostats that also would heat before the sensor drops to the setpoint temperature, i.e. I think the tolerance at least should always be applied in idle, like why not?

@andreaconfa, @meowmoo: Can you post your target temperatures in addition, or maybe a screenshot of the graphs of the climate entity for BT and your TRV? Like would be good to see t_setpoint and t_sensor each for the TRV and better thermostat in parallel, to see what's going on.

Hi.
In this discussion #1140 you can see the screenshot, explaining better my "issue"

@meowmoo
Copy link

meowmoo commented Dec 4, 2023

Oh, so it is setting the mode to idle correctly. My fault, didn't rly check, because still, it's not applied in all calibration modes, plus there's thermostats that also would heat before the sensor drops to the setpoint temperature, i.e. I think the tolerance at least should always be applied in idle, like why not?

@andreaconfa, @meowmoo: Can you post your target temperatures in addition, or maybe a screenshot of the graphs of the climate entity for BT and your TRV? Like would be good to see t_setpoint and t_sensor each for the TRV and better thermostat in parallel, to see what's going on.

Screenshot_2023-12-04-14-04-04-20_c3a231c25ed346e59462e84656a70e50
Screenshot_2023-12-04-14-03-26-29_c3a231c25ed346e59462e84656a70e50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new bug incoming bug issue
Projects
None yet
Development

No branches or pull requests

6 participants