# CSV Import

## Information

With Datacake, you can easily import LoRaWAN devices through a .CSV file. Just drag and drop the file into the designated upload area outlined in step 3, labeled "Device".

<figure><img src="/files/bhNe45lz0UeVVqwAfM8f" alt=""><figcaption><p>Step 3 - Add Devices manually or via CSV-File</p></figcaption></figure>

## Structure

To ensure proper formatting, the .CSV file must adhere to the following row structure.

`DevEUI;Device Name;Device Location description;Tag 1,Tag 2,Tag 3`

If you only wish to share the DevEUI and Device Name, it's not necessary to include the Device Location and Tags.

`DevEUI;Device Name;;Tag 1,Tag 2,Tag 3`

`DevEUI;Device Name;Device Location;`

`DevEUI;Device Name;;`

### File Example

Please ensure that your .CSV file is structured exactly the same as the provided example.

```csv
123456789abcdef1;Device 1;Room 101;Temperature,Humidity,Pressure
aabbccddeeff1122;Device 2;Room 202;Light,Occupancy,Safety
f0e1d2c3b4a59687;Device 3;Room 303;CO2,Smoke,Fire
0123456789abcdef;Device 4;Room 404;Noise,Vibration,Shock
fedcba9876543210;Device 5;Room 505;Water,Level,Flow
```

{% hint style="danger" %}
Avoid using a header on the first line of the CSV. This can cause confusion for the importer.
{% endhint %}

#### Template File

{% file src="/files/aBtt171jVWaFXuwMMfGB" %}
Example CSV-File as Template
{% endfile %}

### Tags

To attach tags to your devices, simply include them in the 4th column of the CSV file.

```
123456789abcdef1;Device 1;Room 101;Temperature
```

{% hint style="danger" %}
Please remember to separate multiple tags with a comma.
{% endhint %}

```
123456789abcdef1;Device 1;Room 101;Temperature,Humidity,Pressure
```

## Datacake LNS

You can also batch import devices to the Datacake LNS. For that you will have to drag and drop a file with the following structure:

`DevEUI;Device Name; AppEUI(or JoinEUI); AppKey/NWKKEY; Frequency; Device Class; Location description;Tag 1,Tag 2,Tag 3`

{% hint style="info" %}
Make sure that your CSV file doesn't have a header with the titles (it should simply start with the first device). Otherwise the platform will return an Error message.
{% endhint %}

If you want, you don't need to include the Device Location and/or Tags. The structure is then the following:

`DevEUI;Device Name; AppEUI(or JoinEUI); AppKey/NWKKEY; Frequency; Device Class;;Tag 1,Tag 2,Tag 3`

`DevEUI;Device Name; AppEUI(or JoinEUI); AppKey/NWKKEY; Frequency; Device Class; Location description;`

`DevEUI;Device Name; AppEUI(or JoinEUI); AppKey/NWKKEY; Frequency; Device Class;;`

We currently support the following frequencies:

* `EU_863_870_TTN`
* `US_902_928_FSB_2`

And the devices classes:

* `A`
* `C`

Remember that DevEUI and AppEUI are strings 8 bytes long. AppKey is a 12 byte string. All of them should be provided by your device manufacturer.

```
4954957556556566;Device 1;cd1a75ae5818dcbe;c39ebd8578c3d7ac6dfef73afb60dfba;EU_863_870_TTN;A;Room 101;Temperature,Humidity,Pressure
aabbccddeeff1122;Device 2;cd1a75ae5818dcbe;f171b14be6e3494ce6da3dd8e67cbb8c;EU_863_870_TTN;A;Room 202;Light,Occupancy,Safety
```

Template file for the Datacake LNS auto-importer:

{% file src="/files/03eQIRkA3g4sCxmLJCjZ" %}


---

# 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.datacake.de/lorawan/csv-import.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.
