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

TRV stays forever at 5°C after window closed (with no_off_system_mode) #1195

Open
1 task
Malachi801 opened this issue Dec 10, 2023 · 8 comments · May be fixed by #1393
Open
1 task

TRV stays forever at 5°C after window closed (with no_off_system_mode) #1195

Malachi801 opened this issue Dec 10, 2023 · 8 comments · May be fixed by #1393
Assignees
Labels
bug Something isn't working

Comments

@Malachi801
Copy link

Prerequisites

  • Model name of your Devices: eTRV0100, eTRV0103, TS0601. Information below is provided from eTRV0100 (=Danfoss Ally). All other thermostats show the same issue.

  • Output from Home Assistant Developer Tools state e.g.:

State:
heat

Attributes:
hvac_modes: heat, off
min_temp: 7
max_temp: 35
target_temp_step: 0.1
current_temperature: 17.7
temperature: 26
hvac_action: heating
window_open: false
call_for_heat: true
last_change: 2023-12-10T11:10:20.725744
saved_temperature: null
humidity: 72
main_mode: heat
tolerance: 0.3
heating_power: 0.01
errors: []
batteries: {"sensor.indoor_temperature_froggit": {"battery": "off", "battery_id": "binary_sensor.wh65_battery"}, "sensor.indoor_humidity_froggit": {"battery": "off", "battery_id": "binary_sensor.wh65_battery"}, "binary_sensor.sensor_terassentur": {"battery": "100", "battery_id": "sensor.sensor_terassentur_battery_level"}, "climate.thermostat_wohnzimmer": {"battery": "36", "battery_id": "sensor.thermostat_89_battery"}}
friendly_name: Wohnzimmer
supported_features: 1

  • Output from Home Assistant Device Diagnostic from BT
{
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.12.1",
    "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.63-haos",
    "supervisor": "2023.11.6",
    "host_os": "Home Assistant OS 11.2",
    "docker_version": "24.0.7",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "auto_backup": {
      "version": "1.4.1",
      "requirements": []
    },
    "thermal_comfort": {
      "version": "2.2.0",
      "requirements": []
    },
    "plant": {
      "version": "2023.11.0",
      "requirements": [
        "async-timeout>=4.0.2"
      ]
    },
    "overwolfstatus": {
      "version": "1.0.1",
      "requirements": []
    },
    "ics": {
      "version": "20211212.01",
      "requirements": [
        "recurring-ical-events",
        "icalendar>=4.0.4",
        "tzlocal",
        "integrationhelper",
        "voluptuous",
        "python-dateutil>2.7.3"
      ]
    },
    "openplantbook": {
      "version": "1.2.0",
      "requirements": [
        "pyopenplantbook==0.0.4"
      ]
    },
    "powercalc": {
      "version": "v1.9.9",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "hochwasserportal": {
      "version": "0.0.20",
      "requirements": [
        "lxml>=4.6.2,<5",
        "beautifulsoup4>=4.9.3,<5"
      ]
    },
    "irrigation_unlimited": {
      "version": "2023.11.0",
      "requirements": [
        "crontab"
      ]
    },
    "mold_risk_index": {
      "version": "1.1.0",
      "requirements": []
    },
    "alexa_media": {
      "version": "4.8.0",
      "requirements": [
        "alexapy==1.27.10",
        "packaging>=20.3",
        "wrapt>=1.14.0"
      ]
    },
    "solar_optimizer": {
      "version": "3.0.0",
      "requirements": []
    },
    "xiaomi_miio_fan": {
      "version": "2023.7.0.0",
      "requirements": [
        "construct==2.10.56",
        "python-miio>=0.5.12"
      ]
    },
    "scene_presets": {
      "version": "0.1.0",
      "requirements": []
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "alarmo": {
      "version": "v1.9.13",
      "requirements": []
    },
    "better_thermostat": {
      "version": "1.4.0",
      "requirements": []
    },
    "adaptive_lighting": {
      "version": "1.20.0",
      "requirements": [
        "ulid-transform"
      ]
    },
    "hacs": {
      "version": "1.33.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "presence_simulation": {
      "version": "3.2",
      "requirements": []
    },
    "dwd": {
      "version": "2023.10.0",
      "requirements": []
    },
    "frigate": {
      "version": "4.0.0",
      "requirements": [
        "pytz==2022.7"
      ]
    }
  },
  "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": "Wohnzimmer",
      "temperature_sensor": "sensor.indoor_temperature_froggit",
      "off_temperature": 16,
      "humidity_sensor": "sensor.indoor_humidity_froggit",
      "outdoor_sensor": null,
      "window_sensors": "binary_sensor.sensor_terassentur",
      "window_off_delay": 45,
      "weather": "weather.openweathermap",
      "model": "eTRV0100",
      "tolerance": 0.3,
      "window_off_delay_after": 0
    },
    "thermostat": {
      "climate.thermostat_wohnzimmer": {
        "name": "Thermostat Wohnzimmer",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "heat",
            "off"
          ],
          "min_temp": 7,
          "max_temp": 35,
          "current_temperature": 22.1,
          "temperature": 26.0,
          "hvac_action": "heating",
          "offset": 0,
          "valve": 92,
          "locked": false,
          "friendly_name": "Thermostat Wohnzimmer",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "local_calibration_based",
          "calibration_mode": "heating_power_calibration",
          "protect_overheating": false,
          "no_off_system_mode": true,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "deconz",
        "bt_integration": "deconz",
        "model": "eTRV0100"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.indoor_temperature_froggit",
      "state": "17.8",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Temperatur - innen"
      },
      "last_changed": "2023-12-10T15:44:54.545872+00:00",
      "last_updated": "2023-12-10T15:44:54.545872+00:00",
      "context": {
        "id": "01HHA6E8RH0DCVMGXTAW0K9KHD",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": {
      "entity_id": "binary_sensor.sensor_terassentur",
      "state": "off",
      "attributes": {
        "on": true,
        "temperature": 18.0,
        "device_class": "door",
        "icon": "mdi:door",
        "friendly_name": "T\u00fcrsensor Wohnzimmer"
      },
      "last_changed": "2023-12-10T15:17:14.472140+00:00",
      "last_updated": "2023-12-10T15:17:14.472140+00:00",
      "context": {
        "id": "01HHA4VKK833F4AEPZJ2SEG08G",
        "parent_id": null,
        "user_id": null
      }
    }
  }
}
}

