-
-
Save sanderma/1e9163c690e23bc8d32a8c9e9d89a910 to your computer and use it in GitHub Desktop.
Homeassistant blueprint to set Tado offset using separate temperature sensor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Does anybody have the issue that this does not work when a room as more than one thermostat? The script works fine on one thermostat for me, but for rooms with more than one, the offset is not set.
I certainly didn't write/amalgamate this with that in mind.
How were you envisioning it should work? When temperature readings differ
between two thermometers, which one should be read?
I'm not planning on maintaining this much further as I'm not planning on
using it myself this winter. I've added right angle extensions to my
radiator valves to move them further away and unfortunately I have a very
busy job that has absolutely nothing to do with coding and am very amateur,
so this takes much more time for me to fix than I have available and
compared to how long it might take others.
…On Sun, 2 Oct 2022, 10:04 ilpantera, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Does anybody have the issue that this does not work when a room as more
than one thermostat? The script works fine on one thermostat for me, but
for rooms with more than one, the offset is not set.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/1e9163c690e23bc8d32a8c9e9d89a910#gistcomment-4321971>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJ7C5X26BFHJLXXE5XMQ3WBEXXVANCNFSM4ZNOPP6Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, just looked at the API and you can't change open window detection mode from there. I wonder though if you could just read the mode (manual/scheduled etc) prior to the offset change and then reset that afterwards, would that override the open window detection, I think so.