# Zevvy

### Overview

This guide provides instructions for configuring, installing, and using the Zevvy app to manage resources and synchronize data between BuildingPro Suites and Zevvy services.

### Installation

Install the Zevvy app via the BuildingPro Suites App Store.

### Configuration

The Zevvy app requires configuration via the BuildingPro Suites settings interface. The general steps and details required to effectively configure the app are listed below.

#### Registering the App with the Zevvy Service

Create credentials in the Zevvy service to connect the Zevvy services from BuildingPro Suites. All required credentials are listed below in the configuration section.

Log in to the Zevvy console and go to the settings page. Create a new client ID and secret.

#### Configuring the Zevvy App

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

| Attribute         | Description                                            |
| ----------------- | ------------------------------------------------------ |
| `authRootUrl`     | Root URL for the authentication process.               |
| `apiRootUrl`      | Root URL for API access.                               |
| `clientId`        | Client ID created in the Zevvy console for API access. |
| `clientSecret`    | Secret created in the Zevvy console for API access.    |
| `enable`          | Flag to enable or disable this configuration.          |
| `refreshInterval` | Interval in seconds for data synchronization.          |
| `requestTimeout`  | Timeout for API queries in seconds.                    |

Example configuration JSON:

```json
{
  "authRootUrl": "[https://iam.zevvy.org/realms/zevvy-prod](https://iam.zevvy.org/realms/zevvy-prod)",
  "apiRootUrl": "[https://api.zevvy.org](https://api.zevvy.org)",
  "clientId": "123abc",
  "clientSecret": "s3cr3t",
  "enable": true,
  "refreshInterval": 60,
  "requestTimeout": 120
}
```

After the basic technical configuration of the app is complete, the app requires further information about which metrics should be reported to Zevvy. For this, it is necessary to configure the assets and the corresponding measurement attribute.

This can be done with the corresponding endpoint and the POST method. Each asset definition requires the following data:

| Attribute           | Description                                                                                                             |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `configId`          | The measurement is sent with this configuration.                                                                        |
| `assetId`           | The measurement is taken from this asset.                                                                               |
| `subtype`           | Measurement data has this subtype.                                                                                      |
| `attributeName`     | Name of the measurement attribute.                                                                                      |
| `deviceReference`   | Name of the device reference for the measurement in Zevvy. (Optional, default device reference is the GAI of the asset) |
| `registerReference` | Name of the register reference for the measurement in Zevvy. (Optional, register reference is the attribute name)       |

Example JSON to configure a measurement data record for Zevvy

```json
{
  "configId": 1,
  "assetId": 4711,
  "subtype": "input",
  "attributeName": "power"
}
```

### Zevvy

Once the configuration is complete, the app begins to regularly send measurements from the configured assets and attributes to Zevvy.
