The second part of the automation listens for the external_temp_sensor_changed event and manages the Wiser heating.
Configuration Variables:
Adjust these in the trigger_variables section of the YAML:
boost_time: Duration (in minutes) to boost the temperature. The automation will cancel this early if the target is reached.tolerance_delta: The temperature difference (in °C) allowed between the sensor and the schedule before triggering or canceling a boost.max_boost_delta: The maximum temperature increase allowed (e.g., 5 for a max 5°C boost).
Advanced Tuning:
To change the intensity of the boost, you must modify the boost_delta_temp template line within the trigger block. The current multiplier is 1.5.
Example logic for boost_delta_temp:
boost_delta_temp: '{{(((current_temp_delta * 1.5) * 2 )|round(0)/2)|round(1)}}'
alias: Adjust Wiser Boost for Ext Temp Sensor Heat Management
description: Uses External Temp Sensor To Achieve Target Temp in Room
trigger:
- platform: event
event_type: external_temp_sensor_changed
variables:
temp_sensor: '{{trigger.event.data.entity_id}}'
temp_sensor_temp: '{{trigger.event.data.new_temp}}'
climate_entity: |-
{% for wiser_climate in area_entities(area_name(temp_sensor))
if wiser_climate.startswith('climate.')
and wiser_climate in integration_entities('wiser')
%}
{% if loop.first %}
{{wiser_climate}}
{% endif %}
{% endfor %}
schedule_temp: '{{state_attr(climate_entity, "current_schedule_temp")|float(0)}}'
current_temp_delta: '{{(schedule_temp - temp_sensor_temp)|round(1)}}'
boost_delta_temp: '{{(((current_temp_delta * 1.5) * 2 )|round(0)/2)|round(1)}}'
condition:
- condition: and
conditions:
- condition: template
value_template: '{{ states(climate_entity) is defined }}'
- condition: template
value_template: |-
{% if (
current_temp_delta > tolerance_delta
and not state_attr(climate_entity, 'is_heating')
and not state_attr(climate_entity, 'is_boosted')
)
or
(
current_temp_delta < tolerance_delta
and state_attr(climate_entity, 'is_boosted')
)
%}
True
{% endif %}
action:
- service: wiser.boost_heating
data_template:
entity_id: '{{climate_entity}}'
time_period: '{{ 0 if current_temp_delta < tolerance_delta else boost_time }}'
temperature_delta: >-
{{ 0 if current_temp_delta < tolerance_delta else [boost_delta_temp, max_boost_delta]|min}}
- service: logbook.log
data_template:
name: Wiser Temp Boost by Ext Sensor
message: |-
Temp Sensor - {{temp_sensor}},
Temp Sensor Temp - {{temp_sensor_temp}}°C,
Climate Entity - {{climate_entity}},
Schedule Temp - {{schedule_temp}}°C,
Current Temp Delta - {{current_temp_delta}},
Action -
{% if current_temp_delta < tolerance_delta %}
Boost Cancelled
{% else %}
Boosted By {{[boost_delta_temp, max_boost_delta]|min}}°C for {{boost_time}} mins
{% endif %}
entity_id: '{{climate_entity}}'
domain: wiser
trigger_variables:
boost_time: 30
tolerance_delta: 0.5
max_boost_delta: 5
mode: queued
max: 10