Milesight WS201: LoRaWAN Smart Fill-Level Monitoring Sensor
Milesight WS201 LoRaWAN fill-level sensor: own ChirpStack/ThingsBoard decoder, decoded example, ToF distance and remaining-amount alerts.
- LoRaWAN
- Class A, OTAA
- Band / port
- EU868 / port 85
- Sensing
- Time-of-Flight distance
- Detection range
- 1 to 55 cm, accuracy plus/minus 1 cm
- Battery
- 590 mAh CR2450, around 3.2 years
- Mounting
- Inside containers and dispensers
- Configuration
- NFC (Milesight ToolBox)
What the WS201 measures
Distance
Time-of-Flight distance to the surface in millimetres, valid across the 1 to 55 cm detection range with plus/minus 1 cm accuracy.
Remaining amount
Fill level derived from distance as a percentage, after you calibrate empty and full.
Battery level
Reported as a percentage so refills and battery swaps can be planned together.
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 === 0x82) { // distance (mm)
data.distance = readUInt16LE(bytes, i); i += 2;
} else if (channel === 0x04 && type === 0xd6) { // remaining amount (%)
data.remaining = bytes[i]; i += 1;
} else {
break;
}
}
return { data: data };
}
function readUInt16LE(b, i) {
return ((b[i + 1] << 8) | b[i]) & 0xffff;
}
Implemented from the published Milesight byte specification (Communication Protocol / User Guide).
Channel format: 01 75 battery (%), 03 82 distance (UINT16 little-endian, millimetres), 04 D6 remaining amount (%). Device-info and downlink-response frames start with channel FF and FE and are skipped here. The remaining percentage depends on the empty and full reference distances you calibrate over NFC, so document those for each container. For ThingsBoard the same channel logic goes into an uplink converter. Implemented from the published Milesight byte specification.
Uplink (hex)
0175640382540104D65ADecoded JSON
{ "battery": 100, "distance": 340, "remaining": 90 }Use cases
Public washroom dispensers
Monitor toilet-paper and tissue levels in airports, malls and venues to route cleaning crews.
MoreRetail consumables
Track dispenser and bin fill levels across stores so staff refill before a stockout.
MoreOffice facilities
Keep washroom and pantry consumables stocked without manual rounds.
MoreConfiguration & pitfalls
NFC setup
Keys, reporting interval and the empty/full reference distances are written over NFC with the Milesight ToolBox before rollout.
Calibrate empty and full
The remaining percentage is derived from distance, so set the empty and full reference points per container, otherwise the percentage drifts between container shapes.
Stay inside the detection range
The Time-of-Flight sensor reads from 1 to 55 cm. Mount it so the surface of a full and an empty container both stay within that range, otherwise readings clip at the near or far limit.
Threshold alarms
A low-remaining alarm is sent immediately, outside the reporting interval, so dashboard rules should treat alarm uplinks as priority refill events.
How merkaio supports your WS201
From sourcing to day-to-day operation, all from one partner on our own European infrastructure.
Pre-staging & provisioning
We configure the WS201, 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.