Tado set offset using separate temperature sensor

Set tado offset using other temperature sensor

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Temperature difference

Tado valves often measure a temperature that is off by a few degrees. This is because it’s measuring the temp real close to the radiator.

If you have another temperature sensor located in that room you’d like to use that as source.

Tado offset

Luckily Tado has an offset you can set per device, which allows you to tell the Tado that the room temp is off by a few degrees.

This blueprint will set the offset (temperature difference) on a Tado device, using another temperature sensor as source.

When either sensor changes, the automation is triggered.

Note:

Unfortunately Tado has the annoying habit of opening and closing the valve when you change the offset. Especially at night this can be something you’d rather not hear.

This blueprint does not handle this case (I really like simplicity), but there are some that do.

Logs

As it sucks to not see what’s going on, this blueprint will log:

  • info message that it has set an offset.
  • debug message with all the values

You can set the debuglevel in your configuration.yaml like so:

logger:
  default: error
  logs:
    blueprints.tado.offset: debug

Devices needed

You’ll need a Tado (obviously) and a separate temperature sensor.

Changelog

2021-07-08 Checking if source sensor is not null, as this could mean that it is offline.

Code

blueprint:
  name: Tado temperature offset
  description: Ensure the Tado smart valve has the temp of a separate sensor
  domain: automation
  input:
    source_temp_sensor:
      name: Source Temperature sensor
      description: This sensor will be used as the source.
      selector:
        entity:
          domain: sensor
          device_class: temperature
    target_tado:
      name: Tado
      description: The Tado to set the offset on.
      selector:
        entity:
          domain: climate

variables:
  target_tado: !input target_tado
  source_temp_sensor: !input source_temp_sensor
  tado_temp: "{{ state_attr(target_tado, 'current_temperature') | float }}"
  current_offset: "{{ state_attr(target_tado, 'offset_celsius') }}"
  actual_temp: "{{ states(source_temp_sensor) | float }}"
  offset: "{{ ( actual_temp - tado_temp ) | round }}"
  calculated_offset: "{{ ( ( actual_temp - tado_temp ) + current_offset ) | round }}"

trigger:
- platform: state
  entity_id: !input target_tado
  attribute: current_temperature
- platform: state
  entity_id: !input source_temp_sensor 

condition:
- condition: template
  value_template: "{{ offset != 0 }}"
- condition: template
  value_template: "{{ actual_temp != 0 }}"

action:
- service: system_log.write
  data:
    message: >
      {{ target_tado }} has temp difference of {{ offset }}. Setting offset to {{ calculated_offset }}
    level: info
    logger: blueprints.tado.offset
- service: system_log.write
  data:
    message: >
      target: {{ target_tado }} 
      source: {{ source_temp_sensor }}
      temp difference: {{ offset }}
      actual_temp: {{ actual_temp }}
      tado_temp: {{ tado_temp }}
      current_offset: {{ current_offset }}
      calculated_offset: {{ calculated_offset }}
    level: debug
    logger: blueprints.tado.offset
- service: tado.set_climate_temperature_offset
  data:
    offset: "{{ calculated_offset }}"
    entity_id: "{{ target_tado }}"
mode: single
6 Likes

For the ones who just want to take a look :wink:

1 Like

Yeah, didn’t finish the post properly :wink:
Added some more info.

Thanks, this is just what I was looking for! However, I’m getting the following error when trying to add the automation based on your blueprint. Any idea what might be causing this?

Error rendering variables: TypeError: unsupported operand type(s) for +: ‘float’ and ‘NoneType’

Nice Work!
What would be really great is an adoption for the Eurotronic Spirit Thermostats.
These are also widely spread and have the same issue. Working with Offset and an external Senor is the best solution … Should be minor to adapt … But not with my skills :wink:

Thank you very much, it works perfectly.
For monitoring and testing, I put a card with an attribute in lovelace where I can see how the offset changes over time.

Hmmm, perhaps your sensor doesn’t provide a correct value? What are you using?

I have exactly the same. Nice to see it still works and now much the offset is sometimes.

I’m using a couple of Xiaomi Mijia temperature sensors (LYWSD03MMC) connected via BLE to an ESP32 running ESPHome. Testing one of the sensors using your script. I’m getting in stable temperature readings from the sensor, but the error appears to indicate either the Tado or the Mijia data are not recognized by the automation.

@JeroenB
I’m using a couple of Xiaomi Mijia temperature sensors (LYWSD03MMC) connected via BLE to an ESP32 running ESPHome. Testing one of the sensors using your script. I’m getting in stable temperature readings from the sensor, but the error appears to indicate either the Tado or the Mijia data are not recognized by the automation.

Have you tried it out in the template section of HA?

Replace target_tado and source_temp_sensor with the entity_id of your devices

{{ state_attr(target_tado, 'offset_celsius') }}

{{ states(source_temp_sensor) | float }}

Hi,

thanks for this!
My HA is not calculating? Anyone knows why?

message: >-
  target: climate.buro  source: sensor.netatmo_homenet_buro_temperature temp
  difference: 0 actual_temp: 22.4 tado_temp: 22.6 current_offset: 0.0
  calculated_offset: 0

