Skip to content

Add diagnostic logging for temperature setpoint with no_off_system_mode TRVs#1781

Draft
Copilot wants to merge 7 commits intomasterfrom
copilot/fix-heating-control-issue
Draft

Add diagnostic logging for temperature setpoint with no_off_system_mode TRVs#1781
Copilot wants to merge 7 commits intomasterfrom
copilot/fix-heating-control-issue

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

Motivation:

TRVs without OFF mode support (e.g., Shelly BLU TRV) with no_off_system_mode enabled may not be setting temperature to min_temp when windows open. The existing logic should handle this, but diagnostic logging is needed to verify the setpoint is being correctly applied.

Changes:

  • Added INFO-level diagnostic logging to track when no_off_system_mode logic triggers and sets temperature to min_temp
  • Added detailed logging when temperature commands are sent to TRVs, including current state: window_open, hvac_mode, and no_off_system_mode flag
  • Logging will help identify if temperature setpoint logic is executing correctly when windows open

Modified custom_components/better_thermostat/utils/controlling.py:

  • Changed log level from DEBUG to INFO for no_off_system_mode temperature override
  • Added state tracking variables to temperature set command logs

Note: Diagnostic data shows binary_sensor.windows_in_bedroom listed as "missing_entity" in issues section, which may indicate the window sensor is unavailable at times and could prevent Better Thermostat from detecting window opens.

Related issue (check one):

  • There is no related issue ticket

Checklist (check one):

  • The code change is tested and works locally.

Test-Hardware list (for code changes)

User testing required to capture logs when window opens.

Steps to test:

  1. Enable INFO-level logging for Better Thermostat
  2. Open configured window
  3. Check logs for temperature setpoint commands and state information
  4. Verify temperature is set to min_temp (typically 4-5°C)

HA Version: 2025.12.3+
TRV Hardware: Shelly BLU TRV or similar no-OFF-mode devices

New device mappings

N/A - no device mappings changed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Opening the window and turning off the heating doesn't quite work.</issue_title>
<issue_description>

Description

I'm having trouble turning off the radiators when a window is opened. My configuration is set to 3 minutes after window opening. The auxiliary sensor for several windows is set correctly and visible in the configuration. However, BetterT shows a window icon (which I assume detects the window opening), sets the radiator to off, but the valve is still open. I don't know if this is related to the valve itself or the BT. What I found interesting is that in the diagnostic data at the very bottom, under "issues," there's information about missing entities.

Steps to Reproduce

Expected behavior:

Until the window closing time has elapsed, the valves should remain closed.

Actual behavior:

The valves are still open and heat unnecessarily.

Versions and HW

Home Assistant: 2025.12.3
Better Thermostat: 1.7.0

TRV(s): Shelly BLU TRV

Debug data

diagnostic data

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2025.12.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.13.9",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Warsaw",
    "os_name": "Linux",
    "os_version": "6.12.25-haos-raspi",
    "container_arch": "aarch64",
    "supervisor": "2025.12.3",
    "host_os": "Home Assistant OS 16.0",
    "docker_version": "28.3.0",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "rpi_gpio": {
      "documentation": "https://github.com/thecode/ha-rpi_gpio",
      "version": "2025.2.1",
      "requirements": [
        "gpiod>=2.2.1"
      ]
    },
    "better_thermostat": {
      "documentation": "https://github.com/KartoffelToby/better_thermostat",
      "version": "1.7.0",
      "requirements": []
    },
    "spotcast": {
      "documentation": "https://github.com/fondberg/spotcast",
      "version": "v4.0.1",
      "requirements": [
        "spotipy==2.23.0"
      ]
    },
    "adaptive_lighting": {
      "documentation": "https://github.com/basnijholt/adaptive-lighting#readme",
      "version": "1.28.0",
      "requirements": [
        "ulid-transform"
      ]
    },
    "nodered": {
      "documentation": "https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/custom_integration/",
      "version": "4.1.5",
      "requirements": []
    },
    "spook": {
      "documentation": "https://spook.boo",
      "version": "4.0.1",
      "requirements": []
    },
    "google_home": {
      "documentation": "https://github.com/leikoilja/ha-google-home",
      "version": "1.13.1",
      "requirements": [
        "glocaltokens==0.7.6"
      ]
    },
    "powercalc": {
      "documentation": "https://docs.powercalc.nl",
      "version": "v1.19.4",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "switch_manager": {
      "documentation": "https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager",
      "version": "2.0.5",
      "requirements": []
    },
    "presence_simulation": {
      "documentation": "https://github.com/slashback100/presence_simulation",
      "version": "5.1",
      "requirements": []
    },
    "fordpass": {
      "documentation": "https://github.com/itchannel/fordpass-ha",
      "version": "0.1.68",
      "requirements": []
    },
    "auto_backup": {
      "documentation": "https://github.com/jcwillox/hass-auto-backup",
      "version": "1.8.1",
      "requirements": []
    },
    "battery_notes": {
      "documentation": "https://andrew-codechimp.github.io/HA-Battery-Notes/",
      "version": "3.1.0",
      "requirements": []
    },
    "zha_toolkit": {
      "documentation": "https://github.com/mdeweerd/zha-toolkit",
      "version": "v1.1.33",
      "requirements": [
        "aiofiles>=0.4.0",
        "pytz>=2016.10"
      ]
    },
    "multizone_controller": {
      "documentation": "https://github.com/Petro31/ha-integration-multizone-controller",
      "version": "1.2",
      "requirements": []
    },
    "energy_meter": {
      "documentation": "https://github.com/zeronounours/HA-custom-component-energy-meter",
      "version": "1.1.0",
      "requirements": []
    },
    "snowtire": {
      "documentation": "https://github.com/Limych/ha-snowtire",
      "version": "1.6.0",
      "requirements": [
        "pip>=21.3.1"
      ]
    },
    "samsungtv_tizen": {
      "documentation": "https://github.com/jaruba/ha-samsungtv-tizen",
      "vers...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes KartoffelToby/better_thermostat#1760

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/KartoffelToby/better_thermostat/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
Copilot AI and others added 3 commits January 2, 2026 12:08
Co-authored-by: wtom <1482002+wtom@users.noreply.github.com>
Co-authored-by: wtom <1482002+wtom@users.noreply.github.com>
Co-authored-by: wtom <1482002+wtom@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix window opening not turning off heating Jan 2, 2026
Copilot AI requested a review from wtom January 2, 2026 12:14
@wtom
Copy link
Collaborator

wtom commented Jan 2, 2026

@copilot has nothing todo with the valve position. please revert everything you did and check if the setpoint is set to 5°C if the trv has no off mode.

Per maintainer feedback, reverted all valve position control logic.
Added INFO-level logging to diagnose temperature setpoint issues for TRVs with no OFF mode.

Co-authored-by: wtom <1482002+wtom@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 2, 2026

@copilot has nothing todo with the valve position. please revert everything you did and check if the setpoint is set to 5°C if the trv has no off mode.

Reverted all valve position logic in commit 8166ce0.

Added INFO-level diagnostic logging to track when temperature is set to min_temp for no_off_system_mode TRVs. The existing logic should already set temperature to min_temp when window opens, but I notice the diagnostic data shows binary_sensor.windows_in_bedroom listed as a missing entity, which could prevent window detection from working.

The logs will now show:

  • When no_off_system_mode triggers (with min_temp value)
  • When temperature commands are sent (with window_open and hvac_mode state)

This should help identify if the setpoint logic is executing correctly when windows open.

Copilot AI changed the title Fix valve not closing when window opens for TRVs with no OFF mode Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants