[Z2M] Aqara TRV E1 link external temperature sensor

Am i the only one where it is not working ATM ?
I tried to send the mqtt manually and it also didn´t work. Only when i use the DeviceID and not the Name. But in the Blueprint i can only input the name and not the ID.

I had the same issue and it is caused by the flawed logic for determining aqara_trv_device_name that is then used to format the mqtt message if you set custom Home Assistant name for the device in z2m config.

What fixed it for me is setting the Home Assistant name within zigbee2mqtt / <your device> / Settings (all the way at the bottom of the page)
image

to the same value as the devices Friendly name.
image

If you wish to then have the devices name within HA to be nicely readable, just rename it within HA.
image

Wow I wish I’d seen this before. I wrote an automaton that would link my external temp sensor to my trv but from time to time my radiators would turn themselves from being external temperature sensor to internal. I would have to go in manually switch it back. This automation is brilliant as it changes the mode on the TRV automatically to external. Excellent work. Thank you very much

I am at a bit of a loss. I have tried this template, and tried coding this approach directly, and nothing I am doing is updating the TRV. I think everything is correct. What I am expecting is that “local temperature” should change to match the temperature sensor value sent. But nothing is happening. The switch from internal to external sensor works fine. But there is no temperature update. I am not sure what I am looking for to debug this. In particular, according to the logs, the mqtt meesage is being sent, but zigbee2mqtt does not register anything in its logs. Is anyone able to give me adivce on this?

Okay - my mistake, but for any others out there - if you have a couple of different zigbee2mqtt instances attached to your mosquitto broker, you need to replace the “zigbee2mqtt” in the template/script with the name of the zigbee2mqtt instance you are trying to call. In my case it is…

topic: zigbee2mqtt-house/valve livingbig/set/sensor_temp

…as with all bugs, its obvious when you find it, but wasted me hours, so if it helps anyone else then great.

1 Like

Warning: the payload has changed again: no longer

topic: zigbee2mqtt_1/{{aqara_trv_device_name}}/set/sensor_temp

but
topic: zigbee2mqtt_1/{{aqara_trv_device_name}}/set/external_temperature_input

Ah, you’re talking about Improving Aqara SRTS-A01 converter and general export tidying by mrskycriper · Pull Request #6922 · Koenkk/zigbee-herdsman-converters · GitHub - which isn’t yet in any of the stable releases.

1 Like

In the current z2m release (version 1.35.1), the external temperature topic is still sensor_temp. However, in response to feature developments, I have enhanced the blueprint. Now, both the topic name (which defaults to sensor_temp ) and the z2m instance name (defaulting to zigbee2mqtt) are configurable.

1 Like

With the New release the blueprint doesnt seem to work anymore. Ive changed the topic to external_temperature_input but it in Z2m i cant See the Temperature i set.
Is it maybe the topic Set and the paylord needs to be changed?

Also the Filter doesnt work anymore. Its now vendor Aqara and Model Smart radiator thermostat E1 (SRTS-A01) but that was any easy change

For me it seems to work fine with the updated version of Z2M 1.35.2 (besides adjusting the blueprint selectors / filters)

I’m using the following command in developer-toolsservices to trigger updates of the external temperature sensor.

service: mqtt.publish
data:
  topic: zigbee2mqtt/TRV Livingroom 01/set/external_temperature_input
  payload: "22.4"

also make sure that the TRV is set to ‘external’ (although the blueprint should ideally take care of this if not set).

When you investigate the Trace of the automation it should like this (my screenshot displays the case of setting the mode to external):

Ok. My fault. I thought i can See the Temperature in Z2m in the external temperature input. But that value stays at null
But the local temperature is changing. And thats what i need and want.

Thanks :slight_smile:

Following the Z2M update, the blueprint no longer works, I came here and found a correct update (super cool), but I would have liked the update to be able to do this automatically.

Should we just replace the blue print or rebuild all the automations? ,

Hi @pavax I was wondering why my heating hadn’t been working today after being rock solid for months with this blueprint and was really happy to see it had been updated yesterday to work with the updated z2m. Thank you so much, working perfectly again!

1 Like

Hi @pavax , just wanted to say thank you for this great blueprint! I find it extremely useful in my configuration, and it’s great you even updated it since the latest breaking z2m update!

1 Like

you should be good with simply re-importing the blueprint

I’m just testing the blueprint thinking it might help with my heating system. I use the Aqara TRVs with Aqara external temp monitor in most rooms. I do use the Better Thermostat add-on to combine things and take most of the logic away from the TRV itself but I thought what harm can it do to set the external sensor.

I have found now however that when the automation fires off to update the external temp it does correctly change the TRV to external as this was on internal previously but the temp does not get set. On checking the trace and looking at the timeline it just stops, the timeline says:

Triggered by the state of sensor.temp_sensor_4_temperature at 6 February 2024 at 21:19:18

Stopped because only a single execution is allowed at 6 February 2024 at 21:19:18 (runtime: 0.00 seconds)

Reading the state of the TRV in Zigbee2MQTT is says:

“external_temperature_input”: null,

Any idea why it isn’t setting it?

This is fantastic, somehow my automation stopped with the latest HA update , and using this BP I can set my aqara thermostat with just couple of clicks to use external sensor. Great job bro!

p.s. only need to figure out how to constantly update automation to use it every minute or something :slight_smile:

I am still using Z2M version 1.35.1 and need to change the name of the external temperature topic. Unfortunately I do not get a device to choose from because the device selector filter does not match, so I ask for an adjustment so that the old name is found.

    aqara_trv_device:
      name: The Aqara TRV
      description: The TRV that the temperature willl be set to
      selector:
        device:
          multiple: false
          filter:
          - integration: mqtt
            manufacturer: Aqara
            model: Smart radiator thermostat E1 (SRTS-A01)
          - integration: mqtt
            manufacturer: Xiaomi
            model: Aqara Smart Radiator Thermostat E1 (SRTS-A01)

Thank you so much for putting the work into this, and especially for maintaining it.

I noticed that my E1s seem to report their manufacturer/model a bit differently, so I had to adjust the entity filter to be able to select them. For some reason, they report “Xiaomi” as their manufacturer, and add the “Aqara” in front of the model. You can probably update the filter to look like this:

filter:
            - integration: mqtt
              manufacturer: Aqara
              model: Smart radiator thermostat E1 (SRTS-A01)
            - integration: mqtt
              manufacturer: Xiaomi
              model: Aqara Smart Radiator Thermostat E1 (SRTS-A01)

To enable selection of both E1s that report themselves in both ways.

Edit: It seems like @Ecronika seems to have made the same suggestion 4 days ago, should have checked the timeline before posting this

Any way to make it work whit TuYa TRV’s?