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

Target temperature changing at random #1387

Open
2 tasks
kbunto opened this issue Sep 9, 2024 · 10 comments
Open
2 tasks

Target temperature changing at random #1387

kbunto opened this issue Sep 9, 2024 · 10 comments
Assignees
Labels
help wanted Extra attention is needed under investigation If its not clear whats the problem wait for feedback

Comments

@kbunto
Copy link

kbunto commented Sep 9, 2024

Disclaimer:
My first bug report, will updated with other information if I missed the mark here.
May also be resolved if anyone know where I can find the trigger for target temperature changes in BT.

Prerequisites

  • Aqara SRTS-A01

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

hvac_modes: heat, off
min_temp: 5
max_temp: 30
target_temp_step: 0.5
preset_modes: none
current_temperature: 26.3
temperature: 25
hvac_action: idle
preset_mode: none
window_open: false
call_for_heat: true
last_change: 2024-09-09T08:27:01.815908
saved_temperature: null
humidity: 53
main_mode: off
tolerance: 0
heating_power: 0.0115
errors: []
batteries: {"sensor.bathroom_air_temperature": {"battery": "77", "battery_id": "sensor.bathroom_air_battery"}, "sensor.bathroom_air_humidity": {"battery": "77", "battery_id": "sensor.bathroom_air_battery"}, "climate.bathroom_floor": {"battery": "31", "battery_id": "sensor.bathroom_floor_battery"}}
friendly_name: Bathroom_floor_virtual
supported_features: 401

  • Output from Home Assistant Device Diagnostic from BT
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.9.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Oslo",
    "os_name": "Linux",
    "os_version": "6.6.46-haos",
    "supervisor": "2024.08.0",
    "host_os": "Home Assistant OS 13.1",
    "docker_version": "26.1.4",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "better_thermostat": {
      "documentation": "https://github.com/KartoffelToby/better_thermostat",
      "version": "1.6.0",
      "requirements": []
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "nordpool": {
      "documentation": "https://github.com/custom-components/nordpool/",
      "version": "0.0.14",
      "requirements": [
        "nordpool>=0.2",
        "backoff"
      ]
    },
    "home_connect_alt": {
      "documentation": "https://github.com/ekutner/home-connect-hass",
      "version": "1.1.7",
      "requirements": [
        "home-connect-async==0.8.0"
      ]
    }
  },
  "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.6.0",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.0001070479629561305
    },
    "636449213170863fc7f034ab12afd6fe": {
      "wait_import_platforms": -1.7203250619932078,
      "config_entry_setup": 1.863598430994898
    },
    "c619aad3aa64d82a61e7679af01d5717": {
      "wait_import_platforms": -1.8634021090110764,
      "config_entry_setup": 1.871203135990072
    }
  },
  "data": {
    "info": {
      "name": "Bathroom_floor_virtual",
      "temperature_sensor": "sensor.bathroom_air_temperature",
      "tolerance": 0.0,
      "target_temp_step": 0.0,
      "humidity_sensor": "sensor.bathroom_air_humidity",
      "weather": "weather.forecast_home_2",
      "off_temperature": 25,
      "window_sensors": null,
      "outdoor_sensor": null,
      "cooler": null,
      "window_off_delay": 0,
      "window_off_delay_after": 0,
      "model": "SRTS-A01"
    },
    "thermostat": {
      "climate.bathroom_floor": {
        "name": "Bathroom_floor",
        "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": 30.4,
          "temperature": 29.5,
          "preset_mode": "manual",
          "friendly_name": "Bathroom_floor",
          "supported_features": 401
        },
        "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": "SRTS-A01"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.bathroom_air_temperature",
      "state": "26.3",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Bathroom_air Temperature"
      },
      "last_changed": "2024-09-09T11:14:50.238617+00:00",
      "last_reported": "2024-09-09T11:14:50.238617+00:00",
      "last_updated": "2024-09-09T11:14:50.238617+00:00",
      "context": {
        "id": "01J7B7WP7YQPQZ3NSK0VFNR0KA",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }
}

