Milesight VS340: LoRaWAN Desk & Seat Occupancy Sensor

Milesight VS340 LoRaWAN desk occupancy sensor: own ChirpStack/ThingsBoard decoder, decoded example, PIR occupancy status and hot-desking integration.

Milesight VS340
VS340Sensor
LoRaWAN
Class A, OTAA
Band / port
EU868 / port 85
Detection
PIR, under-desk mount
Response time
occupied ~13 s, vacant ~60 s
Battery
Replaceable, up to 5 years
Privacy
Anonymous, no image, GDPR friendly
Configuration
NFC (Milesight ToolBox)
Measurements

What the VS340 measures

Occupancy status

Binary occupied / vacant from the PIR field of view under the desk or seat.

Battery level

Reported as a percentage, lets you plan replacements before a sensor goes dark.

Event uplinks

State changes are sent on occupied and vacant transitions, not only on a fixed interval.

Data into your dashboard

Integration

Sensor / controller

Measures or controls in the field and sends LoRaWAN uplinks.

LoRaWAN gateway

Receives the radio packets and forwards them to the server.

ChirpStack

Network server: manages sessions and decodes the payload.

ThingsBoard / Grafana

Dashboards, alarms, rules and reports.

ChirpStack v4 · decodeUplink
function decodeUplink(input) {
  var bytes = input.bytes;
  var data = {};

  for (var i = 0; i < bytes.length; ) {
    var channel = bytes[i++];
    var type = bytes[i++];

    if (channel === 0x01 && type === 0x75) {          // battery (%)
      data.battery = bytes[i]; i += 1;
    } else if (channel === 0x03 && type === 0x00) {   // occupancy (0/1)
      data.occupancy = bytes[i] === 1 ? "occupied" : "vacant";
      i += 1;
    } else if (channel === 0xff) {                    // device info (join / power-on)
      i += deviceInfoLen(type);
    } else {
      break;
    }
  }
  return { data: data };
}

// 0xFF segment lengths from the published byte spec: version 1B, hw/fw/tsl 2B, SN 8B, class 1B.
function deviceInfoLen(type) {
  if (type === 0x16) return 8;                        // serial number
  if (type === 0x09 || type === 0x0a || type === 0xff) return 2; // hw / fw / tsl version
  return 1;                                           // ipso version, class, reset, status
}

Implemented from the published Milesight byte specification (Communication Protocol / User Guide).

Channel format: 01 75 battery (%), 03 00 occupancy (0 = vacant, 1 = occupied). The 0xFF channel carries device info on join and power-on. Downlink-response frames (report interval, D2D, LED) are configuration data and are skipped here. For ThingsBoard the same channel logic goes into an uplink converter. Implemented from the published Milesight byte specification.

Uplink (hex)

017564030001

Decoded JSON

{ "battery": 100, "occupancy": "occupied" }
From the field

Configuration & pitfalls

Mounting position

The PIR has a fixed under-desk field of view. Mount it so the cone covers the seat, not the walkway, or you get false occupied states from people passing by.

Response timing

Occupied is reported in about 13 seconds, vacant in about 60 seconds. Do not alert on sub-minute flicker, the vacancy delay is by design to avoid false 'free' states.

Vacancy reporting interval

A periodic heartbeat confirms a desk is still vacant. Set it over NFC so dashboards can tell 'vacant' from 'sensor offline'.

Anonymous detection

The VS340 reports only a binary occupied/vacant state with no image or identity, which keeps the rollout inside GDPR for workplace monitoring. Document this for the works council.

Your partner

How merkaio supports your VS340

From sourcing to day-to-day operation, all from one partner on our own European infrastructure.

Pre-staging & provisioning

We configure the VS340, set keys, intervals and alarms, and ship it ready to deploy.

Own decoder

Payload codec for ChirpStack v4 and ThingsBoard, implemented from the Milesight specification.

Dashboard integration

Data lands in your ThingsBoard or Grafana, with alarms and reports.

Operations & monitoring

We run the LoRaWAN stack and dashboards on European infrastructure, you just use the data.

Frequently asked questions

Yes. It is a standard LoRaWAN Class A device, no Milesight gateway or cloud required. You add the codec to the device profile and provision it via OTAA.
Yes, for both ChirpStack and ThingsBoard, implemented from the published Milesight byte specification. The same channel logic goes into a ThingsBoard uplink converter.
A binary occupancy status (occupied or vacant) from its PIR field of view, plus a battery level. It does not count people or capture any image.
It reports occupied in about 13 seconds and vacant in about 60 seconds. The longer vacancy delay is intentional, so a brief stillness does not flip a busy desk to free.
Its detection is anonymous: it senses presence with PIR and reports only occupied or vacant, with no image and no personal data, which makes it well suited to GDPR-sensitive office deployments.
It uses a replaceable battery rated for up to five years, depending on the reporting interval and how often the desk state changes.
The VS340 uses PIR detection for general desk and seat occupancy. The VS341 adds thermopile IR sensing for more precise detection. Both share the same uplink channel format.
From the same series

Related devices

Let's discuss your infrastructure. Digital and on-site.

Whether it's IoT platform development, hardware selection, managed hosting for ChirpStack, ThingsBoard, Grafana or NetBird VPN, or migration from a self-hosted setup - we'll find the right solution for your use case. Book a free 30-minute consultation, no commitment required.

Timo Wevelsiep

Your contact

Timo Wevelsiep

Founder, merkaio

15 minutes, no commitment, directly with Timo.

By submitting, you agree to our Privacy Policy.

Decoder for ChirpStack v4. merkaio is an independent integrator and is not affiliated with Milesight.