(Optional) Creating a LoRaWAN Device Interface (XIF) Definition

(Optional) Creating a LoRaWAN Device Interface (XIF) Definition

LoRaWAN devices are supported with SmartServer 4.0 and higher.

The SmartServer ships with support for a range of LoRaWAN device types. While you can create your own LoRaWAN device interface definitions, device type definitions and associated LNS profiles, they must not conflict with the supplied types and associated LNS device profiles.

This section provides information on how to create a LoRaWAN device interface (XIF) definition and consists of the following:  

Supported Devices

The table below lists the device types that were tested with SmartServer 4.0.

Manufacturer

CMS Device Type

Device XIF Name

Program ID

Description

Usage  

Manufacturer

CMS Device Type

Device XIF Name

Program ID

Description

Usage  

Dragino

LHT65 E1

LHT65_E1

8002A40A5A04E100

Temperature and Humidity Sensor

Europe, US

Elsys

Elsys ERS CO2

Elsys_ERS_CO2

8000840A5A04E100

CO2, Humidity, Temperature, Light and Motion Sensor

Europe, US

Elsys

Elsys ERS Eye 

Elsys_ERS_Eye

8000840A5A04E101

Occupancy, Humidity, Temperature, Light and Motion Sensor

Europe, US

Elsys

Elsys ERS CO2 Lite

Elsys_ERS_CO2_Lite

8000840A5A04E102

CO2, Humidity and Temperature Sensor

Europe, US

Elsys

Elsys ERS Lite

Elsys_ERS_Lite

8000840A5A04E103

CO2 Sensor

Europe, US

Elsys

Elsys ERS VOC

Elsys_ERS_VOC

8000840A5A04E104

VOC levels, Light, Temperature, Motion, and Humidity Sensor

Europe, US

Hawken IO

Leak

Leak

90FFFF0A5204E100

Leak Sensor

US

IMBuilding

IMBuildings People Counter

IMBuildings_People_Counter

9002C40A5204E100

People Counter

Europe

Maddalena

Maddalena SJ EVO

Maddalena_SJ_EVO

8000FF0A5A04E100

Water Meter

Europe

MClimate

MClimate Vicki

MClimate_Vicki

8003380A5A04E100

Wet Radiator Control Valve

Europe

MClimate

MClimate HT

MClimate_HT

8003380A5A04E101

Humidity and Temperature Sensor

Europe

Milesight

Milesight AM319

Milesight_AM319

8002590A5A04E100

Indoor Air Quality, Temperature, Humidity, Pressure, CO2, Light and Occupancy

Europe, US

Milesight

Milesight VS121

Milesight_VS121

8002590A5A04E101

AI Workplace Occupancy Sensor/People Counter

Europe, US

Milesight

Milesight VS132

Milesight_VS132

8002590A5A04E102

Time of Flight People Counting Sensor

Europe, US

Milesight

Milesight WS301

Milesight_WS301

8002590A5A04E103

Magnetic Contact Switch

Europe, US

Milesight

Milesight EM300-TH

Milesight_EM300-TH

8002590A5A04E104

Temperature and Humidity Sensor

Europe, US

Milesight

Milesight AM103

Milesight_AM_103

8002590A5A04E105

Temperature, Humidity and CO2 Sensor

Europe, US

Milesight

Milesight EM320-TH

Milesight_EM320-TH

8002590A5A04E106

Temperature and Humidity Sensor

Europe, US

Milesight

Milesight UC300

Milesight_UC300

8002590A5A04E107

IoT Controller

Europe, US

Milesight

Milesight WTS305

Milesight_WTS305

8002590A5A04E108

IoT Weather Station

Europe, US

Milesight

Milesight WTS506

Milesight_WTS506

8002590A5A04E109

IoT Weather Station

Europe, US

Milesight

Milesight EM500-LGT

Milesight_EM500-LGT

8002590A5A04E110

Light Sensor

Europe, US

Netvox

Netvox R311FA

Netvox_R311FA

9001210A5A04E100

Activity Sensor

Europe, US

Netvox

Netvox R712

Netvox_R712

8001210A5A04E101

Temperature and Humidity Sensor

Europe, US

Netvox

Netvox R718N17

Netvox_R718N17

9001210A5A04E102

Single Phase 75A Current Sensor

Europe, US

Netvox

Netvox R718E

Netvox_R718E

9001210A5A04E103

Three-Axis Digital Accelerometer and NTC Thermistor

