# Element-IoT

## **Connecting Element-IoT to the MClimate LoRaWAN Broker**

### 1. In the Element-IoT Platform go to the Automation -> Streams section and create a new Stream

Provide a name, for example "MClimate"

Select the "Source type" from the drop down menu, it should be "**Devices in folder including children".** This will include all the devices in the folder.

Select the appropriate folder for your device set.

Save.

<figure><img src="/files/GhGfnht6B8XoE7ypok30" alt=""><figcaption><p>Stream creation</p></figcaption></figure>

### 2. Generating the M-token and API key

In order for the integration to work properly an authentication method is required which utilized an M-tone (from the Enterprise platform) and an API key (from Element-IoT). we need to generate a set to later use for the Rule engine.

Go to <https://enterprise.mclimate.eu/integrations>

Create a new token, give it a name and copy it from the next window. Make sure to keep it someplace safe, you won't be allowed to copy it over again, rather create a new one.

<figure><img src="/files/sqRkAqnGrDY2Bn7fGUNg" alt=""><figcaption><p>M-token creation</p></figcaption></figure>

In Element-IoT go to Settings -> API Keys. Add a new API Key with the following configuration options and give it a name.

**Authentication method** - API Key

**Role** - Admin

<figure><img src="/files/oh55RDz8yS4yqViOIe5I" alt=""><figcaption><p>API Key creation</p></figcaption></figure>

### 3. Next you need to create a "Rule" to associate to the Stream to properly route the data. Go to the Automation > Rules section and create a new one

Give it a name, for example "MClimate HTTP".

**Execute action** - immediately.

**Event source** - select the previously created stream "MClimate" for the Even stream and for the Even select "Packet added".

**Condition** - click on the field to manually type the condition for the filter and enter "true".

Leave the Execute once" option un-checked.

**Action** - select the "Send HTTP request" option from the drop-down menu.

**HTTP Method** - select "POST"

**URL** - past the MClimate broker url here: <https://lorawan-broker.mclimate.eu/element-iot>

**HTTP Headers** - there are two custom headers here, the value of which would be specific for your integration. You need to enter the following text in the field:

*m-token:{your M-token created in Enterprise in point 2)*

*api-key:{your API Key created in Element-IoT in point 2)*

Refer to the image below for example values (yours will differ)

<figure><img src="/files/pepghHCoaVBt7BIi2XTc" alt=""><figcaption><p>HTTP Header creation</p></figcaption></figure>

Select all the check boxes available.

<figure><img src="/files/kwCTaHFPYxnnKObesFO8" alt=""><figcaption><p>JSON options selection</p></figcaption></figure>

Save and you are done.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mclimate.eu/mclimate-lorawan-devices/integrations/element-iot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
