Created
September 25, 2022 15:39
-
-
Save bnapalm/b9c36c036c4659f11c95a6ad5ffb5057 to your computer and use it in GitHub Desktop.
Danfoss Ally TRV send external temperature (ZHA)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
domain: automation | |
name: Ally Temperature Update | |
description: Update Danfoss Ally TRV external temperature with min/max refresh rate | |
input: | |
ally_device: | |
name: Ally TRV Device | |
description: Temperature reading will be sent to this device | |
selector: | |
device: | |
manufacturer: Danfoss | |
entity: | |
domain: climate | |
min_update_minutes: | |
name: Minimum update interval | |
description: > | |
Updates will not be sent if time from last update is less than minimum interval. | |
Normally 30min for uncovered, 5min for covered. | |
selector: | |
number: | |
max: 360 | |
min: 1 | |
unit_of_measurement: minutes | |
mode: box | |
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 be (re)started on update. | |
Set this timer to slowest interval you want the device to update at. | |
Normally 3h for uncovered, 30m for covered. | |
Use separate timer for each automation. | |
selector: | |
entity: | |
domain: timer | |
variables: | |
device: !input ally_device | |
ieee: "{{(device_attr(device, 'identifiers')|list)[0][1]}}" | |
min_update_minutes: !input min_update_minutes | |
temp_sensor_id: !input temp_sensor_id | |
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)|int | |
> (60 * min_update_minutes) }} | |
action: | |
- service: zha.set_zigbee_cluster_attribute | |
data: | |
ieee: '{{ ieee }}' | |
endpoint_id: 1 | |
cluster_id: 513 | |
cluster_type: in | |
attribute: 16405 | |
value: '{{ (states(temp_sensor_id) | float * 100) | round(0) }}' | |
- service: timer.start | |
target: | |
entity_id: !input max_update_timer_id | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment