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.
- 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)
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.
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.
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)
017564030001Decoded JSON
{ "battery": 100, "occupancy": "occupied" }Use cases
Hot-desking & space optimisation
Show free desks live and right-size the floor plan from real occupancy data.
MoreMeeting & focus rooms
Surface which seats and rooms are actually in use to cut booking conflicts.
MoreWorkplace analytics
Aggregate desk-level occupancy into utilisation reports without cameras.
MoreConfiguration & 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.
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
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.
Your contact
Timo Wevelsiep
Founder, merkaio
15 minutes, no commitment, directly with Timo.
Decoder for ChirpStack v4. merkaio is an independent integrator and is not affiliated with Milesight.