forked from willbob8/willsurridgetech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime_of_day.yaml
More file actions
34 lines (33 loc) · 776 Bytes
/
time_of_day.yaml
File metadata and controls
34 lines (33 loc) · 776 Bytes
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
binary_sensor:
- platform: tod
name: Morning
after: sunrise
after_offset: "-02:00"
before: "12:00"
- platform: tod
name: Afternoon
after: "12:00"
before: "17:00"
- platform: tod
name: Evening
after: "17:00"
before: "22:00"
- platform: tod
name: Night
after: "22:00"
before: sunrise
sensor:
- platform: template
sensors:
time_of_day:
friendly_name: "Time of Day"
value_template: >-
{% if is_state('binary_sensor.morning','on') %}
Morning
{% elif is_state('binary_sensor.afternoon','on') %}
Afternoon
{% elif is_state('binary_sensor.evening','on') %}
Evening
{% else %}
Night
{% endif %}