説明
Automation Struct は、すべての自動化動作を提供します。複数の子自動化を含み、それらが連携して動作することがあります。
フィールド
| キー | 型 | 説明 | 
|---|---|---|
| name | String | デベロッパーが参照するための、この自動化の内部名。 省略可 | 
| starters | [スターター] | 自動化の開始条件。 必須 | 
| condition | 条件 | 適用するグローバル条件。 省略可 | 
| actions | [Action] | 自動化アクション。 必須 | 
例
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