File tree Expand file tree Collapse file tree 1 file changed +40
-9
lines changed
Expand file tree Collapse file tree 1 file changed +40
-9
lines changed Original file line number Diff line number Diff line change 3030### HA实体与自动化配置
3131每个该卡片需要一个唯一记时器实体,以及一条自动化用于倒计时结束后的实体执行
3232- 记时器实体:创建一个计时器辅助元素,记录其timer实体ID
33- - 自动化,监听该计时器的timer.finished事件,继而触发后续操作,自动化yaml配置示例:
33+ - 自动化,监听该计时器的timer.finished事件,继而触发后续操作,同时监听实体的关闭操作,用于自动取消计时器, 自动化yaml配置示例:
3434 ```
35- alias: xxxx定时器
35+ alias: test计时器
3636 description: ""
3737 triggers:
38- - event_type: timer.finished
38+ - trigger: event
39+ event_type: timer.finished
3940 event_data:
40- entity_id: timer.your_entity_id #你的计时器实体
41- trigger: event
41+ entity_id: timer.your_timer_entity #替换你的timer实体
42+ alias: 计时器自然结束
43+ id: 计时器自然结束
44+ - trigger: state
45+ entity_id:
46+ - switch.your_switch_entity #替换你的switch实体
47+ from: "on"
48+ to: "off"
49+ alias: 实体被手动关闭
50+ id: 实体被手动关闭
51+ conditions: []
4252 actions:
43- - action: switch.turn_off #关闭操作
44- data: {}
45- target:
46- entity_id: switch.your_entity_id #你的开关实体
53+ - alias: 事件分流
54+ choose:
55+ - conditions:
56+ - condition: trigger
57+ id:
58+ - 计时器自然结束
59+ sequence:
60+ - action: switch.turn_off
61+ target:
62+ entity_id: switch.your_switch_entity #替换你的switch实体
63+ alias: 关闭实体
64+ alias: 自然结束-关闭实体
65+ - conditions:
66+ - condition: trigger
67+ id:
68+ - 实体被手动关闭
69+ - condition: state
70+ entity_id: timer.your_timer_entity #替换你的timer实体
71+ state: active
72+ sequence:
73+ - action: timer.cancel
74+ target:
75+ entity_id: timer.your_timer_entity #替换你的timer实体
76+ alias: 手动关闭-取消计时
4777 mode: single
78+
4879 ```
4980### 配置选项 (Configuration Options)
5081| 配置项 | 效果说明 | 使用说明 | 配置示例 |
You can’t perform that action at this time.
0 commit comments