Automation

Description

The Automation Struct provides all the automation behaviors. It may contain several child automations which work together.

Fields

Key Type Description
name String

An internal name of this automation for developers' reference.

Optional

Variable is allowed.

starters [Starter]

The automation starters.

Required

condition Condition

The global condition to apply.

Optional

actions [Action]

The automation actions.

Required

Examples

Use a single automation: At 6 pm, turn on light.

automations:
  starters:
    type: time.schedule
    at: 6:00 pm
  actions:
    type: device.command.OnOff
    devices: Light A - Living Room
    on: true

Use multiple automations in a script:

  • At 6pm, turn on light.
  • At 11pm, turn off TV and broadcast "time to sleep".
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: 11:00 pm
  actions:
  - type: device.command.OnOff
    devices: TV - Living Room
    on: false
  - type: assistant.command.Broadcast
    message: time to sleep