# Loriot.io

### Overview

This manual provides instructions for configuring, installing, and using the Loriot.io app to manage resources and synchronize LoRaWAN devices between Eliona and Loriot.io services.

### Installation

Install the Loriot.io app via the Eliona App Store.

### Configuration

The Loriot.io app requires configuration through the Eliona settings. Below are the general steps and details required to configure the app effectively.

#### Registering the app in the Loriot.io service

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

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

#### Configuring the Loriot.io app

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

| Attribute         | Description                                     |
| ----------------- | ----------------------------------------------- |
| `apiBaseUrl`      | URL of the Loriot.io services.                  |
| `apiToken`        | API token for accessing the API.                |
| `enable`          | Flag to enable or disable this configuration.   |
| `refreshInterval` | Interval in seconds for data synchronization.   |
| `requestTimeout`  | API query timeout in seconds.                   |
| `projectIDs`      | List of Eliona project IDs for data collection. |

Example configuration in JSON:

```json
{
  "apiBaseUrl": "http://service/v1",
  "apiToken": "53cr3t",
  "enable": true,
  "refreshInterval": 60,
  "requestTimeout": 120,
  "projectIDs": [
    "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 will also be registered in Loriot.io.

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

```json
{
    "devEUI": "0123456789ABCDEF",
    "appID": "1234ABCD",
    "assetTypeName": "Device",
    "configID": 1,
    "title": "LoRaWAN Test Device",
    "description": "This is a LoRaWAN test device",
    "appEUI": "1000000000000000",
    "appKey": "secret"
}
```

### Continuous asset creation

Once configuration and device setup are complete, the app starts continuous asset creation (CAC). Discovered resources are automatically created as assets in Eliona, and users are notified via Eliona's notification system.

### Additional features

#### Device update

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