# Automation and Scene

CUBE OS allows you to create **two types of automations** with your connected devices:

* **Manual Scenes** - triggered manually by the user.
* **Smart Scenes** - triggered automatically based on conditions or device states.

Both types are created in the same interface, but differ in how they are **activated**.&#x20;

{% hint style="success" %}
All automations in CUBE OS run and are **stored locally**, ensuring fast, private, and reliable device interactions without relying on the cloud.
{% endhint %}

## 1. Manual Scenes

A **Manual Scene** is triggered directly by you - not by sensors, buttons, or schedules.\
It’s ideal for actions you want to activate on demand, like turning on a set of lights or running a "movie mode".

### Example: Turn On a Wi-Fi Lamp and Set Its Color to Blue

{% stepper %}
{% step %}
Go to **Scene** and click the **"+"** button to create a new scene.

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

{% step %}
Under **IF**, select **Tap to Run**.

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

{% step %}
Under **THEN**, choose **Smart Devices → Wi-Fi Lamp**.
{% endstep %}

{% step %}
In the lamp options, set:

**Switch** → On; **Color** → Blue

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

{% step %}
Save the scene.

Now, whenever you manually run this scene, your lamp will turn on and change to blue.
{% endstep %}
{% endstepper %}

## 2. Smart Scenes

A **Smart Scene** runs automatically when certain conditions are met, for example, when a motion sensor is triggered or a temperature threshold is reached.

### Example: Turn On the Lamp When R5  Button is Pressed

{% stepper %}
{% step %}
Go to **Scene → Add Scene**.
{% endstep %}

{% step %}
Under **IF**, select **Smart Device → SONOFF R5 Button → Click**.

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

{% step %}
Under **THEN**, select **Smart Devices → Wi-Fi Lamp → Switch On → Set Color Blue**.

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

{% step %}
Save the scene.

Now, pressing the Zigbee button will automatically turn on your lamp.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
You can combine multiple IF and THEN conditions to create complex automations - for example, adding a time condition (Only at night) to the same scene.
{% endhint %}

## 3. View Automation History

CUBE OS records when each automation was executed.\
To check automation history:

{% stepper %}
{% step %}
Open the automation you want to review.

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

{% step %}
Click the **History** icon.
{% endstep %}

{% step %}
Use the **filter** to view events by time or condition.
{% endstep %}
{% endstepper %}

This helps you monitor whether automations are working as expected.