Description

Target temperature changing to 30 deg. C at seemingly random times. Strangely it only happens for one of two SRTS-A01 in my better thermostat setup.

Steps to Reproduce

Unknown, happens rarely and I have not found a pattern.

Expected behavior:

Target temperature to stay where it should.

Actual behavior:

Target temperature changes at seemingly random times to 30 deg. C.

Versions

BT: 1.6.0
HA: 2024.9.1

Additional Information

@kbunto kbunto added the new bug incoming bug issue label Sep 9, 2024
@maglat
Copy link

maglat commented Sep 17, 2024

Same hardware (Aqara SRTS-A01) + same HA version + same issue. Target temperature is set to 22C. Value randomly change to 5C, to 27C. Heating mod change from heating to off randomly.

@kbunto
Copy link
Author

kbunto commented Sep 17, 2024

Same hardware (Aqara SRTS-A01) + same HA version + same issue. Target temperature is set to 22C. Value randomly change to 5C, to 27C. Heating mod change from heating to off randomly.

+5 seems logical, my setpoint is 25 and temperature was changed to 30.

@wtom
Copy link
Collaborator

wtom commented Sep 18, 2024

Activate child lock on the BT settings should fix it.

@maglat
Copy link

maglat commented Sep 18, 2024

Activate child lock on the BT settings should fix it.

looks like this fixed it for me. what about the temperature sensor setting. keep internal or set to external. I set to external so when internal, the thermostat do not reduce heating on a wrong room temperature. I am aware that the external only is meant for the aqara native integration and setting to external inside home assistant wont receive any temperature data. what i disabled as well is the window detection which is handled by better thermostat as well.

@kbunto
Copy link
Author

kbunto commented Sep 19, 2024

Activate child lock on the BT settings should fix it.

looks like this fixed it for me. what about the temperature sensor setting. keep internal or set to external. I set to external so when internal, the thermostat do not reduce heating on a wrong room temperature. I am aware that the external only is meant for the aqara native integration and setting to external inside home assistant wont receive any temperature data. what i disabled as well is the window detection which is handled by better thermostat as well.

Regarding setting temperature sensor to external and thus preventing HA/BT to recieve the temperature reading from the thermostat. How then does the thermostat active? Does not BT achieve this by manipulating the setpoint in reference to the reported temperature from the actuator?

Im interested in a definite answer for this as my actuator is mounted in a technical closet where the temperature sometimes is above 30 degree - exceeding the maximum setpoint of the actuator and thus preventing it from turning on the heating.

--- EDIT --- LIKELY SOLUTION ---

Realized after typing out my question that I can achieve what I want by setting the temperature sensor in Z2M to external and using the slider to set the temperature to a static 20 degrees.

@tco99ttocs
Copy link

tco99ttocs commented Sep 30, 2024

got similar problem with version 1.6 and 1.4, but with avm 301 and external tuya sensors. It randomly switches the target temperature. But there is a fix temperature, where he is goining back, its the target temp which is set from AVM in the 301.
The workaround with enabeling the child lock in BT didn't work

@KartoffelToby
Copy link
Owner

BT will change the Target temp based on the Sensor and TRV data, this is how it works ;) but sometime devices make false true events, so the childlock "hack" work, but the childlock shoud be enabled on the org. device. if someone can provide better logs i can figure out whats wrong.

@KartoffelToby KartoffelToby added help wanted Extra attention is needed under investigation If its not clear whats the problem wait for feedback and removed new bug incoming bug issue labels Nov 3, 2024
@antstorm
Copy link

antstorm commented Nov 5, 2024

I'm also experiencing this issue. My setup is a bit more complex with the scheduler-component used to drive the target temperatures, however it feels like scheduler is not the one causing this.

Here's the schedule with 4 expected trigger events throughout the day:
Screenshot 2024-11-05 at 12 34 10

Here's what the actual target temperature looks like with 4 unexpected changes:
Screenshot 2024-11-05 at 12 32 57

