# KPN LocationTag II v2

![KPN LocationTag II v2](https://portal.kpnthings.com/assets/images/device-types/kpn-locationtag-ii-v2.png)

Tag for localization and movement monitoring. Revision of KPN LocationTag II. Added functionality NFC and FSK.

* Supported network type(s): `KPNLORA`
* Device Specification ID: `kpn-locationtag-ii-v2`
* Device Specification UUID: `43d4122f-b2ce-486b-9ede-d5463d2a822d`

| Decoders                                         | decoderSpecificationUUID               | Description                                                                                                                                                                                                                 |
| ------------------------------------------------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| + LoRa Geolocation data                          | `19e12863-ad65-4fb7-a812-e6744be290d0` | Add [LoRa Geolocation](/kpn-things/getting-started/tutorials/technical-overview/location-data.md) data to messages where location could be calculated.                                                                      |
| + Location by LoRa On Premises Gateway reception | `fa3928a9-8217-48a1-a3a6-1dcc945b4bb3` | Add location data to messages that are received by known [LoRa On Premise Gateways](/kpn-things/building-blocks/data-processing/decoders-and-encoders.md).                                                                  |
| › Decoded payload for Asset Tracking             | `040627e5-0254-45ca-a0e1-cafab4c8b775` | Decoder for Streamline LoRa short and long payloads containing a.o. NFC field detected flag, sabotaged flag, motion status, and battery voltage. Long payloads also contain a.o. firmware, power up, and transmission time. |
| › Decoded payload for Asset Tracking (v2)        | `1e530f69-1c43-54da-bc77-f3508486c21e` | Decoder for Streamline LoRa short and long payloads containing a.o. NFC field detected flag, sabotaged flag, motion status, and battery voltage. Long payloads also contain a.o. firmware, power up, and transmission time. |
| › Decoded payload for counting rotations         | `10cf0159-822c-4039-a641-59d23cc38f49` | Decoder outputting general information and specific rotation and orientation data                                                                                                                                           |
| › Decoded payload for counting rotations (v2)    | `2aeeaef5-fb56-5b07-9675-58d568dc708f` | Decoder outputting general information and specific rotation and orientation data                                                                                                                                           |

| Encoders                  | encoderSpecificationUUID               | Description                                     |
| ------------------------- | -------------------------------------- | ----------------------------------------------- |
| ‹ Encoded device commands | `9935fa32-6915-4fe9-b864-37e9913a97f9` | Set the device mode and enabling of nfc writes. |

### + LoRa Geolocation data

Add [LoRa Geolocation](/kpn-things/getting-started/tutorials/technical-overview/location-data.md) data to messages where location could be calculated.

#### Expected SenML outputs

<table><thead><tr><th width="179.33333333333331">name</th><th width="128">type/unit</th><th width="135">example</th><th>description</th></tr></thead><tbody><tr><td>locOrigin</td><td>string</td><td>KPNLORA</td><td>indicates the origin of the location data</td></tr><tr><td>latitude</td><td>numeric</td><td>51.79</td><td></td></tr><tr><td>longitude</td><td>numeric</td><td>4.68</td><td></td></tr><tr><td>radius</td><td>m</td><td>319</td><td></td></tr><tr><td>locAccuracy</td><td>%</td><td></td><td></td></tr><tr><td>locPrecision</td><td>%</td><td></td><td></td></tr><tr><td>locTime</td><td>timestamp</td><td>1637165561</td><td></td></tr></tbody></table>

#### Example SenML-message

This location info can be merged with the payload of the device

```
[
  {
    "bn": "urn:dev:DEVEUI:A41163C212345678:",
    "bt": 1637165561
  },
  {
    "n": "locOrigin",
    "vs": "KPNLORA"
  },
  {
    "n": "latitude",
    "u": "lat",
    "v": 51.794884
  },
  {
    "n": "longitude",
    "u": "lon",
    "v": 4.687986
  },
  {
    "n": "radius",
    "u": "m",
    "v": 319.730194
  },
  {
    "n": "locAccuracy",
    "u": "%",
    "v": 9999
  },
  {
    "n": "locPrecision",
    "u": "%",
    "v": 9999
  },
  {
    "n": "locTime",
    "vs": "1637165561192"
  }
]
```

### + Location by LoRa On Premises Gateway reception

Add location data to messages that are received by known [LoRa On Premise Gateways](/kpn-things/building-blocks/data-processing/decoders-and-encoders.md).

#### Expected SenML outputs

See above. Output is comparable to LoRa Geolocation data.

### › Decoded payload for Asset Tracking

Decoder for Streamline LoRa short and long payloads containing a.o. NFC field detected flag, sabotaged flag, motion status, and battery voltage. Long payloads also contain a.o. firmware, power up, and transmission time.

#### Expected SenML outputs

<table><thead><tr><th width="223.33333333333331">name</th><th width="128">type/unit</th><th width="132">example</th><th>description</th></tr></thead><tbody><tr><td>nfcFieldDetected</td><td>boolean</td><td>false</td><td></td></tr><tr><td>acceleratorActive</td><td>boolean</td><td>true</td><td></td></tr><tr><td>sabotaged</td><td>boolean</td><td>false</td><td></td></tr><tr><td>movementIndication</td><td>string</td><td>STATIONARY</td><td>indicates the devices movement status (STOP, STATIONARY, START, MOVING)</td></tr><tr><td>alarmMode</td><td>boolean</td><td>false</td><td></td></tr><tr><td>batteryVoltage</td><td>V</td><td>3.5</td><td></td></tr><tr><td>motionTime</td><td>min</td><td>2</td><td></td></tr><tr><td>temperature</td><td>Cel</td><td>21.0</td><td></td></tr><tr><td>firmwareVersion</td><td></td><td></td><td>only sent in long payload messages</td></tr><tr><td>firmwareCRC</td><td></td><td></td><td>only sent in long payload messages</td></tr><tr><td>settingsCRC</td><td></td><td></td><td>only sent in long payload messages</td></tr><tr><td>nfcState</td><td></td><td></td><td><p>only sent in long payload messages</p><p></p><p>RESERVED, NFC_READ_ONLY, NFC_OFF, NFC_RW</p></td></tr><tr><td>powerupTime</td><td>min</td><td></td><td>only sent in long payload messages</td></tr><tr><td>transmissionTime</td><td>s</td><td></td><td>only sent in long payload messages</td></tr><tr><td>nrOfLoraTransmissions</td><td></td><td></td><td>only sent in long payload messages</td></tr><tr><td>timeOrigin</td><td>string</td><td>NETWORK</td><td>indicates the origin of the timestamp</td></tr></tbody></table>

#### Example SenML message

```
[
	{
		"bn": "urn:dev:DEVEUI:7CC6C43012345678:",
		"bt": 1678778476
	},
	{
		"n": "nfcFieldDetected",
		"vb": false
	},
	{
		"n": "acceleratorActive",
		"vb": true
	},
	{
		"n": "sabotaged",
		"vb": false
	},
	{
		"n": "movementIndication",
		"vs": "STATIONARY"
	},
	{
		"n": "alarmMode",
		"vb": false
	},
	{
		"n": "batteryVoltage",
		"u": "V",
		"v": 2.96
	},
	{
		"n": "motionTime",
		"u": "min",
		"v": 39981.0
	},
	{
		"n": "temperature",
		"u": "Cel",
		"v": 15.0
	},
	{
		"n": "timeOrigin",
		"u": "enum",
		"vs": "NETWORK"
	}
]
```

### › Decoded payload for Asset Tracking (v2)

Decoder for Streamline LoRa short and long payloads containing a.o. NFC field detected flag, sabotaged flag, motion status, and battery voltage. Long payloads also contain a.o. firmware, power up, and transmission time.

{% hint style="info" %}
This decoder also decodes [Geolocation and Local Gateway](/kpn-things/getting-started/tutorials/technical-overview/location-data.md) data.
{% endhint %}

The following SenML records can be present, amongst others:

| name                  | type    | unit | example      | description                                                                                            |
| --------------------- | ------- | ---- | ------------ | ------------------------------------------------------------------------------------------------------ |
| acceleratorActive     | boolean |      | `true`       |                                                                                                        |
| alarmMode             | boolean |      | `true`       |                                                                                                        |
| batteryVoltage        | number  | V    | `3.56`       |                                                                                                        |
| firmwareCRC           | string  |      | `"9e17"`     | Only sent in long payload messages                                                                     |
| firmwareVersion       | string  |      | `"0604"`     | Only sent in long payload messages                                                                     |
| motionTime            | number  | min  | `142271.0`   |                                                                                                        |
| movementIndication    | string  |      | `"STOP"`     | Indicates the devices movement status. Either `"STOP`, `"STATIONARY"`, `"START"` or `"MOVING"`         |
| nfcFieldDetected      | boolean |      | `true`       |                                                                                                        |
| nfcState              | string  |      | `"RESERVED"` | Only sent in long payload messages. Either `"RESERVED"`, `"NFC_READ_ONLY"`, `"NFC_OFF"`, or `"NFC_RW"` |
| nrOfLoraTransmissions | number  |      | `7427.0`     | Only sent in long payload messages                                                                     |
| powerupTime           | number  | min  | `1334707`    | Only sent in long payload messages                                                                     |
| sabotaged             | boolean |      | `true`       |                                                                                                        |
| settingsCRC           | string  |      | `"a3e5"`     | Only sent in long payload messages                                                                     |
| temperature           | number  | Cel  | `23.432`     |                                                                                                        |
| transmissionTime      | number  | s    | `5180`       | Only sent in long payload messages                                                                     |

#### Example SenML

{% hint style="info" %}
SenML can be structured in different ways, and we do not guarantee the examples below will look the same as what you will receive on your Destination. To make sure you can handle the SenML optimally, take a look at our documentation about [Understanding and Interpreting SenML Data](/kpn-things/building-blocks/data-processing/thingsml-and-senml/senml/understanding-and-interpreting-senml-data.md).
{% endhint %}

**Short payload**

```json
[
    {
        "bn": "urn:dev:DEVEUI:0123456789012345:",
        "bt": 1693136532.83,
        "n": "nfcFieldDetected",
        "vb": false
    },
    {
        "n": "acceleratorActive",
        "vb": true
    },
    {
        "n": "sabotaged",
        "vb": true
    },
    {
        "n": "movementIndication",
        "vs": "START"
    },
    {
        "n": "alarmMode",
        "vb": true
    },
    {
        "n": "batteryVoltage",
        "u": "V",
        "v": 2.96
    },
    {
        "n": "motionTime",
        "u": "min",
        "v": 22756
    },
    {
        "n": "temperature",
        "u": "Cel",
        "v": -8
    },
    {
        "n": "timeOrigin",
        "vs": "NETWORK"
    }
]
```

**Long payload**

```json
[
    {
        "bn": "urn:dev:DEVEUI:0123456789012345:",
        "bt": 1693136532.83,
        "n": "nfcFieldDetected",
        "vb": false
    },
    {
        "n": "acceleratorActive",
        "vb": true
    },
    {
        "n": "sabotaged",
        "vb": false
    },
    {
        "n": "movementIndication",
        "vs": "STATIONARY"
    },
    {
        "n": "alarmMode",
        "vb": false
    },
    {
        "n": "batteryVoltage",
        "u": "V",
        "v": 3.01
    },
    {
        "n": "temperature",
        "u": "Cel",
        "v": 1
    },
    {
        "n": "firmwareVersion",
        "vs": "06a9"
    },
    {
        "n": "firmwareCRC",
        "vs": "ac01"
    },
    {
        "n": "settingsCRC",
        "vs": "ec36"
    },
    {
        "n": "nfcState",
        "vs": "NFC_READ_ONLY"
    },
    {
        "n": "motionTime",
        "u": "min",
        "v": 18418
    },
    {
        "n": "powerupTime",
        "u": "min",
        "v": 1156219
    },
    {
        "n": "transmissionTime",
        "u": "s",
        "v": 4142
    },
    {
        "n": "nrOfLoraTransmissions",
        "v": 3255
    },
    {
        "n": "timeOrigin",
        "vs": "NETWORK"
    }
]
```

### › Decoded payload for counting rotations

Decoder outputting general information and specific rotation and orientation data

**Expected SenML records**

| name                  | type    | unit |
| --------------------- | ------- | ---- |
| acceleratorActive     | boolean |      |
| alarmMode             | boolean |      |
| batteryVoltage        | number  | V    |
| firmwareCRC           | string  |      |
| firmwareVersion       | string  |      |
| movementIndication    | string  | enum |
| nfcFieldDetected      | boolean | enum |
| nfcState              | string  | enum |
| nrOfLoraTransmissions | number  |      |
| orientationX          | number  |      |
| orientationY          | number  |      |
| powerupTime           | number  | min  |
| rotationCount         | number  |      |
| rotationLeft          | number  |      |
| rotationRight         | number  |      |
| sabotaged             | boolean |      |
| settingsCRC           | string  |      |
| temperature           | number  | Cel  |
| transmissionTime      | number  | s    |

### › Decoded payload for counting rotations (v2)

Decoder outputting general information and specific rotation and orientation data

Fixes from '› Decoded payload for counting rotations':

* For the field `nfcState`, the values`"NFC_READ_ONLY"` & `"NFC_OFF"` were swapped.

{% hint style="info" %}
This decoder also decodes [Geolocation and Local Gateway](/kpn-things/getting-started/tutorials/technical-overview/location-data.md) data.
{% endhint %}

The following SenML records can be present, amongst others:

| name                  | type    | unit | example           | description                                                                                               |
| --------------------- | ------- | ---- | ----------------- | --------------------------------------------------------------------------------------------------------- |
| acceleratorActive     | boolean |      | `true`            |                                                                                                           |
| alarmMode             | boolean |      | `false`           |                                                                                                           |
| batteryVoltage        | number  | V    | `3.03`            |                                                                                                           |
| firmwareCRC           | string  |      | `"3407"`          | Not present in detail level 1 messages                                                                    |
| firmwareVersion       | string  |      | `"06b0"`          | Not present in detail level 1 messages                                                                    |
| movementIndication    | string  |      | `"STATIONARY"`    | Indicates the devices movement status. Either `"STOP"`, `"STATIONARY"`, `"START"` or `"MOVING"`           |
| nfcFieldDetected      | boolean |      | `false`           |                                                                                                           |
| nfcState              | string  |      | `"NFC_READ_ONLY"` | Not present in detail level 1 messages. Either `"RESERVED"`, `"NFC_READ_ONLY"`, `"NFC_OFF"` or `"NFC_RW"` |
| nrOfLoraTransmissions | number  |      | `27`              | Not present in detail level 1 messages                                                                    |
| orientationX          | number  |      | `21`              | Only present in detail level 3 messages                                                                   |
| orientationY          | number  |      | `7`               | Only present in detail level 3 messages                                                                   |
| powerupTime           | number  | min  | `184996`          | Not present in detail level 1 messages                                                                    |
| rotationCount         | number  |      | `2`               |                                                                                                           |
| rotationLeft          | number  |      | `1`               | Only present in detail level 3 messages                                                                   |
| rotationRight         | number  |      | `3`               | Only present in detail level 3 messages                                                                   |
| sabotaged             | boolean |      | `false`           |                                                                                                           |
| settingsCRC           | string  |      | `"42b5"`          | Not present in detail level 1 messages                                                                    |
| temperature           | number  | Cel  | `24.3`            |                                                                                                           |
| transmissionTime      | number  | s    | `67`              | Not present in detail level 1 messages                                                                    |

#### Example SenML

{% hint style="info" %}
SenML can be structured in different ways, and we do not guarantee the examples below will look the same as what you will receive on your Destination. To make sure you can handle the SenML optimally, take a look at our documentation about [Understanding and Interpreting SenML Data](/kpn-things/building-blocks/data-processing/thingsml-and-senml/senml/understanding-and-interpreting-senml-data.md).
{% endhint %}

```json
[
    {
        "bn": "urn:dev:DEVEUI:0123456789012345:",
        "bt": 1693136532.83,
        "n": "nfcFieldDetected",
        "vb": false
    },
    {
        "n": "acceleratorActive",
        "vb": true
    },
    {
        "n": "sabotaged",
        "vb": false
    },
    {
        "n": "movementIndication",
        "vs": "STATIONARY"
    },
    {
        "n": "alarmMode",
        "vb": false
    },
    {
        "n": "batteryVoltage",
        "u": "V",
        "v": 3.03
    },
    {
        "n": "rotationCount",
        "v": 2.0
    },
    {
        "n": "temperature",
        "u": "Cel",
        "v": -24.0
    },
    {
        "n": "firmwareVersion",
        "vs": "06b0"
    },
    {
        "n": "firmwareCRC",
        "vs": "3407"
    },
    {
        "n": "settingsCRC",
        "vs": "42b5"
    },
    {
        "n": "nfcState",
        "vs": "NFC_READ_ONLY"
    },
    {
        "n": "powerupTime",
        "u": "min",
        "v": 184996.0
    },
    {
        "n": "transmissionTime",
        "u": "s",
        "v": 67.0
    },
    {
        "n": "nrOfLoraTransmissions",
        "v": 27.0
    },
    {
        "n": "rotationLeft",
        "v": 1.0
    },
    {
        "n": "rotationRight",
        "v": 3.0
    },
    {
        "n": "orientationX",
        "v": 21.0
    },
    {
        "n": "orientationY",
        "v": 7.0
    },
    {
        "n": "timeOrigin",
        "vs": "NETWORK"
    }
]
```

### ‹ Encoded device commands

* Protocol: LoRa downlink
* Description: Set the device mode and enabling of nfc writes.
* Multiple commands in one downlink: No

Input mapping:

* Name: `mode`
  * Value: `Missing` (translates into → `118000000080000000`)
* Name: `deviceControl`
  * Value: `Reset` (translates into → `0200`)
  * Value: `NFC_Write` (translates into → `1B11FA1816`)


---

# 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.kpnthings.com/kpn-things/building-blocks/devices/trackers/kpn-locationtag-ii-v2.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.
