-
Notifications
You must be signed in to change notification settings - Fork 0
/
binary_sensors.yaml
55 lines (50 loc) · 3.17 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- platform: template
sensors:
in_bed:
friendly_name: In Bed?
unique_id: in_bed
device_class: occupancy
value_template: >-
{{ not (is_state('binary_sensor.withings_in_bed', 'off') or is_state('binary_sensor.withings_in_bed', 'unknown') or is_state('binary_sensor.withings_in_bed', 'unavailable')) or is_state('input_boolean.bed', 'on') }}
icon_template: "{{ iif(is_state('binary_sensor.in_bed', 'on'), 'mdi:bed', 'mdi:bed-outline') }}"
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') or not is_state('sensor.vibration_action', 'None')
}}
icon_template: "{{ iif(is_state('binary_sensor.chair_occupancy', 'on'), 'mdi:table-chair', 'mdi:account-off') }}"
delay_off: "00:01:00"
# 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 }}"
heater:
friendly_name: Heater
unique_id: heater
device_class: power
value_template: >-
{{ states('sensor.heater_power') | float > 0 }}