diff --git a/blueprints/danfoss_ally_trv_external_sensor.yaml b/blueprints/danfoss_ally_trv_external_sensor.yaml index f5496fa..46325b8 100644 --- a/blueprints/danfoss_ally_trv_external_sensor.yaml +++ b/blueprints/danfoss_ally_trv_external_sensor.yaml @@ -53,9 +53,11 @@ conditions: # cases. - condition: template value_template: |- - {% if state_attr(temperature_entity, 'temperature') is none %} + {# if the temperature entity doesn't have a state, e.g. if it's powered off #} + {% if states(temperature_entity) is none %} False - {% elif state_attr(climate_entity, 'external_measured_room_sensor') == None %} + {# if the radiator has been unavailable #} + {% elif state_attr(climate_entity, 'external_measured_room_sensor') is none %} True {% else %} {{ @@ -72,7 +74,7 @@ actions: # state. external_temperature: |- {% if (trigger.id is not defined) or (trigger.to_state.state in ['unavailable', 'unknown']) %} - {{ state_attr(temperature_entity, 'temperature') }} + {{ states(temperature_entity) }} {% else %} {{ trigger.to_state.state | float }} {% endif %}