# Netvox configuration

### Configuration guide

To add a Netvox sensor to a Milesight gateway, follow the instructions in this guide:

{% embed url="<https://support.milesight-iot.com/support/solutions/articles/73000514280-how-to-connect-lorawan-nodes-to-milesight-gateway>" %}

To connect the Milesight gateway to UMA's MQTT server follow the instructions in this guide:

{% embed url="<https://support.milesight-iot.com/support/solutions/articles/73000514193-how-to-connect-lorawan-gateway-to-mqtt-broker->" %}

{% hint style="info" %}
Unsure about UMA's MQTT server details? Click [here](/uma-knowledgebase/integrations/iot-sensors/mqtt.md).
{% endhint %}

### Payload codec

In order for our server to correctly understand messages sent from Netvox sensors you will need to create a custom payload codec on the Milesight gateway. Use the following decoder:

```
function Decode(fPort, bytes, LoRaObject) {
    var decoded = {
        version: bytes[0],
        device_type: "R718N325",
        report_type: bytes[2],
        battery_voltage: (bytes[3] & 0x7F) * 0.1,
        battery_low: (bytes[3] & 0x80) ? true : false,
        currents_mA: {
            L1: (bytes[4] << 8 | bytes[5]),
            L2: (bytes[6] << 8 | bytes[7]),
            L3: (bytes[8] << 8 | bytes[9])
        },
        multiplier: {
            L1: 1,
            L2: 1,
            L3: 1
        }
    };

    // Add devEUI and ISO timestamp if available
    if (LoRaObject) {
        decoded.devEUI = LoRaObject.devEUI;
        decoded.rssi = LoRaObject.rxInfo && LoRaObject.rxInfo[0] ? LoRaObject.rxInfo[0].rssi : null;
        decoded.snr = LoRaObject.rxInfo && LoRaObject.rxInfo[0] ? LoRaObject.rxInfo[0].loRaSNR : null;
        decoded.data = LoRaObject.data;
        decoded.time = LoRaObject.time ? LoRaObject.time : new Date().toISOString();
    } else {
        decoded.time = new Date().toISOString();
    }

    return decoded;
}

```

### Application setup

In order for our server to correctly understand uplinks and downlinks from our server you will need to configure the application on the gateway with the following topic:

**Uplink topic** - netvox

### Add the device to UMA

To add a Netvox sensor to UMA, you will need the Dev EUI which can be obtained either locally on the sensor or from your distributor. Use the Dev EUI as the UMA ID.

When adding a Netvox device in UMA, click on **add device** and then use the Netvox card to find the device you want to add.

After some minutes, the device will come online and you will start recording the data coming from the sensor.


---

# 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://support.meetuma.ai/uma-knowledgebase/integrations/iot-sensors/netvox/netvox-configuration.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.
