자동화

설명

자동화 구조는 모든 자동화 동작을 제공합니다. 함께 작동하는 여러 하위 자동화를 포함할 수 있습니다.

입력란

유형 설명
name String

개발자가 참조할 수 있는 이 자동화의 내부 이름입니다.

선택사항

변수가 허용됩니다.

starters [시작 조건]

자동화 시작 조건

필수

condition 조건

적용할 전역 조건입니다.

선택사항

actions [작업]

자동화 작업

필수

단일 자동화 사용: 오후 6시에 조명을 켭니다.

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

스크립트에서 여러 자동화 사용:

  • 오후 6시에 조명을 켭니다.
  • 오후 11시에 TV를 끄고 "잘 시간이에요"라고 방송해 줘.
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