> For the complete documentation index, see [llms.txt](https://cube.ewelink.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cube.ewelink.cc/english-th/feature-exploration/automation-and-scene.md).

# การทำงานอัตโนมัติและฉาก

เรียนรู้วิธีสร้างการทำงานอัตโนมัติและฉากแบบกำหนดเองใน CUBE OS เพื่อทำให้สมาร์ทโฮมของคุณฉลาดและทำงานได้อัตโนมัติมากขึ้น

CUBE OS ช่วยให้คุณสร้าง **สองประเภทของการทำงานอัตโนมัติ** กับอุปกรณ์ที่เชื่อมต่อของคุณ:

* **ฉากแบบแมนนวล** - เรียกใช้งานด้วยตนเองโดยผู้ใช้
* **ฉากอัจฉริยะ** - เรียกใช้งานโดยอัตโนมัติตามเงื่อนไขหรือสถานะของอุปกรณ์

ทั้งสองประเภทถูกสร้างในอินเทอร์เฟซเดียวกัน แต่แตกต่างกันที่วิธีการ **เปิดใช้งาน**.&#x20;

{% hint style="success" %}
การทำงานอัตโนมัติทั้งหมดใน CUBE OS ทำงานและ **ถูกเก็บไว้ในเครื่อง**, เพื่อให้การโต้ตอบกับอุปกรณ์รวดเร็วเป็นส่วนตัวและเชื่อถือได้โดยไม่ต้องพึ่งพาคลาวด์
{% endhint %}

## 1. ฉากแบบแมนนวล

ฉาก **แบบแมนนวล** จะถูกเรียกใช้งานโดยคุณโดยตรง - ไม่ใช่โดยเซ็นเซอร์ ปุ่ม หรือตารางเวลา\
เหมาะสำหรับการกระทำที่คุณต้องการเปิดใช้งานตามต้องการ เช่น เปิดชุดไฟหรือเรียกใช้งาน "โหมดภาพยนตร์"

### ตัวอย่าง: เปิดโคมไฟ Wi‑Fi และตั้งค่าสีเป็นสีน้ำเงิน

{% stepper %}
{% step %}
ไปที่ **ฉาก** และคลิกปุ่ม **"+"** เพื่อสร้างฉากใหม่

<figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2Fr0zjSUrYatujczsCI6Pa%2Fimage.png?alt=media&amp;token=d62cd65c-6057-4ec3-921b-77ddd1ae14e1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
ภายใต้ **หาก**ให้เลือก **แตะเพื่อเรียกใช้งาน**.

<div align="left"><figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2FqZW6ITEV9mln2zzVpTVz%2Fimage.png?alt=media&amp;token=77eaa56d-8dba-458b-92df-cd587dbec824" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
ภายใต้ **แล้ว**ให้เลือก **อุปกรณ์อัจฉริยะ → โคมไฟ Wi‑Fi**.
{% endstep %}

{% step %}
ในตัวเลือกของโคมไฟ ให้ตั้งค่า:

**สวิตช์** → เปิด; **สี** → สีน้ำเงิน

<div align="left"><figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2FfK8t1jvrUJVEEbDgkoD9%2Fimage.png?alt=media&amp;token=f5439a8d-9eb9-4765-8eeb-1ed7412f43a7" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
บันทึกฉาก

ตอนนี้ เมื่อใดก็ตามที่คุณเรียกใช้ฉากนี้ด้วยตนเอง โคมไฟของคุณจะเปิดและเปลี่ยนเป็นสีน้ำเงิน
{% endstep %}
{% endstepper %}

## 2. ฉากอัจฉริยะ

ฉาก **ฉากอัจฉริยะ** จะทำงานโดยอัตโนมัติเมื่อเงื่อนไขบางอย่างเป็นจริง เช่น เมื่อเซ็นเซอร์ความเคลื่อนไหวถูกกระตุ้น หรือเมื่ออุณหภูมิถึงเกณฑ์ที่กำหนด

### ตัวอย่าง: เปิดโคมไฟเมื่อกดปุ่ม R5

{% stepper %}
{% step %}
ไปที่ **ฉาก → เพิ่มฉาก**.
{% endstep %}

{% step %}
ภายใต้ **หาก**ให้เลือก **อุปกรณ์อัจฉริยะ → ปุ่ม SONOFF R5 → คลิก**.

<figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2FNEP0S4Z8ItYgvqfkWdCH%2Fimage.png?alt=media&amp;token=1b2ee664-ce79-4366-95e1-503a27055de5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
ภายใต้ **แล้ว**ให้เลือก **อุปกรณ์อัจฉริยะ → โคมไฟ Wi‑Fi → เปิดสวิตช์ → ตั้งค่าสีเป็นสีน้ำเงิน**.

<figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2FLos4lF3ofUON0noo1nB3%2Fimage.png?alt=media&amp;token=8fef4abf-138a-468f-89da-d9c216b69825" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
บันทึกฉาก

ตอนนี้ การกดปุ่ม Zigbee จะเปิดโคมไฟของคุณโดยอัตโนมัติ
{% endstep %}
{% endstepper %}

{% hint style="info" %}
คุณสามารถรวมเงื่อนไข IF และ THEN หลายรายการเพื่อสร้างการทำงานอัตโนมัติที่ซับซ้อน — ตัวอย่างเช่น เพิ่มเงื่อนไขเวลา (เฉพาะกลางคืน) ให้กับฉากเดียวกัน
{% endhint %}

## 3. ดูประวัติการทำงานอัตโนมัติ

CUBE OS บันทึกเมื่อการทำงานอัตโนมัติแต่ละครั้งถูกดำเนินการ\
เพื่อดูประวัติการทำงานอัตโนมัติ:

{% stepper %}
{% step %}
เปิดการทำงานอัตโนมัติที่คุณต้องการตรวจสอบ

<div align="left"><figure><img src="https://2689310717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCnF8kmk9yw3yiy2mRerq%2Fuploads%2FOvJaJExhHILvZr0oT7kU%2Fimage.png?alt=media&amp;token=c43b674e-c12c-44bb-abff-4ae59d355da4" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
คลิกไอคอน **ประวัติ** นั้น
{% endstep %}

{% step %}
ใช้ **ตัวกรอง** เพื่อดูเหตุการณ์ตามเวลา หรือเงื่อนไข
{% endstep %}
{% endstepper %}

สิ่งนี้ช่วยให้คุณตรวจสอบได้ว่าการทำงานอัตโนมัติทำงานตามที่คาดหวังหรือไม่


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cube.ewelink.cc/english-th/feature-exploration/automation-and-scene.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
