-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
load_shedding_stage.yaml
86 lines (86 loc) · 2.17 KB
/
load_shedding_stage.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
alias: Load Shedding (Stage)
description: ""
trigger:
- platform: state
entity_id:
- sensor.load_shedding_stage_eskom
attribute: stage
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.load_shedding_stage_eskom
state: unavailable
alias: Not Unavailable
action:
- service: notify.mobile_app_all
data:
title: Load Shedding
message: |-
{% if is_state_attr(trigger.entity_id, "stage", 0) %}
Suspended
{% else %}
{{ states(trigger.entity_id) }}
{% endif %}
enabled: true
alias: Notify
- choose:
- conditions:
- condition: or
conditions:
- condition: time
after: input_datetime.sleep
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
- condition: time
before: input_datetime.wake
weekday:
- sun
- sat
- fri
- thu
- wed
- tue
- mon
sequence:
- wait_for_trigger:
- platform: time
at: input_datetime.wake
continue_on_timeout: false
default: []
alias: Defer
- service: tts.home_assistant_say
data:
entity_id: media_player.assistant_speakers
cache: true
message: |-
Load Shedding {% if is_state_attr(trigger.entity_id, "stage", 0) %}
Suspended
{% else %}
{{ states(trigger.entity_id) }}
{% endif %}
alias: Announce
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- if:
- condition: state
entity_id: sensor.load_shedding_area_tshwane_3_garsfonteinext8
state: "on"
then:
- service: tts.home_assistant_say
data:
message: Load shedding imminent!
entity_id: media_player.assistant_speakers
cache: true
alias: Announce
alias: Announce Imminent
mode: restart