# Sonoff TRVZB

## Device Information

This TRV is recommanded one for Versatile Thermostat. We recommand to use it with Zigbee2MQTT.

## Direct Valve Control

### Device configuration

1. Create a _VTherm_ `over_climate` on the `climate` entity of the TRV, with the self-regulation [`Direct control of valve`](https://www.versatile-thermostat.org/en/docs/self-regulation/#self-regulation-by-direct-valve-control). Leave the option `Use internal temperature of the underlying` unchecked.
2. In the valve regulation configuration, select the `number` entities of the TRV: `opening_degree` for the opening and `closing_degree` for the closing. These entities may be hidden or disabled by default in Zigbee2MQTT or ZHA: enable them first.
3. To align the internal thermometer of the TRV with the room temperature, enable the [device temperature synchronization](https://www.versatile-thermostat.org/en/docs/feature-sync_device_temp/), with its calibration entity or its `external_temperature_input` entity.
4. Turn on the `Follow underlying temp change` entity of the _VTherm_ only after checking that this basic configuration works (see [follow underlying temperature changes](https://www.versatile-thermostat.org/en/docs/over-climate/#follow-underlying-temperature-changes)).

### Calibration

With a direct valve regulation (`over_valve` or `over_climate` with `auto_regulation_valve`), the *Regulation Threshold* must be set **in percent** and **must not be lower than 3%**:

> [!IMPORTANT]
> With a lower threshold, the Sonoff TRVZB can lose its calibration.

If the calibration has been lost, you can restore it with the [valve recalibration service](https://www.versatile-thermostat.org/en/docs/feature-recalibrate-valves/) (`recalibrate_valves`).

See [self-regulation](https://www.versatile-thermostat.org/en/docs/self-regulation/) for more details about these settings.

## Compatibility status

- **Supported**: This device is used directly by the Versatile Thermostat maintainer or a contributor, or has been extensively tested. Devices: Sonoff - TRVZB

## VTherm configuration

### Initialization

Go to your settings, then integrations, then click on add a new integration. Search for Versatile Thermostat.

Click on Thermostat over another thermostat.

### Basic attributes

Go to the "Main attributes" section.

1. Choose a name for your thermostat
2. Set the temperature sensor for your room
3. If you are using the Zigbee protocol and you have a "last_seen" entity for your temperature sensor, fill it in.

You can validate and return to the configuration menu.

### Underlying entities

Go to the underlying entities section.

1. Add the thermostats that will be controlled
2. In the auto-regulation section, choose "direct valve control"

You can validate and return to the configuration menu.

## Community references

Additional references may be old. A bug reported on an old version of VTherm may have been corrected on a more recent version.

- [#645 \[Feature request\] Add native support of Sonoff TRVZB valve in VTherm](https://github.com/jmcollin78/versatile_thermostat/issues/645)
- [#902 Sonoff TRVZB workaround to the 'hvac_action' always Idle issue](https://github.com/jmcollin78/versatile_thermostat/issues/902)
- [#1456 SONOFF TRVZB - losing valve calibration v2](https://github.com/jmcollin78/versatile_thermostat/issues/1456)
- [#1554 \[Feature Request\] - Add a max opening degree for direct valve control](https://github.com/jmcollin78/versatile_thermostat/issues/1554)
- [#1656 \[Feature Request\] - Add a recalibration service (action)](https://github.com/jmcollin78/versatile_thermostat/issues/1656)
- [#1727 Phyiscal valve still open, while VTherm shows 0% open](https://github.com/jmcollin78/versatile_thermostat/issues/1727)
- [#1943 Recalibirate is not working - V-Thermostat keeps heating even though it is set to 0% (Auto TPI activated, Sonoff TRVZB)](https://github.com/jmcollin78/versatile_thermostat/issues/1943)
- [#2077 Sleep/Maintenance Mode Issue](https://github.com/jmcollin78/versatile_thermostat/issues/2077)
- [Discussion #961 Sonoff TRVZB calibration is lost](https://github.com/jmcollin78/versatile_thermostat/discussions/961)
- [Discussion #1691 TPI output is linear, but TRV valve behavior is intentionally non-linear](https://github.com/jmcollin78/versatile_thermostat/discussions/1691)
