-
Notifications
You must be signed in to change notification settings - Fork 3
/
sensors.yaml
executable file
·171 lines (146 loc) · 4.22 KB
/
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
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
- platform: moon
- platform: uptime
- platform: uptime
name: "Uptime Minutes"
unit_of_measurement: minutes
- platform: template
sensors:
day_of_the_week:
entity_id: sensor.date
friendly_name: Day
value_template: >
{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}
- platform: google_travel_time
api_key: !secret google_travel_key
origin: !secret address
destination: !secret work_address
name: Travel Time to Work
- platform: darksky
api_key: !secret darksky_secret
forecast:
- 0
monitored_conditions:
- summary
- temperature
- hourly_summary
- temperature_high
- temperature_low
- platform: ups
username: !secret ups_username
password: !secret ups_password
- platform: fedex
username: !secret fedex_username
password: !secret fedex_password
- platform: template
sensors:
deliveries:
friendly_name: "Deliveries"
value_template: >
{% macro delivered(sensor) %}
{% if 'delivered' in sensor.attributes %}
{{sensor.attributes.delivered}}
{% else %}
0
{% endif %}
{% endmacro %}
{{ delivered(states.sensor.ups) | int + delivered(states.sensor.fedex) | int }}
- platform: airvisual
api_key: !secret airvisual_key
monitored_conditions:
- us
show_on_map: false
latitude: !secret latitude
longitude: !secret longitude
- platform: systemmonitor
resources:
- type: memory_use_percent
- type: processor_use
- platform: rest
scan_interval: 86400
resource: https://api.ipify.org/
name: External IP
value_template: '{{ value }}'
- platform: time_date
display_options:
- 'time'
- 'date'
- platform: template
sensors:
bayesian_presence_probability:
friendly_name: 'Bayesian Presence Probability'
unit_of_measurement: '%'
value_template: '{{ states.binary_sensor.bayesian_presence.attributes.probability | float * 100 }}'
# overall Bluetooth presence
- platform: min_max
name: "Bluetooth Presence Probability"
type: max
round_digits: 0
entity_ids:
- sensor.main_floor_presence
- sensor.upstairs_presence
# presence main floor
- platform: template
sensors:
main_floor_presence:
friendly_name: 'Main Floor Presence'
unit_of_measurement: '%'
value_template: "{{ states.sensor.main_floor_presence_confidence.state | int }}"
icon_template: "{{ 'mdi:signal-off' if is_state('sensor.main_floor_presence_confidence', 'unavailable') else 'mdi:signal'}}"
- platform: mqtt
state_topic: !secret presence_topic_main_floor
value_template: '{{ value_json.confidence }}'
unit_of_measurement: '%'
name: 'Main Floor Presence Confidence'
expire_after: 900
json_attributes:
- id
- name
- rssi
- version
- manufacturer
- type
- timestamp
- retained
- confidence
# presence upstairs
- platform: template
sensors:
upstairs_presence:
friendly_name: 'Upstairs Presence'
unit_of_measurement: '%'
value_template: "{{ states.sensor.upstairs_presence_confidence.state | int }}"
icon_template: "{{ 'mdi:signal-off' if is_state('sensor.upstairs_presence_confidence', 'unavailable') else 'mdi:signal'}}"
- platform: mqtt
state_topic: !secret presence_topic_upstairs
value_template: '{{ value_json.confidence }}'
unit_of_measurement: '%'
name: 'Upstairs Presence Confidence'
json_attributes:
- id
- name
- rssi
- version
- manufacturer
- type
- timestamp
- retained
- confidence
- platform: template
sensors:
battery_stairs_motion:
value_template: '{{ states.zwave.stairs_motion_sensor.attributes.battery_level }}'
friendly_name: 'Stairs Motion'
unit_of_measurement: '%'
- platform: template
sensors:
battery_entry_motion:
value_template: '{{ states.zwave.entry_motion_sensor.attributes.battery_level }}'
friendly_name: 'Entry Motion'
unit_of_measurement: '%'
- platform: command_line
name: Battery Shop Lights Switch
command: !secret shop_lights_switch_battery_command
unit_of_measurement: '%'
scan_interval: 43200
command_timeout: 60
value_template: '{{ value | replace("Battery level: ","") | replace("%","") | int }}'