> For the complete documentation index, see [llms.txt](https://wiki.inels.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.inels.com/inels-harmony/administration/step-8-automations.md).

# Step 8 · Automations

IF / THEN rules that make the hotel act by itself.

Automations are the rules that make the building behave without anyone touching a screen: a guest presses a button and reception gets an alert; a booking is checked out and the heating drops.

Every rule reads as one sentence — **IF** something is true, **THEN** do something.

Go to **Automations** and click **Add automation**.

## How the builder works

The dialog has two columns: **IF** on the left, **Then** on the right. You add cards to each. **All** the IF cards must be satisfied for the THEN cards to run.

{% tabs %}
{% tab title="What IF can watch" %}

| Type           | Watches for                       | You choose                                                                        |
| -------------- | --------------------------------- | --------------------------------------------------------------------------------- |
| **Device**     | A device changing state           | Gateway, device type, device, and the value to match                              |
| **Room event** | A booking's status changing       | Room number, and one of Free, Offered, Booked, Confirmed, Checked in, Checked out |
| **Valid card** | A guest card accepted at a reader | Which reader                                                                      |
| **Schedule**   | A moment in time                  | A date and a time                                                                 |
| {% endtab %}   |                                   |                                                                                   |

{% tab title="What THEN can do" %}

| Type          | Does                              | You choose                                                             |
| ------------- | --------------------------------- | ---------------------------------------------------------------------- |
| **Device**    | Switches or sets a device         | Gateway, device, and the value to write                                |
| **Message**   | Raises a notification on the bell | The event, the message text, and whether it repeats until acknowledged |
| **Email**     | Sends an email                    | Recipient, subject, body or a saved template                           |
| {% endtab %}  |                                   |                                                                        |
| {% endtabs %} |                                   |                                                                        |

Name the rule at the top, then **Save**. Rules can be switched off from the table without deleting them.

## The six rules almost every hotel needs

Written here for room 203 — repeat per room.

<details>

<summary>1 · Make Up Room raises an alert</summary>

**IF** Device → `203 MUR button` is on **THEN** Message → `MUR room 203`

This is the rule that feeds the housekeeping board: Harmony reads the room number out of the message and creates a cleaning task automatically. **Keep the room number in the text.**

</details>

<details>

<summary>2 · Do Not Disturb</summary>

**IF** Device → `203 DND button` is on **THEN** Message → `DND room 203`

Reception and housekeeping both see it, so nobody knocks.

</details>

<details>

<summary>3 · Butler call</summary>

**IF** Device → `203 Butler button` is on **THEN** Message → `Butler room 203`, set to repeat until acknowledged

</details>

<details>

<summary>4 · Save energy after check-out</summary>

**IF** Room event → room 203, Checked out **THEN** Device → `203 temp set` = 18, and `203 light ceiling` off

</details>

<details>

<summary>5 · Warm the room for an arrival</summary>

**IF** Room event → room 203, Checked in **THEN** Device → `203 temp set` = 21

</details>

<details>

<summary>6 · Welcome lighting on first entry</summary>

**IF** Valid card → the reader at room 203's door **THEN** Device → `203 light entry` on

</details>

## Writing rules for fifty rooms

Rules are per room, so a 50-room hotel with six rules each is 300 automations. Make that manageable:

{% stepper %}
{% step %}

#### Perfect one room first

Build all six rules for one room and test each by physically pressing the button.
{% endstep %}

{% step %}

#### Name them by pattern

`203 MUR alert`, `203 checkout eco`. The list then stays searchable by room *and* by purpose.
{% endstep %}

{% step %}

#### Then replicate

Room by room, changing only the room number and the device names.
{% endstep %}

{% step %}

#### Spot-check the last one and one from the middle

Copy-paste mistakes cluster.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**Test as you go — press the real button, watch the real alert.** An automation that looks right in the list and does nothing in the building is the most expensive kind of mistake to find later.
{% endhint %}

## Things that catch people out

{% hint style="warning" %}

* **Several IF cards mean AND, not OR.** Every condition must hold. For an either/or, write two rules.
* **Leaving the room number out of a message** breaks automatic housekeeping tasks. Write `MUR room 203`, not `MUR`.
* **Rules that fight each other.** If one sets 18 °C at check-out and another sets 21 °C on a schedule, the last one to fire wins. Decide which rule owns the setpoint.
* **Disabled is not deleted.** If a rule seems dead, check its status in the table before rebuilding it.
  {% endhint %}
