-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathjinjatemplate.txt
More file actions
146 lines (136 loc) · 4.76 KB
/
Copy pathjinjatemplate.txt
File metadata and controls
146 lines (136 loc) · 4.76 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Home Assistant Jinja templates to stitch chunked YAML sensors into complete sections (supports optional comfort & group climates; floor sensor YAML removed). The deprecated unified all-climates sensor was removed.
All-in-one (climate + sensor)
{% raw %}
{# Gather chunk sensors and indent entity blocks. Ignore empty/unknown/unavailable. #}
{% set climates = states.sensor
| selectattr('entity_id','search','_yaml_climate_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set comfort_climates = states.sensor
| selectattr('entity_id','search','_yaml_comfort_climate_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set group_chunks = states.sensor
| selectattr('entity_id','search','_yaml_group_climate_chunk_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set batteries = states.sensor
| selectattr('entity_id','search','_yaml_battery_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set temps = states.sensor
| selectattr('entity_id','search','_yaml_temperature_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set locks = states.sensor
| selectattr('entity_id','search','_yaml_child_lock_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
climate:
{% for s in climates %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% for s in comfort_climates %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% if group_chunks | length > 0 %}
# Group climates
{% for gc in group_chunks %}
{{ (gc.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% endif %}
sensor:
{% for s in batteries %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% for s in temps %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% if locks | length > 0 %}
switch:
{% for s in locks %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% endif %}
{% endraw %}
Climate-only (includes optional comfort + group)
{% raw %}
{% set climates = states.sensor
| selectattr('entity_id','search','_yaml_climate_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set comfort_climates = states.sensor
| selectattr('entity_id','search','_yaml_comfort_climate_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set group_chunks = states.sensor
| selectattr('entity_id','search','_yaml_group_climate_chunk_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
climate:
{% for s in climates %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% for s in comfort_climates %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% if group_chunks | length > 0 %}
# Group climates
{% for gc in group_chunks %}
{{ (gc.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% endif %}
{% endraw %}
Sensors-only (battery + temperature)
{% raw %}
{% set batteries = states.sensor
| selectattr('entity_id','search','_yaml_battery_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
{% set temps = states.sensor
| selectattr('entity_id','search','_yaml_temperature_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
sensor:
{% for s in batteries %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% for s in temps %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% endraw %}
Comfort climate only
{% raw %}
{% set comfort_climates = states.sensor
| selectattr('entity_id','search','_yaml_comfort_climate_')
| selectattr('state','ne','unknown')
| selectattr('state','ne','unavailable')
| rejectattr('state','equalto','')
| sort(attribute='entity_id') | list %}
climate:
{% for s in comfort_climates %}
{{ (s.state | trim | replace('\n', '\n ')) }}
{% endfor %}
{% endraw %}