说明
顶级脚本。
字段
键 | 类型 | 说明 |
---|---|---|
metadata
|
元数据 |
提供脚本的元数据,例如名称和说明。 必填 |
automations
|
[自动化] |
指定自动化操作列表。 必填 |
示例
使用开关控制灯的简单脚本
metadata:
name: Turn on light with switch
description: Basic example of turning on a light with another switch.
automations:
starters:
type: device.state.OnOff
device: Office Switch - Office
state: on
is: true
actions:
- type: device.command.OnOff
devices:
- Christmas lights - Living Room
on: true