Skip to content

Instantly share code, notes, and snippets.

@mweinelt
Created November 2, 2024 16:17
Show Gist options
  • Save mweinelt/70a4f0e2f8d0755435605e8ecbd7b231 to your computer and use it in GitHub Desktop.
Save mweinelt/70a4f0e2f8d0755435605e8ecbd7b231 to your computer and use it in GitHub Desktop.
Danfoss Ally TRV send external temperature (zigbee2mqtt)
blueprint:
domain: automation
name: Danfoss Ally Ext Temp Z2M
description: Update Danfoss Ally TRV external temperature with min/max refresh rate, via zigbee2mqtt
input:
ally_device:
name: Ally TRV Device
description: Temperature reading will be sent to this device
selector:
device:
manufacturer: Danfoss
entity:
domain: climate
temp_sensor_id:
name: Temperature Sensor
description: External sensor from which the temperature will be read. Expects data format 12.3
selector:
entity:
domain: sensor
device_class: temperature
max_update_timer_id:
name: Timer entity
description: >
Timer that will trigger at maximum update interval
if source sensor has not changed.
Sets automatically to 30min for covered, 3h for uncovered
Use separate timer for each automation.
selector:
entity:
domain: timer
variables:
device: !input ally_device
temp_sensor_id: !input temp_sensor_id
radiator_covered_state: >
{{ states(
device_entities(device)
|select('match', '.*radiator_covered$')|first) }}
min_update_minutes: >
{% if radiator_covered_state == 'off' %}
30
{% else %}
5
{% endif %}
max_update_minutes: >
{% if radiator_covered_state == 'off' %}
180
{% else %}
30
{% endif %}
trigger:
- platform: state
entity_id: !input temp_sensor_id
- platform: event
event_type: timer.finished
event_data:
entity_id: !input max_update_timer_id
condition:
- condition: template
value_template: >
{{ as_timestamp(now())
- as_timestamp(state_attr(this.entity_id,'last_triggered'),0)
> 60 * min_update_minutes }}
action:
- service: mqtt.publish
data:
topic: "zigbee2mqtt/{{ device_attr(device, 'name') }}/set/external_measured_room_sensor"
payload: "{{ (states(temp_sensor_id) | float * 100) | round(0) }}"
- service: timer.start
target:
entity_id: !input max_update_timer_id
data:
duration: "{{ max_update_minutes * 60 }}"
mode: single
@mweinelt
Copy link
Author

mweinelt commented Nov 2, 2024

Updated version of https://gist.github.com/bnapalm/eab265100029aa7f035ad29ef89708df for Home-Assistant 2025.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment