Compare commits

..

No commits in common. "d71116761dd95e315d195b1be8f3bb1b7cef69e6cc9f7b342966db0f802fc5b0" and "74d34e3d32fa7e198209095c20e2b228fdda5ca86ac6288d2b6db8df03155112" have entirely different histories.

View file

@ -41,23 +41,15 @@ triggers:
trigger: state
conditions:
# We only want to execute the action if
#
# * 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
# We only want to execute the action if 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
#
# `external_measured_room_sensor` defaults to `-8000`, so this will work in all
# cases.
- condition: template
value_template: |-
{# if the temperature entity doesn't have a state, e.g. if it's powered off #}
{% if states(temperature_entity) is none %}
False
{# if the radiator has been unavailable #}
{% elif state_attr(climate_entity, 'external_measured_room_sensor') is none %}
{% if state_attr(climate_entity, 'external_measured_room_sensor') == None %}
True
{% else %}
{{
@ -73,8 +65,8 @@ actions:
# which case we pull the temperature from the sensor instead of the trigger
# state.
external_temperature: |-
{% if (trigger.id is not defined) or (trigger.to_state.state in ['unavailable', 'unknown']) %}
{{ states(temperature_entity) }}
{% if trigger.id is not defined %}
{{ state_attr(temperature_entity, 'temperature') }}
{% else %}
{{ trigger.to_state.state | float }}
{% endif %}