# How to integrate the Smart Building Kit with Actility on akenza

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2Faq6YEMNmBYR61QLojcmm%2Fimage.png?alt=media&#x26;token=62317008-8ea9-4454-960c-643f188bab00" alt=""><figcaption><p> Smart Building Kit from Milesight</p></figcaption></figure>

{% hint style="success" %}
**The Smart Building Kit contains**:

* 1x IAQ Sensor AM103
* 1x Smart IoT Controller UC300
* 1x Smart Button WS101
* 1x Magnetic Contact Switch WS301
* 1x Spot Leak Detection Sensor EM300-SLD
* 1x LoRaWAN Gateway UG65

**Application examples**:

* Monitor and visualize when to air a room (AM103)
* Prevent the buildup of mold in infrequently used rooms (AM103)
* Circumvent damage from prolonged water exposure (EM300-SLD)

\
**Product Features**:

* Screen and traffic light indicator (AM103)
* Industrial-grade enclosure with IP67 (EM300-SLD only)
* Multiple Press Actions (WS101 only)

**You can buy the Milesight Smart Building Kit in the** [**ThingPark marketplace**](https://market.thingpark.com/milesight-smart-building-kit.html) **of Actility.**
{% endhint %}

In this tutorial, you will learn how to connect the **Milesight Smart Building Kit** to akenza. You will achieve the following:

1. Integrating your Actility account to your akenza environment
2. Creating Data Flows and Milesight devices on akenza
3. Creating your individual dashboard for data visualization

### 1. Getting started

To get started with akenza, follow [these steps](https://docs.akenza.io/how-to-create-a-working-environment) in order to set up your environment.

### 2. Add an Actility Integration on akenza

{% hint style="info" %}
In order to proceed with the Actility integration on akenza, make sure to create a [ThingPark community account](https://community.thingpark.org/index.php/sign-up-tpcp/) and pre-commission the Milesight gateway to it as described [here](https://docs.thingpark.com/thingpark-enterprise/7.2/Content/BS-installation-guides/Provision-base-station.htm?tocpath=Using%20ThingPark%20Enterprise%7CManaging%20your%20radio%20access%20network%7CProvisioning%20the%20base%20station%20on%20ThingPark%20GUI%7C_____0). Follow this [link](https://docs.thingpark.com/thingpark-enterprise/7.2/Content/BS-installation-guides/Install-ThingPark-image.htm?tocpath=Using%20ThingPark%20Enterprise%7CManaging%20your%20radio%20access%20network%7CInstalling%20the%20ThingPark%20image%20on%20your%20base%20station%7C_____0) if you need to install Actility's firmware on the gateway.
{% endhint %}

The integration of Actility will be used to **connect**, **synchronize** and **manage** Assets on akenza. Start with the integration of your Actility account by adding your credentials on the Actility tab within *Integrations*. More details about Integrations (for ThingPark Enterprise only) can be found [here](https://www.actility.com/enterprise-iot-connectivity-solutions/).&#x20;

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2F5opkFDSIRj0MLJU9Ho7v%2Fscreely-1673515520577.png?alt=media&#x26;token=393bf651-9341-4c7f-88b9-d6ea6cc95a2a" alt=""><figcaption><p>Connectivity Integration Setup</p></figcaption></figure>

If you use the community instance of ThingPark, the required Profile ID is ***community-api***. To find the Profile ID please check out the Actility API documentation of your account. See the example [here](https://community.thingpark.io/thingpark/dx/core/latest/swagger-ui/index.html?shortUrl=tpdx-core-tpe-api-contract.yaml).

After successful integration, the Actility-account-integration gets displayed on the Connectivity Integration Overview.

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FHxRDECrCyXghq2CHBVm0%2Fscreely-1673515615885.png?alt=media&#x26;token=dd25c967-0595-40b6-a14a-27082d3f5773" alt=""><figcaption><p>Connectivity Integration of Actility</p></figcaption></figure>

### 3. Create Dataflow

As a next step, go to *Data Flows* in your Workspace and choose as device connector *LoRa* and consequently, the Actility integration you have done in step 2. For data parsing continue with the selection in *Device Types* of your specific Milesight device. As an output connector, select the *akenza database*. This will store the data on akenza and allows further use on the dashboard composer. More about Data Flows can be checked [here](https://docs.akenza.io/akenza.io/get-started/your-data-flow).

{% hint style="info" %}
Data Flows consist of a **device connector**, a **device type,** and an **output connector** and define how device data are processed on akenza.
{% endhint %}

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2F58wkrQWVouuvwQeP0dGZ%2Fscreely-1670513604243.png?alt=media&#x26;token=87e5a7c2-1d97-4162-97aa-7422ff0f90a6" alt=""><figcaption><p>Create Data Flow</p></figcaption></figure>

Once all specific Data Flows are created for your devices, continue with the creation of your devices.

### 4. Create Assets

To add a device to your environment, select *+Create Device* in the tab of *Assets* and fill in the required device parameters. By assigning the appropriate Data Flow, your device will be automatically registered and connected to your Actility account.&#x20;

Upon a join request, the device will turn online. Incoming data are displayed in *Message Logs* and also on the *Data Overview* of your device detail page.

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2F2peyXz6CvIYLena5n5Hf%2Fscreely-1669828565586.png?alt=media&#x26;token=2b5ca127-b251-48c6-88ac-e16211ad6bc5" alt=""><figcaption><p>Device Detail Page of AM103</p></figcaption></figure>

{% hint style="warning" %}
Currently, all devices are created with a **generic LoRa device profile**. Do not do any changes on the Actility account.
{% endhint %}

### 5. Visualize IoT data with akenza's dashboard composer

In order to visualize your data with the dashboard composer, switch to the dashboard composer by selecting *Dashboard* in the side navigation. You will get redirected to the dashboard overview. Select *Create a Dashboard* and start adding the Widgets of your choice.

By adding the component *Chart*, the Source Tab allows to select the device of your choice and its data points. Customize the dashboard to your liking.

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FllFJHbYFGex6kZPDmaS2%2Fscreely-1670495533556.png?alt=media&#x26;token=f4c5ab32-44af-4803-91c3-c4e93778fbe9" alt=""><figcaption><p>Add Chart component</p></figcaption></figure>

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FTglZvxt44ROULJE7DKbj%2Fscreely-1674225516938.png?alt=media&#x26;token=8dc2fdeb-51a5-458c-bc20-5c3b0824f7a5" alt=""><figcaption><p>Fullscreen view of an example dashboard</p></figcaption></figure>

{% hint style="info" %}
**Optional**

Try out other akenza features such as the rule engine. The rule engine allows you to apply a business logic to your infrastructure. E.g. inform your teammates about certain conditions by using MS-Teams as notification service. Check out more [here](https://docs.akenza.io/akenza.io/tutorials/create-notifications/how-to-send-notifications-to-microsoft-teams).
{% endhint %}

{% hint style="success" %}
**Support**

Reach out to us if you need any further support:

* [Actility](https://support.thingpark.org/portal/en/community/recent)
* [Akenza](https://akenza.atlassian.net/servicedesk/customer/portal/4/group/-1)
* Milesight
  * <iot.support@milesight.com>
  * [Technical Support Guidance](https://support.milesight-iot.com/support/solutions/articles/73000514218-milesight-iot-technical-support-guidance)
    {% endhint %}
