# Loriot.io

### Overview

This manual provides instructions on how to configure, install, and use the Loriot.io App to manage resources and synchronize LoRaWAN devices between BuildingPro Suites and Loriot.io services.

### Installation

Install the Loriot.io App via the BuildingPro Suites App Store.

### Configuration

The Loriot.io App requires configuration via the BuildingPro Suites settings. The following are the general steps and details required to effectively configure the app.

#### Registering the App with the Loriot.io Service

Create credentials in the Loriot.io service to establish the connection from BuildingPro Suites to Loriot.io services. All required credentials are listed below in the configuration section.

To connect to the [Loriot.io API](https://docs.loriot.io/space/LNS/6231610/User+API+7.0), you must ask your provider for an API key.

#### Configuring the Loriot.io App

Configurations can be created in BuildingPro Suites under `Apps > Loriot.io > Settings`, which opens the app's [Generic Frontend](https://doc.eliona.io/collection/v/eliona-english/manuals/settings/apps). Here you can use the `/configs` endpoint with the POST method. Each configuration requires the following data:

| Attribute         | Description                                                |
| ----------------- | ---------------------------------------------------------- |
| `apiBaseUrl`      | URL of the Loriot.io services.                             |
| `apiToken`        | API token to access the API.                               |
| `enable`          | Flag to activate or deactivate this configuration.         |
| `refreshInterval` | Interval in seconds for data synchronization.              |
| `requestTimeout`  | API query timeout in seconds.                              |
| `tenantIDs`       | List of BuildingPro Suites Tenant IDs for data collection. |

Example configuration in JSON:

```json
{
  "apiBaseUrl": "http://service/v1",
  "apiToken": "53cr3t",
  "enable": true,
  "refreshInterval": 60,
  "requestTimeout": 120,
  "tenantIDs": [
    "10"
  ]
}
```

To define devices managed by the Loriot.io App, it is necessary to configure these devices. Here you can use the `/devices` endpoint with the POST method. If the device does not yet exist, it is also registered in Loriot.io.

Example for device configuration via OTAA v1.0 in JSON:

```json
{
    "devEUI": "0123456789ABCDEF",
    "appID": "1234ABCD",
    "assetTypeName": "Device",
    "configID": 1,
    "title": "LoRaWAN Testgerät",
    "description": "Dies ist ein LoRaWAN Testgerät",
    "appEUI": "1000000000000000",
    "appKey": "geheim"
}
```

### Continuous Asset Creation

Once the configuration and device setup are complete, the app starts Continuous Asset Creation (CAC). Discovered resources are automatically created as assets in BuildingPro Suites, and users are notified via the BuildingPro Suites notification system.

### Additional Functions

#### Device Updates

You can change the title and description of a device asset in BuildingPro Suites. These changes are automatically synchronized in Loriot.io. If you delete an asset in BuildingPro Suites, the corresponding device is also unregistered in Loriot.io.