Europe, US

Netvox

Netvox R718AD

Netvox_R718AD

9001210A5A04E104

Temperature Sensor With Probe

Europe, US

Netvox

Netvox R718N37

Netvox_R718N37

9001210A5A04E106

Three Phase 75A Current Sensor

Europe, US

Netvox

Netvox R718N315

Netvox_R718N315

9001210A5A04E105

Three Phase 150A Current Sensor

Europe, US

Netvox

Netvox R718AB

Netvox_R718AB

9001210A5A04E107

Temperature and Humidity Sensor

Europe, US

Netvox

Netvox R718DB

Netvox_R718DB

9001210A5A04E108

Wireless Vibration Sensor, Spring Type

Europe, US

Netvox

Netvox R313WA

Netvox_R313WA

9001210A5A04E109

2-Gang Seat Occupancy Sensor

Europe, US

Synetica

enLink ENL-AIR

enLink_ENL-AIR

90FFFF0A5A04E101

Indoor Air Quality Monitor

Europe

Synetica

enLink ENL-STS-DP

enLink_ENL-STS-DP

90FFFF0A5A04E101

Differential Pressure Sensor

Europe

Guidance on the LoRaWAN Program ID format can be found at Device Type Definition.  If a manufacturer is not a member of the LoRa Alliance, then the Program ID starts with 90FFFF.

The .dtp file for each manufacturer's device types shown above can be found here; they can be used as the basis for customer types.

LoRaWAN XIF Definition

To create a LoRaWAN XIF definition, follow these steps:

  1. Enable LoRaWAN as described in Add a LoRaWAN Interface.

  2. If you are importing a device type package (.dtp) with a BACnet Type Map (.btm), then enable BACnet as described in Add a BACnet Interface.

  3. Create a CSV file with a base name and .LoRaWAN, .csv, or .LoRaWAN.csv extension. The base name is the part of the XIF filename that precedes the extension. For example, if the XIF filename is NetvoxR712V2.LoRaWAN, then the base name is NetvoxR712V2 and the extension is .LoRaWAN. And, if NetvoxR712V2.LoRaWAN and NetvoxR712V3.LoRaWAN are identical in content including the program ID, then they will still be treated as two different XIFs because of the different XIF filenames. The filename must match the device profile name in ChirpStack.

  4. Specify monitoring parameters using the CMS Datapoint Properties widget, or using a Datapoint Monitoring, Logging, and Alarming file (.dla).

A LoRaWAN XIF file has the following three sections:

  • A file type specification that identifies the file as a LoRaWAN XIF file.

  • A product details section that specifies the program ID, version, product name, and manufacturer for the LoRaWAN device.

  • A datapoint list that specifies the datapoints on the device to be available to the SmartServer. The first line of the datapoint list is a header with column headings for a datapoint list. 

The following figure illustrates the top portion of a LoRaWAN XIF file:

#filetype,lorawan_xif #program_ID,9B008C011E00BB05 #version,beta #product_name,NetvoxR718N17 #manufacturer,Netvox #description,xif with all uplink datapoints Block Name,Block Index,Datapoint Name,Address,Native Type,IAP Type,IAP Field,Write Enable,Downlink Encoder,Downlink Code,Downlink Port,Downlink String Length,Downlink Binary 0 Constant,Downlink Binary 1 Constant,Precision,Description,Native Value 1,Native Value 2,Scaled Value 1,Scaled Value 2,Range Min,Range Max,ASCII Length

File Type Specification

The file type for a LoRaWAN XIF file must be specified using a #filetype metadata tag name and a LoRaWAN_xif metadata tag value as shown in the example below.

#filetype,LoRaWAN_xif

The LoRaWAN driver accepts device type XIF files that use the extension .LoRaWAN, .csv, or .LoRaWAN.csv extension and start with LoRaWAN_xif.

Product Details

The product details identify the product specified by the LoRaWAN XIF file. The product details specification has the following contents:

#program_ID,<Program ID> #version,<Version> #product_name,<Product Name> #manufacturer,<Manufacturer> #description,<Description>

If you open a CSV file with this line in Excel, then it is displayed as two cells, one with #filetype and the other with the LoRaWAN_xif metadata tag value. If you save a LoRaWAN XIF file from Excel, then Excel will append commas to the file type specification. The LoRaWAN driver and the CMS will ignore the commas, if present.

