Better error handling for Danfoss Ally TRV blueprint
This commit is contained in:
parent
74d34e3d32
commit
ba83781b0d
1 changed files with 11 additions and 5 deletions
|
|
@ -41,15 +41,21 @@ triggers:
|
||||||
trigger: state
|
trigger: state
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
# We only want to execute the action if the temperature has changed by at least
|
# We only want to execute the action if
|
||||||
# 0.1 degress C, according to the Zigbee2MQTT documentation for the device:
|
#
|
||||||
|
# * the temperature sensor is available, or
|
||||||
|
#
|
||||||
|
# * the temperature has changed by at least 0.1 degress C, according to the
|
||||||
|
# Zigbee2MQTT documentation for the device:
|
||||||
# https://www.zigbee2mqtt.io/devices/014G2461.html
|
# https://www.zigbee2mqtt.io/devices/014G2461.html
|
||||||
#
|
#
|
||||||
# `external_measured_room_sensor` defaults to `-8000`, so this will work in all
|
# `external_measured_room_sensor` defaults to `-8000`, so this will work in all
|
||||||
# cases.
|
# cases.
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: |-
|
value_template: |-
|
||||||
{% if state_attr(climate_entity, 'external_measured_room_sensor') == None %}
|
{% if state_attr(temperature_entity, 'temperature') is none %}
|
||||||
|
False
|
||||||
|
{% elif state_attr(climate_entity, 'external_measured_room_sensor') == None %}
|
||||||
True
|
True
|
||||||
{% else %}
|
{% else %}
|
||||||
{{
|
{{
|
||||||
|
|
@ -65,7 +71,7 @@ actions:
|
||||||
# which case we pull the temperature from the sensor instead of the trigger
|
# which case we pull the temperature from the sensor instead of the trigger
|
||||||
# state.
|
# state.
|
||||||
external_temperature: |-
|
external_temperature: |-
|
||||||
{% if trigger.id is not defined %}
|
{% if (trigger.id is not defined) or (trigger.to_state.state in ['unavailable', 'unknown']) %}
|
||||||
{{ state_attr(temperature_entity, 'temperature') }}
|
{{ state_attr(temperature_entity, 'temperature') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ trigger.to_state.state | float }}
|
{{ trigger.to_state.state | float }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue