-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscripts.yaml
More file actions
127 lines (124 loc) · 4.03 KB
/
Copy pathscripts.yaml
File metadata and controls
127 lines (124 loc) · 4.03 KB
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
downstairs_random_light:
alias: Downstairs Random Light
sequence:
- action: homeassistant.toggle
data:
entity_id:
"{% set group_id = 'light.downstairs_random_lights' %} {% set max_on
= 3 %} {% set lights_on_count = expand(group_id) | selectattr('state',
'eq', 'on')| list | length %} {% if lights_on_count > max_on %}\n {% set
lights_on_entities = expand(group_id) | selectattr('state', 'eq', 'on')| map(attribute='entity_id')
| list %}\n {{ lights_on_entities | random }}\n{% else %}\n {% set group_lights_entities
= expand(group_id) | map(attribute='entity_id') | list %}\n {{ group_lights_entities
| random }}\n{% endif %}"
mode: single
icon: mdi:lightbulb-group
upstairs_random_lights:
alias: Upstairs Random Lights
sequence:
- action: homeassistant.toggle
data:
entity_id:
"{% set group_id = 'light.upstairs_random_lights' %} {% set max_on
= 1 %} {% set lights_on_count = expand(group_id) | selectattr('state',
'eq', 'on')| list | length %} {% if lights_on_count > max_on %}\n {% set
lights_on_entities = expand(group_id) | selectattr('state', 'eq', 'on')| map(attribute='entity_id')
| list %}\n {{ lights_on_entities | random }}\n{% else %}\n {% set group_lights_entities
= expand(group_id) | map(attribute='entity_id') | list %}\n {{ group_lights_entities
| random }}\n{% endif %}"
mode: single
icon: mdi:lightbulb-group
test:
alias: Test Calendar
sequence:
- action: calendar.get_events
target:
entity_id:
- calendar.tsang_children
- calendar.family
data:
start_date_time: "2024-06-08 11:25:00"
duration:
hours: 1
minutes: 0
seconds: 0
response_variable: calendars
- action: script.send_to_home_log
data:
message:
"{%- for event in calendars['calendar.tsang_children'].events -%}
Name: {{ calendars['calendar.tsang_children'].events[0].summary }}
Location: {{ calendars['calendar.tsang_children'].events[0].location|default('N/A',true)
}}
Start Time: {{ calendars['calendar.tsang_children'].events[0].start }}
End Time: {{ calendars['calendar.tsang_children'].events[0].end }} {%- endfor
-%}"
log_level: Normal
mode: single
restart_esp:
alias: Restart ESP
description: ""
sequence:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id:
- switch.ashlee_s_bedroom_esp_plug
- switch.bedroom_esp_plug
- switch.conservatory_extension_2
- switch.kitchen_esp_plug
- switch.leo_s_bedroom_esp_plug
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id:
- switch.bedroom_esp_plug
- switch.kitchen_esp_plug
- switch.leo_s_bedroom_esp_plug
- switch.conservatory_extension_2
- switch.office_extension_l5
living_room_movie_mode:
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.enable_living_room_motion_triggers
alias: Living Room Movie Mode
description: ""
get_clock_emoji:
alias: Get Current Clock Emoji
description: Returns the appropriate clock emoji based on provided time
fields:
hour:
name: Hour
description: Hour in 12-hour format (1-12)
required: true
selector:
number:
min: 1
max: 12
minute:
name: Minute
description: Minute (0-59)
required: true
selector:
number:
min: 0
max: 59
sequence:
- variables:
half: "{% if minute > 15 and minute < 45 %}30{% else %}{% endif %}"
- variables:
emoji:
emoji: ":clock{{ hour }}{{ half }}:"
- stop:
response_variable: emoji
mode: parallel