# myStrom App

> The Smart WiFi Switch turns connected devices on and off, saves energy, and protects your home. Developed in Switzerland.

This application provides direct access to the myStrom Smart Switches via BuildingPro Suites. It allows users to check the current status of the switches, view statistics, manage the Smart Switches, and, most importantly, connect myStrom devices with systems from various other brands.

#### Installation

The myStrom App is installed via the App Store in BuildingPro Suites.

#### Assets

The myStrom App automatically creates all necessary asset types and assets.

#### Structure assets

The asset types `myStrom Root` and `myStrom Room` are created only to create a structure in BuildingPro Suites.

#### Devices

* *Switch*: A WiFi Switch.

| Attribute    | Description  | Subtype |
| ------------ | ------------ | ------- |
| `Power`      | Energy       | Input   |
| `Temp`       | Temperature  | Input   |
| `RelayState` | Relay status | Input   |
| `Relay`      | Relay        | Output  |

#### Configuration

{% hint style="info" %}
You can find more information on app configuration [↗ here](https://doc.eliona.io/collection/dokumentation/einstellungen/apps).
{% endhint %}

| Attribute          | Description                                                                                                                                                      |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`           | API key provided by myStrom                                                                                                                                      |
| `enable`           | Flag to activate or deactivate the retrieval from this API                                                                                                       |
| `refreshInterval`  | Interval in seconds for device detection. This is an expensive operation and should not be less than 3600 s                                                      |
| `dataPollInterval` | Frequency of polling for data updates in seconds.                                                                                                                |
| `requestTimeout`   | API query timeout in seconds                                                                                                                                     |
| `assetFilter`      | Filter for asset creation, more details can be found in the app's README                                                                                         |
| `tenantIDs`        | List of BuildingPro Suites tenant IDs for which this device should collect data. For each tenant ID, all assets are automatically created in BuildingPro Suites. |

The configuration is done via a corresponding JSON structure. As an example, the following JSON structure can be used to define an endpoint for app permissions:

```json
{
    "apiKey": "api.key",
    "enable": true,
    "refreshInterval": 3600,
    "dataPollInterval": 60,
    "requestTimeout": 120,
    "assetFilter": [],
    "tenantIDs": [
        "10"
    ]
}
```

Configurations can be created with this structure in BuildingPro Suites under `Apps > myStrom > Settings`. To do this, select the endpoint /configs with the POST method.

After completing the configuration, the app starts the continuous asset creation. When all recognized devices are created, the user is informed about it via BuildingPro Suites's notification system.
