-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
load_shedding_start_end.yaml
115 lines (115 loc) · 3.12 KB
/
load_shedding_start_end.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
alias: Load Shedding (Start/End)
description: ""
trigger:
- platform: state
entity_id:
- sensor.load_shedding_area_tshwane_3_garsfonteinext8
to: "on"
from: "off"
condition:
- condition: numeric_state
entity_id: sensor.load_shedding_stage_eskom
attribute: stage
above: "0"
action:
- service: scene.create
data:
scene_id: slack_status_backup
snapshot_entities:
- input_text.slack_status_emoji
- input_text.slack_status_text
- service: input_text.set_value
data:
value: ":loadsheddingtransparent:"
target:
entity_id: input_text.slack_status_emoji
- service: input_text.set_value
data:
value: >-
Load Shedding until {{
(state_attr('sensor.load_shedding_area_tshwane_3_garsfonteinext8','end_time')
| as_datetime | as_local).strftime('%H:%M (%Z)') }}
target:
entity_id: input_text.slack_status_text
- if:
- condition: time
after: "17:00:00"
weekday:
- sat
- fri
- thu
- wed
- tue
- mon
- sun
then:
- service: light.turn_on
data:
color_temp: 500
brightness_pct: 1
target:
entity_id: light.all_lights
- service: light.turn_off
data: {}
target:
entity_id: light.all_lights
enabled: false
- delay: >-
{{ state_attr('sensor.load_shedding_area_tshwane_3_garsfonteinext8',
'ends_in') | multiply(60) | int(default=0.0) }}
- service: scene.turn_on
target:
entity_id: scene.slack_status_backup
data: {}
- service: rest_command.slack_status
data:
emoji: "{{ states.input_text.slack_status_emoji.state }}"
status: "{{ states.input_text.slack_status_text.state }}"
enabled: true
- service: rest_command.slack_status_zatech
data:
emoji: ":loadsheddingtransparent:"
status: >-
Load Shedding until {{
(state_attr('sensor.load_shedding_area_tshwane_3_garsfonteinext8','end_time')
| as_datetime | as_local).strftime('%H:%M (%Z)') }}
status_expiration: >-
{{
state_attr('sensor.load_shedding_area_tshwane_3_garsfonteinext8','end_time')
| as_timestamp(default=0.0)| int(default=0.0) }}
enabled: true
- if:
- condition: state
entity_id: group.family
state: home
- condition: time
after: "08:00:00"
before: "17:00:00"
then:
- service: light.turn_on
data:
transition: 5
kelvin: 5000
brightness_pct: 75
target:
entity_id: light.study_lights
enabled: false
- if:
- condition: state
entity_id: sensor.sun_stage
state: Night
then:
- service: light.turn_on
data:
brightness_pct: 2
target:
area_id: 42ace1a6ae2940f481359957243acb92
- service: homeassistant.turn_off
data: {}
target:
entity_id:
- input_boolean.bedroom_motion_lights
- input_boolean.bedroom_routine
- light.bed_lamps
enabled: false
mode: single