Descrizione
La struttura Automation fornisce tutti i comportamenti di automazione. Può contenere diverse automazioni secondarie che funzionano insieme.
Campi
Chiave | Tipo | Descrizione |
---|---|---|
name
|
String |
Un nome interno di questa automazione per riferimento degli sviluppatori. Facoltativo |
starters
|
[Starter] |
I comandi iniziali per le automazioni. Obbligatorio |
condition
|
Condizione |
La condizione globale da applicare. Facoltativo |
actions
|
[Azione] |
Le azioni di automazione. Obbligatorio |
Esempi
Utilizza una singola automazione: alle 18:00, accendi la luce.
automations:
starters:
type: time.schedule
at: 6:00 pm
actions:
type: device.command.OnOff
devices: Light A - Living Room
on: true
Utilizza più automazioni in uno script: * Alle 18:00, accendi la luce. * Alle 23:00, spegni la TV e trasmetti "è ora di andare a letto"
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