Description

Thermostats to not re-enable after windows/doors are closed any stay switched off for all time. Re-enabling into heating mode has to be done by hand.

Steps to Reproduce

  1. Open window
  2. Thermostats are switched off after time as defined (correct behavior)
  3. Close window

Expected behavior:

Thermostats are switched on again after window is closed

Actual behavior:

Thermostats are NOT switched on again after window is closed. Manually switching on again into heating mode works.

Versions

  • Home Assistant 2023.12.1 (problem also occured with 2023.11.x)
  • BT 1.4.0 (also tested with 1.3.0 with same problems)
  • Deconz (Conbee II, Gateway Version: 2.24.2, Firmware 26720700)

Additional Information

Screenshots from setup:

Setup1

Setup2

Please feel free to request further information. I really love this project and hope my problem can be fixed.

@Malachi801 Malachi801 added the new bug incoming bug issue label Dec 10, 2023
@FilipCZE
Copy link

I have the same problem… Is there any solution yet? Thanks!

@Splintix98
Copy link

Same problem here with Moes BRT-100-TRV.
When they are configured to be set to 5°C instead of Off, they stay at 5°C after the window is closed and when they are configured to be turned off, they simply stay off.

@maparth
Copy link

maparth commented Jan 31, 2024

Hello,

I'd like to report that I am experiencing a similar issue as mentioned in this thread. The problem occurs with the TRVs not automatically turning on after closing the corresponding windows. Currently, they automatically and correctly turn off after opening the window, but upon closing the window, I have to manually turn them on again.

