KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
717 stars 124 forks source link

HVAC current action not changing from idle to heating. #1050

Open TSCM-Firestorm opened 10 months ago

TSCM-Firestorm commented 10 months ago

Hi there, I seem to be having an issue with BT in that it won't change the HVAC state from idle to heating when the temperature changes above/below the set temp. even when i change the temp to be over/under current.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.8.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "6.1.45",
    "supervisor": "2023.08.1",
    "host_os": "Home Assistant OS 10.5",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "tuya_v2": {
      "version": "1.5.0",
      "requirements": [
        "tuya-iot-py-sdk==0.4.1"
      ]
    },
    "govee": {
      "version": "0.2.2",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.6.0"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "better_thermostat": {
      "version": "1.2.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.2.2",
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "Dining Room Thermostat",
      "temperature_sensor": "sensor.dining_room_environment_sensor_temperature_2",
      "off_temperature": 20,
      "humidity_sensor": "sensor.dining_room_environment_sensor_humidity_2",
      "outdoor_sensor": "sensor.front_garden_environment_sensor_temperature_2",
      "weather": null,
      "window_sensors": "binary_sensor.dining_room_windows",
      "window_off_delay": 0,
      "model": "TS0601/TS0601"
    },
    "thermostat": {
      "climate.dining_room_radiator_valve_1_thermostat": {
        "name": "Dining Room Radiator Valve 1 Thermostat",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "preset_modes": [
            "none",
            "holiday",
            "Schedule",
            "frost protect"
          ],
          "current_temperature": 21.6,
          "temperature": 30.0,
          "hvac_action": "heating",
          "preset_mode": "none",
          "system_mode": "[4]/heat",
          "occupied_heating_setpoint": 3000,
          "unoccupied_heating_setpoint": 1700,
          "friendly_name": "Dining Room Radiator Valve 1 Thermostat",
          "supported_features": 17
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "heating_power_calibration",
          "protect_overheating": true,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "zha",
        "bt_integration": "zha",
        "model": "TS0601"
      },
      "climate.dining_room_radiator_valve_2_thermostat_2": {
        "name": "Dining Room Radiator Valve 2 Thermostat",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "preset_modes": [
            "none",
            "holiday",
            "Schedule",
            "frost protect"
          ],
          "current_temperature": 21.8,
          "temperature": 30.0,
          "hvac_action": "heating",
          "preset_mode": "none",
          "system_mode": "[4]/heat",
          "occupied_heating_setpoint": 3000,
          "unoccupied_heating_setpoint": 1700,
          "friendly_name": "Dining Room Radiator Valve 2 Thermostat",
          "supported_features": 17
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "heating_power_calibration",
          "protect_overheating": true,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "zha",
        "bt_integration": "zha",
        "model": "TS0601"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.dining_room_environment_sensor_temperature_2",
      "state": "23.1",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Dining Room Environment Sensor  Temperature"
      },
      "last_changed": "2023-09-03T13:29:51.985801+00:00",
      "last_updated": "2023-09-03T13:29:51.985801+00:00",
      "context": {
        "id": "01H9DKRJ3HV3YJZCVCBBCQAK6V",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": {
      "entity_id": "binary_sensor.dining_room_windows",
      "state": "off",
      "attributes": {
        "entity_id": [
          "binary_sensor.dining_room_window_1_sensor_opening",
          "binary_sensor.dining_room_window_2_sensor_opening_3"
        ],
        "device_class": "window",
        "friendly_name": "Dining Room Windows"
      },
      "last_changed": "2023-08-29T18:51:50.428284+00:00",
      "last_updated": "2023-08-29T18:51:50.428284+00:00",
      "context": {
        "id": "01H91A6GEVJ1XHDHY5TBWHDF3A",
        "parent_id": null,
        "user_id": null
      }
    }
  }
}

Description

HVAC current action doesn't change from idle to heating (or if it does it goes back to idle and never changes again).

Steps to Reproduce

  1. Set thermostat above current temperature

Expected behavior:

HVAC action to update

Actual behavior:

HVAC current action does not update

Versions

Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest Better Thermostat: 1.2.2

Additional Information

niemenjoki commented 10 months ago

I'm having the same exact issue. I can manually set the mode to heating but a few days later it's gone back to idle.

acid115 commented 10 months ago

I have the same issue too... Falled back to 1.21, but there is the same problem. The BT randomly switches off (hvac mode off) and does not switches on automatically (if temperature is set to a high value....). The log says sth. like: bt changed state to off because thermostat1 (The real trv) changed to heating??!! But the state of trv did not changed... So i have to set the hvac mode to heat to control temp again.

As a workaround for me, i have added this statement to climate.py at the functions: async def set_temp_temperature and async def async_set_temperature before the call self.async_write_ha_state():

self.bt_hvac_mode = HVACMode.HEAT

