-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensor.yaml
210 lines (192 loc) · 8.76 KB
/
sensor.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
- platform: template
sensors:
washing_machine_state:
unique_id: washing_machine_state
friendly_name: "Washing Machine State"
value_template: >
{% set state_map = {
'washer_substate_program_started': 'Idle',
'unavailable': 'Idle',
'washer_substate_washing': 'Washing',
'washer_substate_drying': 'Drying',
'washer_substate_rinsing': 'Rinsing',
'washer_substate_spin': 'Spinning',
'washer_substate_paused': 'Paused',
'washer_substate_remove_laundry': 'Cycle Complete',
'washer_substate_time_delay_enabled': 'Delayed Start'
} %}
{% if states('sensor.bob_sub_state') == 'washer_substate_program_started' and states('sensor.bob_state') == 'device_state_off' %}
Off
{% else %}
{{ state_map.get(states('sensor.bob_sub_state'), states('sensor.bob_sub_state')) }}
{% endif %}
icon_template: >
{% set icon_map = {
'washer_substate_program_started': 'mdi:washing-machine-off',
'unavailable': 'mdi:washing-machine-alert',
'washer_substate_drying': 'mdi:tumble-dryer',
'washer_substate_washing': 'mdi:washing-machine',
'washer_substate_rinsing': 'mdi:dishwasher',
'washer_substate_spin': 'fas:spinner',
'washer_substate_paused': 'mdi:pause-box-outline',
'washer_substate_remove_laundry': 'mdi:check-circle-outline',
'washer_substate_time_delay_enabled': 'phu:rooms-laundry-room'
} %}
{{ icon_map.get(states('sensor.bob_sub_state'), 'mdi:washing-machine-alert') }}
count_automations:
friendly_name: "Automation Count"
value_template: "{{ states.automation | count }}"
icon_template: mdi:robot
unique_id: count_automations
attribute_templates:
on: >
{{ states.automation | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.automation | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_scripts:
friendly_name: "Script Count"
value_template: "{{ states.script | count }}"
icon_template: mdi:script-text-outline
unique_id: count_scripts
attribute_templates:
on: >
{{ states.script | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.script | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_device_trackers:
friendly_name: "Device Tracker Count"
value_template: "{{ states.device_tracker | count }}"
icon_template: mdi:lan-connect
unique_id: count_device_trackers
attribute_templates:
on: >
{{ states.device_tracker | selectattr('state', 'eq', 'home') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.device_tracker | selectattr('state', 'eq', 'not_home') | map(attribute='name') | list | join(', ') }}
count_binary_sensors:
friendly_name: "Binary Sensor Count"
value_template: "{{ states.binary_sensor | count }}"
icon_template: mdi:checkbox-multiple-blank-outline
unique_id: count_binary_sensors
attribute_templates:
on: >
{{ states.binary_sensor | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.binary_sensor | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_sensors:
friendly_name: "Sensor Count"
value_template: "{{ states.sensor | count }}"
icon_template: mdi:eye
unique_id: count_sensors
attribute_templates:
list: >
{{ states.sensor | selectattr('state') | map(attribute='name') | list | join(', ') }}
count_switches:
friendly_name: "Switch Count"
value_template: "{{ states.switch | count }}"
icon_template: mdi:toggle-switch-outline
unique_id: count_switches
attribute_templates:
on: >
{{ states.switch | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.switch | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_lights:
friendly_name: "Light Count"
value_template: "{{ states.light | count }}"
icon_template: mdi:lightbulb-outline
unique_id: count_lights
attribute_templates:
on: >
{{ states.light | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.light | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_zones:
friendly_name: "Zone Count"
value_template: "{{ states.zone | count }}"
icon_template: mdi:map-clock
unique_id: count_zones
attribute_templates:
list: >
{{ states.zone | selectattr('state') | map(attribute='name') | list | join(', ') }}
count_scenes:
friendly_name: "Scene Count"
value_template: "{{ states.scene | count }}"
icon_template: mdi:palette-outline
unique_id: count_scenes
attribute_templates:
list: >
{{ states.scene | selectattr('state') | map(attribute='name') | list | join(', ') }}
count_media_players:
friendly_name: "Media Player Count"
value_template: "{{ states.media_player | count }}"
icon_template: mdi:cast-audio
unique_id: count_media_players
attribute_templates:
on: >
{{ states.media_player | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.media_player | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
count_input_booleans:
friendly_name: "Input Boolean Count"
value_template: "{{ states.input_boolean | count }}"
icon_template: mdi:toggle-switch-off-outline
unique_id: count_input_booleans
attribute_templates:
on: >
{{ states.input_boolean | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }}
off: >
{{ states.input_boolean | selectattr('state', 'eq', 'off') | map(attribute='name') | list | join(', ') }}
moon_phase:
friendly_name: "Moon Phase"
unique_id: moon_phase_image
value_template: "{{ states.sensor.moon.state | replace ('_', ' ') | title}}"
entity_picture_template: /local/moon_phases/{{ states.sensor.moon.state }}.png
chair_occupancy:
friendly_name: "Chair Occupancy"
unique_id: chair_occupancy
value_template: "{{ iif(is_state('binary_sensor.vibration_vibration', 'on'), 'Away', 'At Desk') }}"
icon_template: "{{ iif(is_state('binary_sensor.vibration_vibration', 'on'), 'mdi:account-off', 'mdi:table-chair') }}"
black_bin:
friendly_name: Black Bin Pickup
unique_id: black_bin_pickup
value_template: >
{{ as_timestamp(state_attr("calendar.black_bin", "start_time")) | timestamp_custom('%B %-d') }}
attribute_templates:
next_collection: >
{{ ((as_timestamp(state_attr("calendar.black_bin", "start_time")) | as_datetime | as_local).date() - now().date()).days }}
icon: >
mdi:numeric-{{ ((as_timestamp(state_attr("calendar.black_bin", "start_time")) | as_datetime | as_local).date() - now().date()).days }}
blue_bin:
friendly_name: Blue Bin Pickup
unique_id: blue_bin_pickup
value_template: >
{{ as_timestamp(state_attr("calendar.blue_bin", "start_time")) | timestamp_custom('%B %-d') }}
attribute_templates:
next_collection: >
{{ ((as_timestamp(state_attr("calendar.blue_bin", "start_time")) | as_datetime | as_local).date() - now().date()).days }}
icon: >
mdi:numeric-{{ ((as_timestamp(state_attr("calendar.blue_bin", "start_time")) | as_datetime | as_local).date() - now().date()).days }}
doorbell_images:
friendly_name: Doorbell Image Captures
unique_id: doorbell_images
value_template: >
{{states.sensor.doorbell.attributes.number_of_files}}
attribute_templates:
path: >
{{ states.sensor.doorbell.attributes.path }}
filter: >
{{ states.sensor.doorbell.attributes.filter }}
number_of_files: >
{{ states.sensor.doorbell.attributes.number_of_files }}
bytes: >
{{ states.sensor.doorbell.attributes.bytes }}
file_list: >
{{ states.sensor.doorbell.attributes.file_list | sort }}
unit_of_measurement: >
{{ states.sensor.doorbell.attributes.unit_of_measurement }}
icon: >
{{ states.sensor.doorbell.attributes.icon }}
- platform: formulaone_api
- platform: folder
folder: /config/www/doorbell