A blueprint for thermostat calibration based on external and local temperature sensors.
blueprint:
name: Thermostat Calibration Blueprint
description: A blueprint for thermostat calibration based on external and local temperature sensors.
domain: automation
input:
thermostats:
name: Thermostats Configuration
description: List of thermostat entities, their external temperature sensors, and thermostat entities.
default: []
selector:
list:
element:
object:
entity_id:
description: The entity_id of the thermostat calibration entity (number type).
selector:
entity:
domain: number
external_temp_sensor:
description: The entity_id of the external temperature sensor.
selector:
entity:
domain: sensor
thermostat_entity:
description: The entity_id of the thermostat entity providing the local temperature.
selector:
entity:
domain: climate
trigger:
- platform: time_pattern
minutes: "0" # Triggers every the choice you've specified period
condition: []
action:
- repeat:
for_each: "{{ input.thermostats }}"
sequence:
- variables:
entity_id: "{{ repeat.item.entity_id }}"
external_temp: "{{ states(repeat.item.external_temp_sensor) | float(default=0) }}"
thermostat_temp: "{{ state_attr(repeat.item.thermostat_entity, 'local_temperature') | float(default=0) }}"
current_correction: "{{ states(repeat.item.entity_id) | float(default=0) }}"
calculated_diff: >
{% set diff = (external_temp - thermostat_temp + current_correction) %}
{{ diff | round(0) | int }}
correction: >
{% if calculated_diff == current_correction %}
{{ current_correction }}
{% else %}
{{ calculated_diff }}
{% endif %}
- service: number.set_value
target:
entity_id: "{{ entity_id }}"
data:
value: "{{ correction | float }}"
mode: single