TRV Model: GS361A-H04
Integration: Zigbee2Mqtt
Better Thermostat version: 1.4.0
Tested with Home Assistant version: 2023.10.5 and 2024.1.0

@wtom
Copy link
Collaborator

wtom commented Feb 1, 2024

All of you are having the problem with it and the option "TRV has no off mode" enabled? Because that could be the issue.

https://github.com/KartoffelToby/better_thermostat/blob/master/custom_components%2Fbetter_thermostat%2Futils%2Fcontrolling.py#L196-L201

Here is the part for opening the window. But the closing window part is missing to reset the temperature to what it was before.

@maparth
Copy link

maparth commented Feb 1, 2024

I do have the option "TRV has no off mode" enabled.

@Oli-BY
Copy link

Oli-BY commented Oct 31, 2024

the same problem here. After closing the door heating dont switch on again.

@folfy
Copy link
Collaborator

folfy commented Jan 9, 2025

From #1442 log:

2024-11-04 09:32:57.888 DEBUG (MainThread) [custom_components.better_thermostat.calibration] better_thermostat None: climate.0x3410f4fffe2073a7 - new setpoint calibration: 22.5 | external_temp: 19.8, target_temp: 20.5, trv_temp: 21.9
2024-11-04 09:32:57.888 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat None: sending 5°C to the TRV because this device has no system mode off and heater should be off
2024-11-04 09:32:57.889 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: control_trv: window is closed, setting window closed restoring mode: heat

Nothing ever happens after, as @wtom probably a bug in connectino with "5°C instead of off" mode.

OP:
"no_off_system_mode": true,

@folfy folfy changed the title BT: Integration does not re-enable thermostat after opened window is closed again TRV stays forever at 5°C after window closed (with no_off_system_mode) Jan 9, 2025
@folfy
Copy link
Collaborator

folfy commented Jan 9, 2025

So the actual issue/problem seems to root in controlling.py.

Here the desired state is generated, incl. the desired temperature, which is 5°C. Based on self.bt_hvac_mode here we're still in "pseudo-off" mode (off in no_off_system_mode scenario) - This is apparent from the events.trv log message "sending 5°C(...)"

_remapped_states = convert_outbound_states(
self, heater_entity_id, self.bt_hvac_mode
)

_temperature = _remapped_states.get("temperature", None)

Here we get the new desired BT heating state - should be heating again, window closed:

_new_hvac_mode = handle_window_open(self, _remapped_states)

Here we manage overriding the outdated target temp down to 5°C, if we wanna turn off, but not the other way around:

if _no_off_system_mode is True and _new_hvac_mode == HVACMode.OFF:
_min_temp = self.real_trvs[heater_entity_id]["min_temp"]
_LOGGER.debug(
f"better_thermostat {self.device_name}: sending {_min_temp}°C to the TRV because this device has no system mode off and heater should be off"
)
_temperature = _min_temp

The only thing I'm not sure is where here in-between bt_hvac_mode is set back (and forth, in case no_off_system_mode is false).

And here we would set the new temperature (which is still 5°C, from when it was generated)

# set new target temperature
if _temperature is not None and (
_new_hvac_mode != HVACMode.OFF or _no_off_system_mode
):
if _temperature != _current_set_temperature:

Update:
So based on the comment in #1393 I guess the bt_hvac_mode state is changed here? But like only in no_off_system_mode?

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

Reproduction

This issue only occures, if trigger_trv_change is called in the meantime, which isn't always the casse. So the whole "change mode to off" thing isn't even working reliably, and that's why only some users sometimes have issues with this.

@KartoffelToby I don't get the whole point of enforcing the BT mode to be off here, like without _no_off_system_mode we also just switch into idle, so why not here too? And if, it would have to be done properly. So I'd stand behind the original proposal of #1393, to just remove the whole "turn BT off / on" here.

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
8 participants