TRV Calibrator - Calibrate your valve with an external sensor (probably TRV agnostic)

I also had to do the same.

I’m not sure why the device_class of the temperature offset, which is the one used for calibration, was not recognized because I’m using the same TRV as the OP.
I guess something changed in Home Assistant in the last few updates.

1 Like

Same here. Got the TV05-ZG thermostat (shown as TZE200 mudxchsu TS0601) working with TRV Calibrator by deleting device_class from trv_calibration_number:

The calibration with this blueprint is not really good, i have deactivated now. I use Better Thermostat without Offset calibration, currently that’s enough for me.

The TRV Calibrator does exactly what it is advertising. Automatically setting the calibration offset. The thermostat itself does the rest. I don’t understand how this can be "not really good“. It just does new_trv_calibration = room_temperature - trv_temperature + trv_calibration which is usually what you would wan’t. I tried Better Thermostat first and was disappointed. I liked Versatile Thermostat much more than BT but I wanted a really simple solution so that my thermostat can do the job it was made for instead of some blackbox automation which is doing weird calculations to set a completely different temperature than the one I have set.

1 Like

I have created a blueprint automation and checked the setted offsets on my trv and the measured temperature is not the same what i can see after the calibration on the trv.

Hi @rotilho thanks for the blueprint. I am using the Moes TRV (Moes BRT-100-TRV control via MQTT | Zigbee2MQTT) and I’m struggling to get this to work unfortunately.

I have added the TRV, temp sensor, and TRV Calibration number to the blueprint and can verify the automation runs when the temp changes, but the TRV Calibration Number doesn’t seem to automatically change. I can change this value manually in the HA Entity list and see it update in Zigbee2MQTT and change the current temp on the device, but the automation doesn’t seem to update it.

I can’t see any errors in Zigbee2MQTT or in my HA logs either. Everything seems to be working… except the setting the calibration. Have you any ideas at all?

Cheers!

1 Like

Hi, i have 2 sonoff TRV. and tried to run 2 blueprints on the 2 TRVs. but now my TRVs are somehow linked toghether. I dont know if it is the blueprint or not, but now when i set the wanted temp in one room on 18°C, the other TRV takes that numbers as wel.
any idea?

template-trigger based version. It triggers when temp reported by TRV and room temp differs more than 0.5 degrees

blueprint:
  name: TRV Calibrator
  description: Calibrate your TRV using an external sensor
  domain: automation
  input:
    trv:
      name: Smart TRV
      selector:
        entity:
          domain: climate
    temperature_sensor:
      name: Temperature Sensor
      description: Sensor used to calibrate your TRV
      selector:
        entity:
          domain: sensor
          device_class: temperature
    trv_calibration_number:
      name: TRV Calibration Entity
      description: If you can't find it it's possible that your TRV don't support calibration. Consider using the Better Thermostat custom integration instead.
      selector:
        entity:
          domain: number
          device_class: temperature

mode: single

variables:
  trv: !input trv
  trv_calibration_number: !input trv_calibration_number
  temperature_sensor: !input temperature_sensor

trigger_variables:
  trigger_trv: !input trv
  trigger_temperature_sensor: !input temperature_sensor

trigger:
  - platform: template
    value_template: >-
      {{ ((
      ((state_attr(trigger_trv,'current_temperature')  | default (-1))
      - 
      (states(trigger_temperature_sensor) | float (-1))
      )) | abs ) > 0.5
      }}

condition:
  - condition: template
    value_template: >-
      {{state_attr(trv,'current_temperature') | default
      (-1) != -1}}
  - condition: template
    value_template: "{{states(temperature_sensor) | float (-1) != -1}}"

action:
  - variables:
      temp_diff: >-
        {{states(temperature_sensor) | float -
        state_attr(trv,'current_temperature' )}}
  - if:
      - condition: template
        value_template: "{{temp_diff | abs >0.5}}"
    then:
      - service: number.set_value
        metadata: {}
        data:
          value: >-
            {{temp_diff +
            states(trv_calibration_number)|
            float}}
        target:
          entity_id: !input trv_calibration_number
2 Likes

hello,

i try to use your blueprint (really easy)
but my trv have no decimal.
for the temperature and for the calibration is it only an integer (19,20°C) no decimal.
with the blueprint, the value change only if delta is more than 2°, can i adapt your blueprint for change only if it is 1° difference and do a new calibration as this time?

thank

Hi Felipe, I very much like the simplicity of your Blueprint automation. I was wondering if you could point me in the right direction to amend the automation so that the calibrator control can be restricted to when the TRV is being asked to heat or and when its called to heat by a schedule, such as the HACS Scheduler-component . Thanks in advance

Hello!

Can you share your modified Blueprint version?! I have the same problem.

Thanks!

I have tested all bueprints from this page and i did not get the results i wanted, just because all blueprints here are trying to get the calibration value forgeting that value its already set.
I have tested on Moes BRT-100-TR
So, if you want to get the calibration value, you must first remove the old calibration from the actual temp value… but you cant. You cant read the old calibration value with mqtt or other way, so, the only option is to set the calibration value to 0 and then make the math:
calibration= external_temp - device_temp

I have tested a new blueprint where i publish the 0 calibration, then i get the correct value.

blueprint:
  name: Sync TRV
  description: Sync external temperature sensor with TRV temperature
  domain: automation
  input:
    ieeeaddressoftrv:
      name: IEEE Address
      description: This is the address of the TRV found in your zigbee database example
        0x459877fffe1f2e83
    external_temp:
      name: Select the room temp sensor
      description: This will be your room temp sensor
      selector:
        entity:
          domain:
          - sensor
          device_class:
          - temperature
          multiple: false
    climate_name:
      name: Climate entry
      description: This will be the TRV it self in home assistant
      selector:
        entity:
          domain:
          - climate
          multiple: false
alias: Calibrate Thermostat
description: ''
variables:
  target_device: !input ieeeaddressoftrv
  climate_device: !input climate_name
  external_temperature: !input external_temp
trigger:
- platform: state
  entity_id: !input external_temp
  for:
    hours: 0
    minutes: 0
    seconds: 30
    milliseconds: 0
- platform: state
  entity_id: !input climate_name
  for:
    hours: 0
    minutes: 0
    seconds: 30
    milliseconds: 0
condition:
  condition: and
  conditions:
    - condition: template
      value_template: '{{ states(external_temperature) != ''unavailable'' }}'
    - condition: template
      value_template: '{{ states(external_temperature) != ''unknown'' }}'
    - condition: template
      value_template: >
        {{ 
        (state_attr(climate_device, 'current_temperature') | float(0) | round(0)) 
        != 
        (states(external_temperature) | float(0) | round(0)) 
        }}
action:
  - service: mqtt.publish
    data_template:
      topic: zigbee2mqtt/{{ target_device }}/set/local_temperature_calibration
      payload: "0"
  - delay: 5  # Așteaptă ca dispozitivul să aplice calibrarea de 0
  - service: mqtt.publish
    data_template:
      topic: zigbee2mqtt/{{ target_device }}/set/local_temperature_calibration
      payload: >-
        {{
        (
          (states(external_temperature) | float(0)) - 
          (state_attr(climate_device, 'current_temperature') | float(0))
        ) | round(0)
        }}
mode: single
max_exceeded: silent


I hope it’s ok if I get out this old Thread again :slight_smile: I have a little problem, my TRV gets calibrated but it is a bit repetitive and it makes no sense:


I am definitely too stupid to understand the code. My TRV can only show 1.0 steps in current_temperature and in target temperature - is it because of that?

How long should the delay be? I set it to 1 Minute in the screenshot.

Thank you!