Greets Mike

First of all, thanks a lot for the blueprint, it works great! I’ve implemented my own ‘Open window sensor’ using Aqara’s window sensors, which shuts of the thermostat when the sensor state changes. However, the two automations don’t work alongside each other, as the offset ignores the shutoff thermostat. Therefore, I was wondering if it’s possible to implement a condition in your blueprint, that checks if a certain condition is met?

I also wanted to thank a lot for the blueprint and I have another request. Due to the nature of the blueprint I can see that the radiator temperature is frequently adjusted during the days. I have heard that this temperature adjusting actually consumes quite some battery of the radiator valves. Would it be possible to trigger the automation only when the heating is started? I do not care that the radiator temperature valve is off when the radiator is turned off but would like only to be triggered when the radiator valve is in function. I hope it makes sense. In this way for instance, I do not have to disable the automation in summer when for sure the valves will not be used.

@psihacker
Hi,

thanks for this!
My HA is not calculating? Anyone knows why?

message: >-
  target: climate.buro  source: sensor.netatmo_homenet_buro_temperature temp
  difference: 0 actual_temp: 22.4 tado_temp: 22.6 current_offset: 0.0
  calculated_offset: 0

Greets Mike

Guess you already know by now, but it’s rounding the temperatures, so a slight difference does nothing

@Tuxforce
First of all, thanks a lot for the blueprint, it works great! I’ve implemented my own ‘Open window sensor’ using Aqara’s window sensors, which shuts of the thermostat when the sensor state changes. However, the two automations don’t work alongside each other, as the offset ignores the shutoff thermostat. Therefore, I was wondering if it’s possible to implement a condition in your blueprint, that checks if a certain condition is met?

I guess you’d like the blueprint to be disabled then right?
You can do that via an automation yourself. That keeps this blueprint simple, and the problem is solved.

@marcpaget
I also wanted to thank a lot for the blueprint and I have another request. Due to the nature of the blueprint I can see that the radiator temperature is frequently adjusted during the days. I have heard that this temperature adjusting actually consumes quite some battery of the radiator valves. Would it be possible to trigger the automation only when the heating is started? I do not care that the radiator temperature valve is off when the radiator is turned off but would like only to be triggered when the radiator valve is in function. I hope it makes sense. In this way for instance, I do not have to disable the automation in summer when for sure the valves will not be used.

You could for example create an automation that will disable the blueprint if the temperature is above x.
You’ll never have to think about it again then :slight_smile:

Tank you…great blueprint!
I modified this myself not to round the calculated_offset (while still rounding offset) because this gives me a more accurate target temperature.
With rounding enabled it seems that the valve is cycling a lot between open/close (temperature gets too high at the valve).
I see that rounding the offset value is necessary, otherwise there will be too many changes to the Tado offset and thus resulting in constant “valve-drives”.

Could you share exactly what you modified? :slight_smile:

Changed this line in the variables block

from

calculated_offset: "{{ ( ( actual_temp - tado_temp ) + current_offset ) | round }}"

to

calculated_offset: "{{ (( actual_temp - tado_temp ) + current_offset) | round(1) }}"

Actually…it’s rounded to one decimal place :slight_smile:

1 Like

Surely the best approach for all of this is to create a Generic Thermostat that uses the services from Tado and the input from an external temperature sensor. Adjusting the offset 300 times a day via the Tado api (and the resulting battery drain / noise) seems unnecessary?

Edit: Here we go. This ended up being quite simple. The below will create a template thermostat component that calls tado on/off and uses an external sensor to sample the temperature. No need for messing around with offsets etc.

The only downside is:

  • when the thermostat needs to heat the room I’m telling Tado to heat it for 99 hours to 30 degrees. This is effectively my TADO ON command.

  • when the thermostat needs to stop heating the room I’m telling Tado heat it for 99 hours to 5 degrees. This is effectively my TADO OFF command.

Obviously this means the temperature displayed on the radiator and in the Tado app is incorrect. But who cares? I will now just switch to using homeassistant as the single source of control for heating.

climate:
  - platform: generic_thermostat
    name: Study Climate Tado Test
    heater: switch.study_climate_tado_test_heater_switch
    target_sensor: sensor.study_climate_sensor_temperature

switch:
  - platform: template
    switches:
      study_climate_tado_test_heater_switch:
        turn_on:
          service: tado.set_climate_timer
          target:
            entity_id: climate.study
          data:
            time_period: '99:00:00'
            temperature: 30
        turn_off:
          service: tado.set_climate_timer
          target:
            entity_id: climate.study
          data:
            time_period: '99:00:00'
            temperature: 5

Sorry but I don’t get why this solution should be any better than the offset variant?

In my opinion this has way more drawbacks (useless controls on the thermostat, etc.) than just a little more battery usage. In contrary to that, with the offset method you remain proper manual control on the Tado thermostat itself and have correct temperature readings in the Tado app and in HA.
As you may have read, temperatures are rounded that little changes of the ambient temperature do not result in repeating API calls.