-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbinary_sensors.yaml
104 lines (90 loc) · 4.29 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
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
- platform: template
sensors:
presence_all:
friendly_name: "Presence"
device_class: presence
value_template: "{{ expand(['person.chris', 'person.melissa']) | selectattr('state', 'eq', 'home') | list | count > 0 }}"
master_bath_motion:
friendly_name: "Master Bath Motion"
device_class: motion
value_template: "{{ is_state('sensor.master_bath_motion', '8') }}"
upstairs_bathroom_motion:
friendly_name: "Upstairs Bathroom Motion"
device_class: motion
value_template: "{{ is_state('sensor.upstairs_bathroom_wired_motion', '8') }}"
mayson_in_bed:
friendly_name: "Mayson is in Bed"
icon_template: "{% if is_state('binary_sensor.mayson_in_bed', 'off') %}mdi:bed-empty{% else %}mdi:bed{% endif %}"
value_template: >-
{% set hour = strptime(states('sensor.time'), '%H:%M').hour %}
{{ is_state('switch.maysons_fan', 'on') and (hour >= 20 or hour < 7) }}
master_bed_all:
friendly_name: "Master all in Bed"
icon_template: "{% if is_state('binary_sensor.master_bed_all', 'off') %}mdi:bed-empty{% else %}mdi:bed{% endif %}"
value_template: >-
{% set hour = strptime(states('sensor.time'), '%H:%M').hour %}
{{ states('sensor.master_count') | int > 0 and states('sensor.master_count') <= states('sensor.master_bed_count') and (hour >= 20 or hour < 7) }}
time_to_upgrade:
friendly_name: "Time to Upgrade Home Assistant"
icon_template: mdi:package-up
value_template: "{{ states('sensor.latest_version').split('.')[1] | int - states('sensor.current_version').split('.')[1] | int > 1 }}"
fridge_freezer_temp_alert:
friendly_name: Fridge/Freezer Temperature Alert
value_template: >-
{{
is_state('binary_sensor.garage_fridge_temp_alert', 'on')
or is_state('binary_sensor.garage_freezer_temp_alert', 'on')
}}
garage_fridge_temp_alert:
friendly_name: Garage Fridge Temperature Alert
value_template: >-
{{
not is_state('sensor.garage_fridge_temp', 'unavailable')
and
(
states("sensor.garage_fridge_temp") | int < 34
or
states("sensor.garage_fridge_temp") | int > 45
)
}}
garage_freezer_temp_alert:
friendly_name: Garage Freezer Temperature Alert
value_template: >-
{{
not is_state('sensor.garage_freezer_temp', 'unavailable')
and
states("sensor.garage_freezer_temp") | int > 30
}}
storage_alert:
friendly_name: Storage Space is Low
value_template: "{{ states('sensor.disk_use_percent') | int > 80}}"
device_offline:
friendly_name: One or More Devices are Offline
value_template: >-
{{ expand(states.binary_sensor)
| selectattr('attributes.device_class', 'eq', 'connectivity')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_g35')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_suburban')
| selectattr('state', 'eq', 'off')
| list | length > 0 }}
robo_vac_status:
friendly_name: Robo-Vac Status
device_class: connectivity
icon_template: mdi:robot-vacuum-variant
entity_id: vacuum.neato
value_template: "{{ not is_state('vacuum.neato', 'unavailable') }}"
time_to_vacuum_main_floor:
friendly_name: "Time to Vacuum the Main Floor"
value_template: "{{ (as_timestamp(strptime(states('sensor.date_time'), '%Y-%m-%d, %H:%M')) - as_timestamp(state_attr('automation.vacuum_the_main_floor_at_night', 'last_triggered'))) / 60 /60 > 36 }}"
chris_phone_connected_to_g35:
friendly_name: "Chris' Phone is Connected to G35"
device_class: connectivity
icon_template: mdi:car-connected
entity_id: sensor.pixel_3_bluetooth_connection
value_template: "{{ '68:9A:87:9A:44:C9' in state_attr('sensor.pixel_3_bluetooth_connection', 'connected_paired_devices') }}"
chris_phone_connected_to_suburban:
friendly_name: "Chris' Phone is Connected to Suburban"
device_class: connectivity
icon_template: mdi:car-connected
entity_id: sensor.pixel_3_bluetooth_connection
value_template: "{{ '94:44:44:22:64:26' in state_attr('sensor.pixel_3_bluetooth_connection', 'connected_paired_devices') }}"