-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadascene_single.yaml
More file actions
98 lines (91 loc) · 3.08 KB
/
adascene_single.yaml
File metadata and controls
98 lines (91 loc) · 3.08 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
blueprint:
name: 定時觸發情境 - 單一時間版
description: >
在一天的指定時間,執行使用者勾選的 Scene 與/或 Script,
支援全域條件、星期條件
domain: automation
author: WOOW TECH CO., LTD.
input:
# ——— 單一觸發時間 ————————————————
event_time:
name: 觸發時間
icon: mdi:clock-outline
collapsed: true
input:
time_event:
name: 開始時間
default: "08:00:00"
selector:
time: {}
target_entities:
name: 要執行的 Scene / Script (可複選)
default: []
selector:
entity:
multiple: true
filter:
- domain: scene
- domain: script
# ——— 全域條件 (選填) —————————————
global_conditions_settings:
name: Global Conditions (選填)
icon: mdi:earth
collapsed: true
input:
global_conditions:
name: 額外全域條件
default: []
selector:
condition: {}
# ——— 生效星期 (選填) —————————————
weekday_settings:
name: 生效星期 (選填)
icon: mdi:calendar-week
collapsed: true
input:
condition_weekday:
name: 選擇星期
default: [mon, tue, wed, thu, fri, sat, sun]
selector:
select:
multiple: true
mode: list
options:
- { label: 週一, value: mon }
- { label: 週二, value: tue }
- { label: 週三, value: wed }
- { label: 週四, value: thu }
- { label: 週五, value: fri }
- { label: 週六, value: sat }
- { label: 週日, value: sun }
# ─── 變數 ───────────────────────────────────
variables:
_weekday: !input condition_weekday
_global_conds: !input global_conditions
_targets: !input target_entities
# ─── 觸發:單一時間 ───────────────────────
trigger:
- platform: time
at: !input time_event
id: t_event
# ─── 條件:全域+星期 ───────────────────────
condition:
- condition: or
conditions:
- condition: template
value_template: "{{ (_global_conds | length) == 0 }}"
- condition: and
conditions: !input global_conditions
- condition: time
weekday: !input condition_weekday
# ─── 動作:執行 ─────────────────────────
action:
- alias: "處理定時觸發"
choose:
- conditions: "{{ trigger.id == 't_event' and (_targets | length > 0) }}"
sequence:
- alias: "執行場景/腳本"
service: homeassistant.turn_on
target:
entity_id: "{{ _targets }}"
mode: single