Sonoff TRVZB External Temperature Sensor Calibration

is it only for ZHA ?

I try it with Z2MQTT, but must change MODEL filter to
model: “Zigbee thermostatic radiator valve”

and functions in vscode editor has warnings

Hello @Dr_Bean ,

thanks for your Blueprint but I also have to confirm that I have came into problem with it and its not working correctly under Z2M

I had to fight as well the model filtration and even if I did use the original authors filtration method, your blueprint didnt work correctly and never set the temperature to the external sensor.

I am also willing to host the file on github as soon as we have working version, as I am familiar with github by itself and its nice to be able to load it / update it oficial way ( unless OP plans to include your Blueprint as well)

Thanls for having a look about this

More people from CZ as I can see here :wink:

Did you try it if it works for you after fixing the model: part?

Thank you so much for this blueprint. I am a beginner and I just integrated the automationand It seems to work well after I almost gave up with the Sonoff thermostats. I tested it by heating up my external sensor by laying it on the radiator, and the values of my TRV and thermostat immediately changed in Home Assistant, so it seems to work.

As someone already mentioned before, I put the file that should be edited into device.yaml into configuration.yaml instead, because I do not have a device.yaml.

I am currently using VTherm. Will the settings for the last valve open and close still work because my logs only show values of 0 and 100.

I am also a bit confused about the local temperature calibration in the Zigbee2MQTT settings. Since my TRVs have deviations of up to 6 °C, do I still need to adjust them or can I leave them at 0, since the value will no longer be picked up anyway.

I tried downloading and using the original blueprint in my HA in which I run ZHA. Unfortunately, I run into a problem when trying to select the TRVZB entity: Translation error: the Intl string context variable string.

The result is that I cannot search/select any of my TRVZBs :frowning:

Any assistance is much appreciated.

1 Like

Same! Which language is your HA user in set to? Is your TRVZB connected over Zigbee2MQTT or over ZHA?

I can’t find the fault in the blueprint (but I’m a noob). Changing language to “English” for my HA user made the error disappear, but still the list stays empty.
I’m running ZHA, and the entity is number.sonoff_trvzb_external_temperature_sensor_value
which has the following attributes:

min: 0
max: 99.9
step: 0.1
mode: auto
unit_of_measurement: °C
friendly_name: SONOFF TRVZB External temperature sensor value

Yes, I made it for ZHA indeed: but I don’t see why it would not work for z2mqtt

Model: the zigbee versions of SONOFF TRVZBs are all called TRVZB.
Is yours from SONOFF?
And yes, you can change the model, that is only for selection, but if it is a different type of device it will not work.

The errors in vscode are not relevant: vscode does not have the correct HA-yaml. you can check yourself: action: switch.turn_on is the newest syntax as it should be.

does it work for you?

pls show device data from your device such as this:

In the original blueprint, for ZHA device the devices, selection list is empty when you try to setup the automation: This is caused by the “device class: Temperature”. you can remove that line (and you will see many devices… just find the correct one).

This is why I made the blueprint that I posted above (and added more functionality). should work for ZHA SONOFF TRVZB device

zigbee2mqt have differen device info

and when I test in templates …

I have to customize this for finally showing sonoff in select …
I was afraid, that here will be another similar errors … so I didnt try it more :smiley:

Now I have one home on OG blueprint from post 1 …
and in second home I am trying versatile thermostat … bu it is … umph … overwhelming :smiley: so I maybe come back try this :smiley:

Zdravím krajana :smiley:

yeah model par help … like I am showing one post up :slight_smile:
But I havent tried more …

First of all, thank you very much for your blueprint; I finally found it after a long search. After having increasing problems with Better Thermostat with every release, I switched to your blueprint and I must say it’s working great—it feels like the room temperatures are maintained much better with it (my setup is Sonoff TRVZB and Sonoff SNZB-02D).

I still have old Aqara temperature sensors for “unimportant” areas, and I suspect they are no longer transmitting temperatures correctly since the switch; they are stuck on a fixed value for too long (since yesterday morning). Could this be related to the force_update setting for the other temperature sensors?

And one more supplementary question: if there is an update to this blueprint, how do I find out about it and how can I install it? I suspect I need to keep an eye on this thread?

ok… indeed it seems the model name is different (I wonder whether I maybe ever managed to change this). So we can just add another model line to include them, that should help: (can’t edit to the original posting):

            - model: Zigbee thermostatic radiator valve

so new version:

blueprint:
  domain: automation
  name: Sonoff TRVZB External Sensor Sync
  description:
    "## Sonoff TRVZB External Temperature Sensor SYNCHRONISATION (v1.0.1 adapted by Dr_Bean)\nThis adapted
    blueprint synchronises the local temperature of one or more Sonoff TRVZBs with
    an external temperature sensor. Such behaviour might be required when an external
    temperature sensor more accurately reflects the room temperature compared with
    the internal temperature sensor in the TRV(s), or when you wish to use a single
    temperature sensor to control multiple radiators in a single room.\n\n
    When the sensor state is a valid number, the number.external_temperature_sensor_value
    of the TRVZB is updated and the switch.external_temperature_sensor is rewritten to external."
  input:
    sensor_entity:
      name: External Temperature Sensor
      description: The (single) entity of the external temperature sensor device
      selector:
        entity:
          filter:
            - domain:
                - sensor
              device_class:
                - temperature
          multiple: false
    trv_devices:
      name: Sonoff TRVZB(s)
      description: The Sonoff TRVZB device (can be multiple
      selector:
        device:
          multiple: true
          filter:
            - model: TRVZB
            - model: Zigbee thermostatic radiator valve
triggers:
  - trigger: state
    entity_id: !input sensor_entity
  - trigger: time_pattern # added to keep trvzb from falling back to internal sensor
    minutes: /30
variables:
  external_sensor: !input sensor_entity
  trvs: !input trv_devices
conditions:
  - condition: template
    value_template: "{{ is_number(states(external_sensor)) }}"
actions:
  - action: number.set_value
    metadata: {}
    data:
      value: "{{ states(external_sensor) | float }}"
    target:
      entity_id: >-
        {%- set ns1 = namespace(ents=[]) -%}
        {%- for trv in trvs -%}
          {%- set matches = device_entities(trv)|select('search', 'external_temperature_sensor_value$')|list -%}
          {%- set ns1.ents = ns1.ents + matches -%}
        {%- endfor -%}
        {{- ns1.ents -}}
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: >-
        {%- set ns2 = namespace(ents=[]) -%}
        {%- for trv in trvs -%}
          {%- set matches = device_entities(trv)|select('search', 'external_temperature_sensor$')|list -%}
          {%- set ns2.ents = ns2.ents + matches -%}
        {%- endfor -%}
        {{- ns2.ents -}}
mode: single