Please let me know if there's any logs that I can try to dig out. From what I saw — only a few changes appear in the logbook, but have zero context associated (what and why caused the change).

P.S. Thanks a lot for building and maintaining this addon, extremely useful for UFH and TRVs.

@antstorm
Copy link

antstorm commented Nov 5, 2024

Ok, I've enabled debug logging and managed to get the logs for a random temperature change. Based on the scheduler my target temperature changed from 19C to 17C at 16:00, but then a minute later went up to 17.5C for no apparent reason:

Screenshot 2024-11-05 at 16 42 19

And here are the relevant log entries:

2024-11-05 16:00:00.001 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Downstairs Study Thermostat: HA set target temperature to 17.0 & None
2024-11-05 16:00:00.002 DEBUG (MainThread) [custom_components.better_thermostat.calibration] better_thermostat None: climate.downstairs_study_trv - new setpoint calibration: 17.5 | external_temp: 20.3, target_temp: 17.0, trv_temp: 20.4
2024-11-05 16:00:00.002 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: TO TRV set_temperature: climate.downstairs_study_trv from: 19.5 to: 17.5
2024-11-05 16:00:00.018 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: climate.downstairs_study_trv / check_target_temp / _last: 17.5 - _current: 17.5
2024-11-05 16:01:15.324 DEBUG (MainThread) [custom_components.better_thermostat.events.temperature] better_thermostat None: external_temperature changed from 20.3 to 20.2
2024-11-05 16:01:15.325 DEBUG (MainThread) [custom_components.better_thermostat.calibration] better_thermostat None: climate.downstairs_study_trv - new setpoint calibration: 17.0 | external_temp: 20.2, target_temp: 17.0, trv_temp: 20.4
2024-11-05 16:01:15.325 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: TO TRV set_temperature: climate.downstairs_study_trv from: 17.5 to: 17.0
2024-11-05 16:01:15.339 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: climate.downstairs_study_trv / check_target_temp / _last: 17.0 - _current: 17.0
2024-11-05 16:01:31.902 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat None: trigger_trv_change test / _old_heating_setpoint: 17.0 - _new_heating_setpoint: 17.5 - _last_temperature: 17.0
2024-11-05 16:01:31.902 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat None: TRV climate.downstairs_study_trv decoded TRV target temp changed from 17.0 to 17.5
2024-11-05 16:01:31.903 DEBUG (MainThread) [custom_components.better_thermostat.calibration] better_thermostat None: climate.downstairs_study_trv - new setpoint calibration: 17.5 | external_temp: 20.2, target_temp: 17.5, trv_temp: 20.4
2024-11-05 16:02:45.325 DEBUG (MainThread) [custom_components.better_thermostat.events.temperature] better_thermostat None: external_temperature changed from 20.2 to 20.3
2024-11-05 16:02:45.325 DEBUG (MainThread) [custom_components.better_thermostat.calibration] better_thermostat None: climate.downstairs_study_trv - new setpoint calibration: 17.5 | external_temp: 20.3, target_temp: 17.5, trv_temp: 20.4

The question is — what does decoded TRV target temp changed from 17.0 to 17.5 mean and why did it happen? From the looks of the log message it's related to the TRV, but at the same exact timestamp (down to second) the target temperature of the BT got updated.

@Asakash
Copy link

Asakash commented Nov 25, 2024

Just wanted to share, that setting the child lock in the BT Integration fixed my Issue that I mentioned in #1441.
The problem seems to be that one of my TRVs randomly changes its set temperatur (god knows why) and BT interprets it as a manual change on the TRV and changes the target temperatur of BT. So I guess BT reacted as intended and the problem originates from the TRV.
The problem I have with this issue is, that I did not know that Better Thermostat handles changes on the real TRV as new input. I also could not find anything about this in the documentation. If I had known, that would have been my first guess for the problem source. So maybe make this a little bit clearer in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed under investigation If its not clear whats the problem wait for feedback
Projects
None yet
Development

No branches or pull requests

7 participants