-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinary_sensors.yaml
41 lines (38 loc) · 2.61 KB
/
binary_sensors.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
- platform: template
sensors:
chair_occupancy:
friendly_name: "Chair Occupancy"
unique_id: chair_occupancy
device_class: occupancy
value_template: >-
{{ max(
as_timestamp(states.sensor.vibration_angle_x.last_changed),
as_timestamp(states.sensor.vibration_angle_y.last_changed),
as_timestamp(states.sensor.vibration_angle_z.last_changed)
) > (as_timestamp(now()) - 30) or is_state('binary_sensor.vibration_vibration', 'on')
}}
icon_template: "{{ iif(is_state('binary_sensor.chair_occupancy', 'on'), 'mdi:table-chair', 'mdi:account-off') }}"
availability_template: "{{states.binary_sensor.vibration_vibration.state != 'unavailable'}}"
delay_off: "00:00:30"
# True if there are any updates
hacs_updates:
friendly_name: "HACS Updates"
unique_id: hacs_updates
icon_template: mdi:package-up
device_class: update
value_template: "{{ states.update | selectattr('state', 'eq', 'on') | selectattr('entity_id', 'in', integration_entities('hacs')) | map(attribute='name') | list | count }}"
availability_template: "{{ states.update | selectattr('state', 'eq', 'on') | selectattr('entity_id', 'in', integration_entities('hacs')) | map(attribute='name') | list | count | int(-1) > -1 }}"
addon_updates:
friendly_name: "Add-on Updates"
unique_id: addon_updates
icon_template: mdi:package-up
device_class: update
value_template: "{{ states.update | selectattr('state', 'eq', 'on') | selectattr('entity_id', 'in', integration_entities('hassio')) | rejectattr('entity_id', 'eq', 'update.home_assistant_core_update') | map(attribute='name') | list | count }}"
availability_template: "{{ states.update | selectattr('state', 'eq', 'on') | selectattr('entity_id', 'in', integration_entities('hassio')) | rejectattr('entity_id', 'eq', 'update.home_assistant_core_update') | map(attribute='name') | list | count | int(-1) > -1 }}"
other_updates:
friendly_name: "Other Updates"
unique_id: other_updates
icon_template: mdi:package-up
device_class: update
value_template: "{{ states.update | selectattr('state', 'eq', 'on') | rejectattr('entity_id', 'in', integration_entities('hassio')) | rejectattr('entity_id', 'in', integration_entities('hacs')) | map(attribute='name') | list | count }}"
availability_template: "{{ states.update | selectattr('state', 'eq', 'on') | rejectattr('entity_id', 'in', integration_entities('hassio')) | rejectattr('entity_id', 'in', integration_entities('hacs')) | map(attribute='name') | list | count | int(-1) > -1 }}"