Hi community, please help with the trigger in this blueprint
blueprint:
name: Update Entity Offset
description: Update the offset attribute of an entity based on another sensor's state
domain: automation
input:
sensor_to_monitor:
name: Zigbee Sensor to Monitor
description: The sensor whose state will be used to update the "offset" attribute
selector:
entity:
domain: sensor
device_class: temperature
entity_to_update:
name: Tado Entity to Update
description: The entity whose "offset" attribute will be updated
selector:
entity:
domain: climate
threshold:
name: Threshold
description: The maximum difference between the two sensors to trigger the automation
selector:
number:
min: 0
max: 10
step: 0.5
unit_of_measurement: "°C"
variables:
entity_to_update: !input entity_to_update
sensor_to_monitor: !input sensor_to_monitor
trigger:
platform: numeric_state
entity_id:
- !input sensor_to_monitor
- !input entity_to_update
value_template: "{{ (states(sensor_to_monitor)|float - state_attr(entity_to_update, 'current_temperature')|float)|abs }}"
above: !input 'threshold'
action:
- service: tado.set_climate_temperature_offset
data:
offset: "{{( state_attr(entity_to_update, 'offset_celsius')|float if state_attr(entity_to_update, 'offset_celsius') is not none else 0 ) + ((states(sensor_to_monitor)|float - state_attr(entity_to_update, 'current_temperature')|float) if states(sensor_to_monitor) is not none and state_attr(entity_to_update, 'current_temperature') is not none else 0 ) | round(1)}}"
target:
entity_id: !input entity_to_update
Everything works, but the trigger is just not getting values from the two variables.
If the trigger is put into dev tools → templates with appropriate names, value is being calculated correctly.
Thanks!