الأتمتة

الوصف

توفّر Automation Struct جميع سلوكيات التشغيل الآلي. وقد تحتوي على عدة عمليات تشغيل آلي فرعية تعمل معًا.

الحقول

المفتاح النوع الوصف
name String

اسم داخلي لعملية التشغيل الآلي هذه ليرجع إليه المطوّرون.

اختياري

starters [Starter]

إجراءات تفعيل التشغيل الآلي

مطلوب

condition الشرط

الشرط العام المطلوب تطبيقه

اختياري

actions [Action]

إجراءات التشغيل الآلي

مطلوب

أمثلة

استخدام قاعدة تشغيل آلي واحدة: في الساعة 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