To switch to hvac mode heat, if an automation, script, ui element etc changes the temperature of the bt. This works for me and my configuration.

Someone has to find out, which version works and then compare the changes.

Mikescotland commented 10 months ago

I don't know if this project is still being developed. I tried to try it again after a year and while built in thermostat in HA works perfectly, BT doesn't. Yes, immediately after restart works, however any ingerention in anything (i.e. setting temperature setpoint) leaves the BT stuck forever on "Idle(Heat)"

TSCM-Firestorm commented 10 months ago

I have the same issue too... Falled back to 1.21, but there is the same problem. The BT randomly switches off (hvac mode off) and does not switches on automatically (if temperature is set to a high value....). The log says sth. like: bt changed state to off because thermostat1 (The real trv) changed to heating??!! But the state of trv did not changed... So i have to set the hvac mode to heat to control temp again.

As a workaround for me, i have added this statement to climate.py at the functions: async def set_temp_temperature and async def async_set_temperature before the call self.async_write_ha_state():

self.bt_hvac_mode = HVACMode.HEAT

To switch to hvac mode heat, if an automation, script, ui element etc changes the temperature of the bt. This works for me and my configuration.

Someone has to find out, which version works and then compare the changes.

hmm i might try that workaround. where can i find climate.py?

acid115 commented 10 months ago

Config-Folder > custom_components > better_thermostat

wtom commented 10 months ago

I've fixed this in my PR #896 In the current version it just works for homematic devices, i don't know who added that. I commented it out and reverted to a better logic. https://github.com/KartoffelToby/better_thermostat/pull/896/files#diff-4b2dd947f2c69f87a2af31502414ff28fc007362d296914781a564d17870eefeR205

Maybe there will be a new release soon.

TSCM-Firestorm commented 10 months ago

seems to be working again for me currently. will be keeping an eye on it though.

acid115 commented 10 months ago

Did you make the changes i suggested ?

wtom commented 10 months ago

New releases is out, where I fixed the problem. Could someone else confirm, that it's working again?

acid115 commented 10 months ago

I've fixed this in my PR #896 In the current version it just works for homematic devices, i don't know who added that. I commented it out and reverted to a better logic. https://github.com/KartoffelToby/better_thermostat/pull/896/files#diff-4b2dd947f2c69f87a2af31502414ff28fc007362d296914781a564d17870eefeR205

Maybe there will be a new release soon.

The same problem still exists for me in 1.3.0... Set the temp to 30 C, but the bt doesnt switch to heating...

Mikescotland commented 10 months ago

New releases is out, where I fixed the problem. Could someone else confirm, that it's working again?

Working, however summer mode is broken, stops working, sets itself to... 35 degrees when trying to "heat" with temperature outside higher than threshold value and then freezes and doesn't react.

wtom commented 10 months ago

You are talking about the mode not the action. Could you post a screenshot of the states in the developer tools?

acid115 commented 10 months ago

You are talking about the mode not the action. Could you post a screenshot of the states in the developer tools?

What exactly do you need?

fir3drag0n commented 10 months ago

Even tough I do have Homematic Evos, it seems to be still broken. I set the temperature to let say 30 degrees and BT jumps back to 5 degrees.

Soukyuu commented 9 months ago

New releases is out, where I fixed the problem. Could someone else confirm, that it's working again?

hvac_action attribute seems to be working fine now for my SEA801 thermostats, thanks!

cpktmpkt commented 9 months ago

I had the same problem with z-wave TRVs. Looks like tolerance 0 makes problems. changed all tolerances to 0.1 and BT changed all TRVs from off/idle to heating in required (target temperature higher the room temperature)

update: false alarm: changing the tolerances doesn't solve the problem.

hrosak88 commented 9 months ago

Hi! The same isue. I have BRT-100-TRV via zigbee2mqtt. The problem is, that after a few minutes set BT off mode. But when the temperature is lower than heating point, mode on BT remain all the time in off mode. Nothing happened, no heating. It is possible to fix it? thanks.

mkroeber commented 9 months ago

Hi! The same isue. I have BRT-100-TRV via zigbee2mqtt. The problem is, that after a few minutes set BT off mode. But when the temperature is lower than heating point, mode on BT remain all the time in off mode. Nothing happened, no heating. It is possible to fix it? thanks.

I basically have the same problem. At some Point the mode switches to off and stays off until i manually aktivate heating.

eivissacopter commented 8 months ago

Same issue here! I have setup seven Netatmo Thermostats in BetterThermostat. Every morning or when returning to the house there are always between one and three Thermostats that switch to the correct return/morning/comfort temperature, but the heating command is not send/active, so the rooms stay cold. Some days it works on others it doesn't.

Soukyuu commented 8 months ago

@eivissacopter: your issue seems a bit different from this one, see #935 for a workaround