forked from heinekmadsen/esphome_wavinahc9000v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjinja_examples.j2
More file actions
135 lines (126 loc) · 4.34 KB
/
Copy pathjinja_examples.j2
File metadata and controls
135 lines (126 loc) · 4.34 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
{# All-in-one (climate + sensor) #}
{% 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 %}
{# Climate only #}
{% 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 %}
{# Sensors only #}
{% 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 %}
{# Comfort climates only #}
{% 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 %}