説明
Automation 構造体は、すべての自動化動作を提供します。複数の子自動化を組み合わせて使用できます。
フィールド
キー | 型 | 説明 |
---|---|---|
name
|
文字列 |
デベロッパー向けのこの自動化の内部名。 省略可 |
starters
|
[開始] |
自動化の開始条件。 必須 |
condition
|
条件 |
適用するグローバル条件。 省略可 |
actions
|
[アクション] |
自動化アクション。 必須 |
例
1 つの自動化を使用する: 午後 6 時に照明をオンにする。
automations:
starters:
type: time.schedule
at: 6:00 pm
actions:
type: device.command.OnOff
devices: Light A - Living Room
on: true
スクリプトで複数の自動化を使用する: * 午後 6 時に照明をオンにする。* 午後 11 時にテレビをオフにして、「寝る時間だよ」とブロードキャストする
automations:
- name: At 6pm, turn on light.
starters:
type: time.schedule
at: 6:00 pm
actions:
type: device.command.OnOff
devices: Light A - Living Room
on: true
- name: At 11pm, turn off TV and broadcast "time to sleep"
starters:
type: time.schedule
at: 6:00 pm
actions:
- type: device.command.OnOff
devices: TV - Living Room
on: false
- type: assistant.command.Broadcast
message: time to sleep