> 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 ช่วยให้คุณสร้าง **สองประเภทของการทำงานอัตโนมัติ** กับอุปกรณ์ที่เชื่อมต่อของคุณ:

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

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

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

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

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

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

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

<figure><img src="/files/5f166721f831ab3c9da860cae826f25f92566f37" alt=""><figcaption></figcaption></figure>
{% endstep %}

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

<div align="left"><figure><img src="/files/8333cfdbab6ad44411397342cb2ad1093fcca048" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

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

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

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

<div align="left"><figure><img src="/files/03f1270d1010b8e3570fc84b583242203c23d94d" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

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

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

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

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

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

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

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

<figure><img src="/files/d3cc9611dda9b1c33ec99169fe0967841b86ab5e" alt=""><figcaption></figcaption></figure>
{% endstep %}

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

<figure><img src="/files/19261efa57a097ab7a973b32210133f2038aaf21" 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="/files/afacc877db942e2a90077543c87c643c55377ae8" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
