Fix another bug in Danfoss Ally blueprint
This time we default to resetting the external temperature if the trigger state is not numeric.
This commit is contained in:
parent
5624a6002b
commit
3de96fbdc5
1 changed files with 12 additions and 9 deletions
|
|
@ -2,11 +2,11 @@ blueprint:
|
||||||
author: runejuhl
|
author: runejuhl
|
||||||
homeassistant:
|
homeassistant:
|
||||||
min_version: 2025.2.4
|
min_version: 2025.2.4
|
||||||
name: Radiator external temperature sensor control (0.0.3-alpha)
|
name: Radiator external temperature sensor control (0.0.4-alpha)
|
||||||
description: |-
|
description: |-
|
||||||
## Radiator external temperature sensor control
|
## Radiator external temperature sensor control
|
||||||
|
|
||||||
Version `0.0.3-alpha`.
|
Version `0.0.4-alpha`.
|
||||||
|
|
||||||
Sets the `external_measured_room_sensor` value on Danfoss Ally TRV, enabling
|
Sets the `external_measured_room_sensor` value on Danfoss Ally TRV, enabling
|
||||||
the TRV to adjust the valve based on an external sensor.
|
the TRV to adjust the valve based on an external sensor.
|
||||||
|
|
@ -73,16 +73,19 @@ 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) or (trigger.to_state.state in ['unavailable', 'unknown']) %}
|
{%- if (trigger.id is not defined) -%}
|
||||||
{{ states(temperature_entity) }}
|
{%- set new_temp = states(temperature_entity) | float(-1.0) %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ trigger.to_state.state | float }}
|
{%- set new_temp = (trigger.to_state.state | float(-1.0)) -%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{%- if new_temp <= 0.0 -%}
|
||||||
|
-8000.0
|
||||||
|
{%- else -%}
|
||||||
|
{{ new_temp * 100 | int }}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
- action: number.set_value
|
- action: number.set_value
|
||||||
target:
|
target:
|
||||||
entity_id: number.{{ states[climate_entity].object_id }}_external_measured_room_sensor
|
entity_id: number.{{ states[climate_entity].object_id }}_external_measured_room_sensor
|
||||||
data:
|
data:
|
||||||
value: |-
|
value: "{{ external_temperature }}"
|
||||||
{{
|
|
||||||
(external_temperature * 100) | int
|
|
||||||
}}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue