HA automation of Tuya TRVs

Recently my central heating thermostat went BANG, so I decided to look at HA and Tuya TRVs as an alternative. As I’m new to HA and Tuya I need to some help to set this up.
So far I have:

  • Set up HA (2022.4.2) and Tuya integration on a RPI3B
  • Discovered the TRVs using the Tuya Smart App
  • Create a Tuya cloud account and sync’d with the App.
  • I can now see the TRVs in HA and control them (Set Temp, etc.)

I’m now struggling to understand what happens next. Clearly the TRV will open the value when the temp drops below the set temp point, but what Automation do I need to create in order to turn on a relay that signals the boiler to start? The Tuya TRV does not appear to offer any On/Off or Open/Closed state for HA to trigger on. How does HA detect this? Are there any examples that I can follow for this.

My next step would be to have multiple TRVs control the same relay (boiler) control. The issue is, how can many control one? If all the TRVs open their values then the relay is ON (demands heat from the boiler), but if one TRV closes then the boiler relay will receive an ‘OFF’ signal and shutdown. - no more heat for the other open TRVs. How can I avoid this? I only want to shutdown the boiler when the last TRV closes.

Pleeeeeeze help before I go bald tearing my hair out.

Thanks in anticipation.

First of all which TRV?
There are plenty of models. And what does the TRV expose in HA.
What entities are created, what attributes does is have?

Purchased off eBay.
Brand: Aubess
Description: Tuya ZigBee3.0 Smart Thermostat TRV + gateway
Supports: ZigBee, Tuya & SmartLife

This is the list taken from the Developers Tool

Entity State Attributes
Filter entities Filter states Filter attributes
[automation.trv_lounge_on](homeassistant.home 8123/developer-tools/state#)

Heating Controls|unavailable|restored: true friendly_name: Heating Controls supported_features: 0|
|[climate.thermostat_front_lounge](homeassistant.home :8123/developer-tools/state#)

thermostat - Front Lounge|heat_cool|hvac_modes: off, heat_cool, heat_cool min_temp: 25 max_temp: 150 target_temp_step: 0.5 current_temperature: 21.5 temperature: 104.5 friendly_name: thermostat - Front Lounge supported_features: 1|
|[sensor.thermostat_front_lounge_battery](homeassistant.home :8123/developer-tools/state#)

thermostat - Front Lounge Battery|100.0|state_class: measurement unit_of_measurement: % device_class: battery friendly_name: thermostat - Front Lounge Battery|
|[switch.thermostat_front_lounge_child_lock](homeassistant.home :8123/developer-tools/state#)

thermostat - Front Lounge Child Lock|off|icon: mdi:account-lock friendly_name: thermostat - Front Lounge Child Lock|
|[switch.thermostat_front_lounge_open_window_detection](homeassistant.home :8123/developer-tools/state#)

thermostat - Front Lounge Open Window Detection|off|icon: mdi:window-open friendly_name: thermostat - Front Lounge Open Window Detection|

It could be that the Tuya integration/tuya gateway doesn’t give that information.
Mine has this:

where I can see if the TRV is heating or idle, but I have mine connected with ZHA and conbee II.

I assume you need to create a binary sensor from the temperature attributes to determine if it’s on or off.
If you create one for each TRV and then add all the TRVs to a group then you should get a correct on/off state you can send to the boiler.

Or if you have a different ZigBee coordinator try and pair them with a different integration.

Thanks.
I dont have a serial radio for ZHA (yet), just trying to understand the setup at presents.

How do I create a binary sensor from the temp attr? I thought the attr were created by the device integration.
If I can create one, I assume I could say “If (target_temp - current_temp) > 0 then ON else OFF”

template:
  - binary_sensor:
      - name: "TRV status"
        state: "{{ state_attr('climate.thermostat_front_lounge', 'target_temp') - state_attr('climate.thermostat_front_lounge', 'current_temp') > 0 }}"

Not sure if the attributes are correct. It’s to hard to read from your previous post so I just used what you wrote recently.

However there might be a lower threshold you need to consider. If mine are set to 21.5, the temperature can go down to 21.0 before the TRVs are turned on.
If you don’t take that in to the equation then it will send the action to the boiler too soon.

When you have all your binary sensors add them to a group.

1 Like

Hellis81 - Thank you. I now have it working.

1 Like

I,m using wifi ( tuya based ) TRV’s. At first in smartlife app.
In the app can find output in each trv working status= heating on and pause.
In scene I use these: if one of all trv, working status is heating, then ( with delay ) diy mini smart switch is off
:if all of all trv, working status is pause, then diy mini smart switch is off

The boiler doesn’t accept 220V on terminals, used small omron contactor to create a potential free contact.

If only one trv is asking for heat the boiler has a problem with to little flow. disadvantage of thermostatic valves. they are closing bit by bit reaching setpoint of trv.

This moment busy wit HA to control the valve.

@rpikees - I saw a similar problem as my TRV’s do not say whether the value is open or closed. It only tells you the current temp and the setpoint temp. Therefore if the current temp is, say, 0.5C below the setpoint temp then HA runs the boiler, but the TRV has almost closed the value. Result: the rad gets cold.
I’ve changed this. Now HA sets the TRV setpoint temp to MAX (30C) for ON and MIN(5C) for OFF. By comparing the TRV current temp with a value I set in HA (room temp 22C) it can easily ensure the Rad turns ON/OFF.
Hope this helps.

@kevintedder how do you like the Aubess TRV? I’ve got one Moes to try it out and it’s not my favourite thing. I’m looking to get a bunch more for the rest of the house but don’t want to end up with a load of junk.

Did you get them working with zigbee?