Aqara TRV external temp via zigbee

See the device page on Z2M: Xiaomi SRTS-A01 control via MQTT | Zigbee2MQTT, the “sensor” section. You can do it with the native HA automations, using the “mqtt.publish” service or via Node-Red. Make sure that you first set the sensor to “external”. This can be done manually in Z2M. I have noticed that sometimes it changes back to “internal” with no apparent reason, therefore I also have an automation that changes it back to “external” whenever this happens.

1 Like

Can you share a bit more about this?
I’m reading the page you linked but cannot find anything about how to actually link the external sensor once the “sensor” value is set to “external”. Which message to you publish where?

I recently bought the Aqara TRV and i also have Aqara window and temperature sensors. But everything is connected directly via Zigbee2Mqtt, no Aqara Hub.
I’d like to make use of the window sensor and external temperature sensor features but not finding clear information if and how this is possible without Aqara Hub and App?
For instance, i tried the generic_climate integration as well but the Aqara TRV doesn’t have a switch by which the valve can be toggled, does it? And even then, I’d have to augment the window sensor some other way because generic_climate only supports one external temperature sensor.

So it would really help if someone would elaborate with code examples of configuring the Aqara TRV to utilize external temperature and window sensors.

afaik you cannot use an external door/window sensor via z2m. it can only be done using the aqara gateway. as for the external temperature sensor, the z2m is pretty clear. use “mqtt.publish” with the topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"sensor": NEW_VALUE}. i use node-red, therefore cannot help you with a piece of code. there’s simply a “mqtt out” node. you can try it in developer tools/services as well.
you can turn the trv off, but you cannot control how much it is open. this is done by the internal algorithm as far as i can tell. when in heat mode, you only operate it by setting the target temperature. this means that you cannot implement your own control algorithm and have to rely on what the trv is doing by itself. for me this is working well enough.
the “better thermostat” integration is trying to somehow bypass this limitation by continuously altering the setpoint and (i presume) monitoring the result in order to fine tune the control algorithm. however, i don’t really like this method of tricking the device and i suppose it may somehow conflict with the internal algorithm. “better thermostat” also allows you to use an external open window sensor and turns off the trv when the window is open. you may want to try it, it may better suit your needs than mine. it is actively developed and updated almost daily (winter in the northern hemisphere, therefore a great need for using thermostats).

Thanks for the response!
I’ll take a look at “better thermostat” but at first glance it doesn’t seem to support the Aqara TRV.

For the sensor payload are we reading the same documentation?
The one i’m reading (Xiaomi SRTS-A01 control via MQTT | Zigbee2MQTT) says that “sensor” is an enum with two possible values: “external” or “internal”. So you set it to external and then how do you link the sensor? Looks to me like it might not be possible with Z2M?

z2m documentation may be a little confusing (and incomplete).


one attribute is “external”/“internal” and indicates what temperature sensor should be used. another attribute is the external temperature sensor value. the correct topic for publishing the external temperature value is actually: zigbee2mqtt/FRIENDLY_NAME/set/sensor_temp. if you use developer tools and read the state of the climate entity you get:

hvac_modes:
  - 'off'
  - heat
min_temp: 5
max_temp: 30
target_temp_step: 0.5
preset_modes:
  - none
  - manual
  - away
  - auto
current_temperature: 17.9
temperature: 18
preset_mode: manual
away_preset_temperature: '10.0'
battery: 100
calibrated: null
child_lock: LOCK
linkquality: 65
local_temperature: 17.9
occupied_heating_setpoint: 18
preset: manual
sensor: external
system_mode: heat
valve_alarm: false
valve_detection: 'ON'
voltage: null
window_detection: 'OFF'
window_open: null
friendly_name: TRV baie 2
supported_features: 17

as for “better thermostat”, sorry, it may be my mistake, as i may have tested it with a tuya based trv. i will check.

