Created
May 15, 2021 04:29
-
-
Save nevesenin/4907c46034f684d8825dd44402c67871 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: > | |
Target temperature adjustment depending on second temperature sensor and | |
thermostat | |
description: > | |
Sets target temperature depending on second temperature sensor. in addition | |
to this https://gist.github.com/nevesenin/86c471e8ea5ab10a2b9ddcbca6dbbccb | |
blueprint it reads target temperature from a thermostat. | |
domain: automation | |
input: | |
climate_source: | |
name: Source Thermostat | |
description: Climate entity which will send the temperature update | |
selector: | |
entity: | |
domain: climate | |
climate_target: | |
name: Target Radiators | |
description: Climate target which will get the temperature update | |
selector: | |
entity: | |
domain: climate | |
temperature_sensor: | |
name: Temperature Sensor | |
description: This sensor will be used as the source. | |
selector: | |
entity: | |
domain: sensor | |
device_class: temperature | |
variables: | |
climate_target: !input climate_target | |
climate_source: !input climate_source | |
temperature_sensor: !input temperature_sensor | |
target_temperature: "{{ state_attr(climate_source, 'temperature') }}" | |
actual_temperature: "{{ states(temperature_sensor) | float }}" | |
calculated_adjustment: "{{ target_temperature - actual_temperature }}" | |
calculated_target_temperature: "{{ ( ( ( target_temperature + calculated_adjustment ) * 2 ) | round ) / 2 }}" | |
trigger: | |
- platform: state | |
entity_id: !input temperature_sensor | |
- platform: state | |
entity_id: !input climate_source | |
- platform: homeassistant | |
event: start | |
condition: "{{ calculated_adjustment != 0 }}" | |
action: | |
- service: system_log.write | |
data: | |
message: > | |
{{ temperature_sensor }} has temp difference of {{ calculated_adjustment }}. | |
Setting target temperature to {{ calculated_target_temperature }} | |
level: info | |
logger: blueprints.nevesenin.target_temperature_adjustment_with_additional_thermostat | |
- service: system_log.write | |
data: | |
message: > | |
temperature_sensor: {{ temperature_sensor }}, | |
target_temperature: {{ target_temperature }}, | |
actual_temperature: {{ actual_temperature }}, | |
calculated_adjustment: {{ calculated_adjustment }}, | |
calculated_target_temperature: {{ calculated_target_temperature }} | |
level: debug | |
logger: blueprints.nevesenin.target_temperature_adjustment_with_additional_thermostat | |
- service: climate.set_temperature | |
data: | |
temperature: "{{ calculated_target_temperature }}" | |
entity_id: !input climate_target | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment