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
797 stars 124 forks source link

Support for external temperature sensor for Aqara E1 Thermostat #1082

Open phuhl opened 1 year ago

phuhl commented 1 year ago

Hi, thanks for the great integration!

What is the feature?

Currently the Aqara E1 can only be controlled in "Target Temperature Based" mode. I am not sure if the E1 supports offset mode (as I am not entirely sure, how it is implemented) but it does support an external temperature sensor.

It would be great if the E1 could be used in offset mode or something like it, using the external sensor :)

Description

This doucmentation shows that the sensor enum can be set to external. This post seems to show how the temperature would be published to the device.

chris400 commented 1 year ago

Just came here for the very same reason :)

The model number is Xiaomi SRTS-A01 (I haven't found anything containing the last string in this repo, so I am posting it here for reference)

tobimai commented 1 year ago

Seems to be possible in general according to that issue: https://github.com/Koenkk/zigbee2mqtt/discussions/14291

swoopdk commented 1 year ago

Perhaps i'm consued but why use offset mode if you're using an external sensor? Or did i misread you.

I have the same thermostat and using some aquare sensors to get the room temperature as the thermostat is absolutly not a good place to measure as it's quite hot compared when heating. So i would see the option of offset using the thermostat itself but when using an external sensor it doesn't make sense to me.

chris400 commented 1 year ago

@swoopdk the FAQ explains it pretty well: https://better-thermostat.org//qanda/modes

swoopdk commented 1 year ago

@swoopdk the FAQ explains it pretty well: https://better-thermostat.org//qanda/modes

You're correct - i should ahve looked there before :) I have just gotten used to current setup and i must admit it would be nice to have the TRV show the actual room temp instead of it's personal setting as it ranges quite alot from 5 degrees to much higher to maintain my preset of 20 through external sensor :)

zzois commented 1 year ago

I too would be happy to have this feature supported via nice GUI such as BT... 😃

koseduhemak commented 11 months ago

would be also interested. At the moment I use target calibration and configure external temperatures via nodered automatically in the TRVs.

alexanderek commented 11 months ago

+1 offset mode

tr4nt0r commented 8 months ago

Seems it will finally be possible in ZHA to set the temperature from an external sensor. I already downloaded the quirk to my custom quirks folder and it works perfectly. See here: https://github.com/zigpy/zha-device-handlers/pull/2802 Not merged yet, but i think it will be in the next release.

Currently i have set the Zigbee cluster sensor manually to external in the TRV and I'm updating the Zigbee Cluster _sensortemp with an automation but it would be really nice if BT supported this TRV

This is my automation, triggered by a temperature change of the external temperature sensor:

service: zha.set_zigbee_cluster_attribute
data:
  cluster_type: in
  ieee: xxxxxxxxxx
  endpoint_id: 1
  cluster_id: 64704
  attribute: 5010
  value: "{{ (float(trigger.to_state.state) * 100)|int }}"
Patrick-DE commented 8 months ago

I do get Error: Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state' when using zhaquirks.xiaomi.aqara.weather.Weather2 as external sensor.. You got any clue why? My YAML looks like this

alias: Set temp
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.temp_kitchen
condition: []
action:
  - service: zha.set_zigbee_cluster_attribute
    data:
      cluster_type: in
      ieee: xx:xx:xx:xx:xx:xx:xx:xx
      endpoint_id: 1
      cluster_id: 64704
      attribute: 5010
      value: "{{ (float(trigger.to_state.state) * 100)|int }}"
mode: single

Update: I think I fixed it by using states('<entity_id>')

tr4nt0r commented 8 months ago

trigger.to_state.state becomes available when it is triggered by a temp change, but accessing the entity directly is also fine. By the way, if it wasn't clear, the ieee is the address of the thermostat, not the sensor. You write the temperature from the external sensor into the thermostat. And don't forget to set the thermostat to external sensor like i did ^^