Specify the details as follows:

  • <Program ID> – (optional) a 64-bit hexadecimal number used for identifying resource definitions (e.g., 9F:00:96:05:28:04:E1:01) with optional colon and hyphen separators. See Device Type Definition for further information. For LoRaWAN, the LoRa Alliance Vendor ID is used for the manufacturer ID. 

  • <Version> – (optional) version of the device.

  • <Product Name> – (optional) manufacturer's name for the device.

  • <Manufacturer> – (optional) device manufacturer.

  • <Description> – (optional) comment description of the device.

Following is an example product details specification for a Netvox R712 Wireless Outdoor Temperature Humidity Sensor:

#program_ID,9F:00:96:05:28:04:E1:01 #version,v2.21.019 #product_name,Netvox R712 #manufacturer,Netvox #description,Netvox R712 Wireless Outdoor Temperature Humidity Sensor

Datapoint List

The datapoint list specifies the datapoints on the device that are to be available to the SmartServer. The first line of the datapoint list is a header with column headings for a datapoint list. The following example shows a datapoint list with a single datapoint defined in the second line:

Block Name,Block Index,Datapoint Name,Address,Native Type,IAP Type,IAP Field,Write Enable,Downlink Encoder,Downlink Code,Downlink Port,Downlink String Length,Downlink Binary 0 Constant,Downlink Binary 1 Constant,Precision,Description,Native Value 1,Native Value 2,Scaled Value 1,Scaled Value 2,Range Min,Range Max,ASCII Length Sensors,0,Raw Current,rawcurrentma,,SNVT_amp_f,,-,,,,,,,,,1000,10000,1,10,,, Sensors,0,Scaled Current,currentma,,SNVT_amp_f,,-,,,,,,,,,1000,10000,1,10,,, Sensors,0,Current Multiplier,multiplier,,SNVT_count_f,,-,,,,,,,,,,,,,,,

The following table describes the column contents for the datapoint list. You can arrange the columns in any order. The SmartServer uses the name in the heading row entry to identify the contents of the column.  

Parameter

Standard/
Custom

Required/
Optional

Description

Block Name

Standard

Optional

Block XIF name for the datapoint. Blocks can be used to group related datapoints together and can provide a descriptive name to identify the block. The same block can be specified for multiple datapoints to logically group the datapoints.

Block Index

Standard

Optional

Specifies a numeric block index. The block index can be any positive (>=0) integer value and is not required to be sequential. If it is not specified, then the block index is zero. You can use the block index to create multiple blocks of the same type. 

Example: for a device with 8 digital outputs, you can define 8 blocks, each named DO, using indexes 0 through 7 (it is not required for the index names to be sequential and they may not start wit zero).

Datapoint Name

Standard

Required

The datapoint XIF name. This is a descriptive name to identify the datapoint. The name must be unique for all the datapoints in a block containing the datapoint, or in the device if a block is not specified for the datapoint. 

The datapoint XIF name is the name that appears at the top-level attribute for a datapoint schema defined in an IAP/MQ block object.

Example: in the following excerpt from a LON example device block object with an IAP/MQ glp/0/17q4c4n/fb/dev/lon/3/if/Lamp/0 topic, the datapoint XIF name is nviLamp:

"nviLamp": {

"value": {

"value": 0,

"state": 0

},
...

Multiple lines in the datapoint list may specify the same block name, block index, and datapoint name. These lines specify the definition of a single IAP datapoint based on multiple LoRaWAN datapoints.

Address

Standard

Required

The LNS Decoder JSON key name for the datapoint.

Example: temperature

Native Type

Standard

Optional

Identifies how the data appears in the native protocol. The native type is specified as an IAP type. If it is not specified, then the default native type for a LoRaWAN XIF is float. The native type for use by the LoRaWAN driver is base64.

IAP Type

Standard

Optional

IAP type that identifies how the data appears in IAP and identifies the datapoint type to be reported in IAP/MQ. If it is not specified, then the default IAP type for a LoRaWAN XIF is float. The IAP type for use by the LoRaWAN driver is hex_string.

Example: 0x0101003C003C0100640064

An IAP type may also specify the semantic meaning of a datapoint. Each driver may support a different subset of IAP types for the native types.

The following IAP types are defined:

  • Base types – bit, boolean, multistate, sint8uint8, uint16, sint16, uint32, sint32, uint64, sint64, floatfloat32, float64, mod10_32, mod10_48, mod10_64.Base type values are case-sensitive and must use lower-case letters.