# ROOMZ

### Overview

This manual contains instructions for installing, configuring, and using the ROOMZ app for data acquisition from ROOMZ sensors.

### Installation

Install the ROOMZ app from the Eliona App Store.

### Configuration

Register the app in ROOMZ and then configure the ROOMZ app via the Eliona settings.

#### Registering the app in the ROOMZ portal

The ROOMZ app uses an experimental [Webhook API](https://github.com/roomz-io/openapi)that is not yet generally available. Contact ROOMZ support to enable data transmission and obtain a webhook secret. The webhook endpoint for your Eliona instance is: `https://{your-eliona-instance}/apps-public/roomz/webhook`.

> Since the webhook endpoint must be accessible over the internet, all incoming data is verified using the ROOMZ signature. For verification, ROOMZ must provide a webhook secret and a public key for signature verification.

#### Configuring the ROOMZ app

Configure the app in Eliona by navigating to `Apps > ROOMZ > Settings` which opens the [Generic Frontend](https://doc.eliona.io/collection/v/eliona-english/manuals/settings/apps) of the app. Use the POST method to set up the configuration. Each configuration requires the following parameters:

| Attribute    | Description                                      |
| ------------ | ------------------------------------------------ |
| `secret`     | Webhook secret provided by ROOMZ.                |
| `enable`     | Flag to enable or disable this configuration.    |
| `projectIDs` | List of Eliona project IDs for data acquisition. |

Example configuration JSON:

```json
{
  "secret": "some-webhook-secret",
  "enable": true,
  "projectIDs": [
    "10"
  ]
}
```

### Continuous asset creation

After configuration, the app listens for data updates from ROOMZ. Every time the occupancy status changes (someone enters or leaves a room), the app receives a message from ROOMZ and writes the data to Eliona.

The app automatically creates all assets for the monitored rooms - When the app receives data from a sensor for the first time, it creates a new asset under the "ROOMZ root" asset. The asset is named after the room ID (the only information provided by the ROOMZ API), but can be renamed and moved by the user.

The user who created or last updated the app configuration is notified about newly created assets.