1 Like
alias: TRV-Birou-EXT-TEMP
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.senzor_birou_temperature
condition: []
action:
  - device_id: 5aaa671b66121939a0ba6687a8a76875
    domain: select
    entity_id: select.trv_birou_sensor
    type: select_option
    option: external
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/TRV_Birou/set/sensor_temp
      payload_template: >-
        {{ (states('sensor.senzor_birou_temperature')|float(0)|round(1))
        }}
mode: single
6 Likes

Fantastic, thanks GBCRAS!

Do you know if it’s possible to set the window contact value as well? Or is that not yet supported with Z2M?

I know that is not available in Z2MQTT. Is it in the Aqara app ?

it can be done with a simple automation. just turn off the trv when the window contact opens and switch it back to “heat” when the contact closes back. i suppose that’s what the internal software does, anyway.

1 Like

Those functionalities about which @serialoverflow saying is not implemented directly on TRV(device), that’s kind of hacks with full opening/closing TRV valve based on window’s sensor state, check this video https://www.youtube.com/watch?v=4Wm-LfuEYLU

Anyway thank you for showing parameter name for Aqara TRV. Looks that this TRV is really good but I miss valve status as I like to observe how open it is.

Hey folks,

based on your comments, i looked at “Better Thermostat” again and tried it out.
It actually seems to work really well! I tested it with 2 Aqara TRVs now, was able to add window and external temperature sensors to each and the target temperature is being set correctly. For instance, when i open a window, the valve is closed immediately and opened again when the window is closed.

I can also recommend the Better Thermostat UI Card linked in the video above, it shows all information at a glance.

If anyone else is using Aqara TRVs with Better Thermostat, what has been your experience with optimal settings?
Do you leave the original TRV settings untouched, including leaving the sensor field at “internal” and let Better Thermostat handle everything?
Did you benefit from enabling any of the Better Thermostat configuration options like “ignore any input on device including child lock” or the new algorithm with beta 43/44, “If your TRV has trouble with not recheating the target temperature or overheating, this option can help”?

Hey thanks for sharing this. Im unable to find my device id, could you tell me where i can find it ?. Also does the window detection work for you ? When i connected my trv and placed it outside for some minutes it dropped in temperature but never detected the window open, i thought the window open state would be triggered by a sudden drop in temperature.

I missed the valve position as well, but seems i don’t need it anymore as the Aqara TRV is working flawless compared with MOES.

Yes, I’m also not sure every time if it’s closed or not…
Is there a solution to turn it off completely?

Hey!

I`m using the “Better Thermostat” and on my side it has problems with turning the Aqara TRV back to hvac_mode “heat” when it was in “off”…

What settings are you using? I have it connected over Zigbee2MQTT. I can set everything over the HA UI, but using “Better Thermostat” does not work for me…

Could you provide your setup/config?

Greetings

I am using Better Thermostat as well and i can say that when the TRV is “Off” it still keeps the Target-Temperature… really strange. I think it isn’t a problem with Better Thermostat, it’s a Problem of the TRV itself. But i am not 100% shure…

Yes, compared with Moes, Aqara TRV is good and works as expected.

Hi, thanks for sharing, now my TVR read right temperature.
I’m a beginner in HA (supervised) and i have a question
i use 5 aqara TVR with z2m and i pilot gas heater by a sonoff mini zb
several automation for TVR,shedulating time, temperature etc… but only time schedule for sonoff switch
the sistem is quit inaccurate
i used auto discovery and i don’t know the way to change the configuration to add heater likely in generic thermostat

  • what is the best way to switch the heater with TVR? -
    thank You very much

Everything is working well compared to Moes TRVs. :slight_smile:

I’m trying to set this up, and I can easily publish the sensor data to the right topic (well, I can now once I learnt some more about MQTT). But how do I decide when to publish? I basically want the TRV to always use this sensor when it’s “looking” at the temperature. Will it automatically look at the last figure in that topic, and the temperature sensor will automatically make sure the topic always has an answer in there?

Thanks for the assist!