-
Notifications
You must be signed in to change notification settings - Fork 16
/
danfoss_ally_remote_temperature.yaml
82 lines (82 loc) 路 2.72 KB
/
danfoss_ally_remote_temperature.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
blueprint:
domain: automation
name: Ally Temp Update
description: 'Update Danfoss Ally TRV external temperature with min/max refresh
rate Original source: https://community.home-assistant.io/t/danfoss-ally-trv-working-with-remote-temp-sensor/276686/149'
source_url: https://github.com/mdeweerd/zha-toolkit/blob/master/blueprints/danfoss_ally_remote_temperature.yaml
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 (corresponding to 掳C)
selector:
entity:
domain: sensor
device_class: temperature
min_update_minutes:
name: Minimum update interval
description: >
Updates will not be sent if time from last update is less than minimum interval.
Normally 30 min for uncovered, 5 min for covered.
default: 5
selector:
number:
max: 360
min: 1
unit_of_measurement: minutes
mode: box
max_update_minutes:
name: Maximum update interval
description: >
Updates must be sent at least every 30 minutes for covered radiators,
and 3 hours for uncovered radiators.
Set to 30 min or 150 min.
default: 150
selector:
number:
max: 180
min: 1
unit_of_measurement: minutes
mode: box
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: homeassistant
event: start
condition:
- condition: template
value_template: >
{{ as_timestamp(now()) - as_timestamp(state_attr(this.entity_id,'last_triggered'),0)|int
>= (60 * min_update_minutes) }}
action:
- alias: Repeat until restarted to report temperature, or expired max_update delay
repeat:
while: "{{ 1 == 1 }}"
sequence:
- alias: Write remote temperature to Danfoss Ally
service: zha_toolkit.attr_write
data:
ieee: '{{ ieee }}'
cluster: 0x0201
attribute: 0x4015
attr_val: '{{ (states(temp_sensor_id) | float * 100) | round(0)}}'
- alias: Wait until the maximum update delay expires (automation restarts
when temperature changes before)
delay:
minutes: !input max_update_minutes
mode: restart