Milesight GS101: LoRaWAN Residential Gas Detector

Milesight GS101 LoRaWAN gas detector: own ChirpStack/ThingsBoard decoder, decoded example, methane alarm, valve and relay control for residential safety.

Milesight GS101
GS101Sensor
LoRaWAN
Class C, OTAA
Band / port
EU868 / port 85
Target gas
Methane (CH4)
Alarm threshold
8 % LEL
Local alarm
85 dB buzzer + LED
Outputs
Relay output + solenoid valve output
Power
Mains powered (Class C)
Measurements

What the GS101 measures

Gas status

Methane (CH4) state: normal or alarm, raised at the configured LEL threshold.

Valve status

Solenoid valve output state (on/off) for shutting off the gas supply.

Relay output

Relay state (on/off) to drive vent fans or external appliances.

Remaining life

Sensor service life countdown so you can plan replacement before expiry.

Device events

Alarm and reset events such as power on/off, device fault and end of life.

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++];

    // Gas status: 0 = normal, 1 = alarm
    if (channel === 0x05 && type === 0x8e) {
      data.gas_status = bytes[i] === 1 ? "alarm" : "normal"; i += 1;
    // Solenoid valve output state
    } else if (channel === 0x06 && type === 0x01) {
      data.valve_status = bytes[i] === 1 ? "on" : "off"; i += 1;
    // Relay output state
    } else if (channel === 0x07 && type === 0x01) {
      data.relay_output_status = bytes[i] === 1 ? "on" : "off"; i += 1;
    // Remaining sensor life (UINT32 little-endian)
    } else if (channel === 0x08 && type === 0x90) {
      data.life_remain = readUInt32LE(bytes, i); i += 4;
    // Device alarm/lifecycle event
    } else if (channel === 0xff && type === 0x3f) {
      data.alarm = readAlarm(bytes[i]); i += 1;
    // Device info on join/power-on: skip protocol/hw/fw/SN/class fields
    } else if (channel === 0xff) {
      i += deviceInfoLen(type);
    } else {
      break;
    }
  }
  return { data: data };
}

function readUInt32LE(b, i) {
  return ((b[i+3]<<24)|(b[i+2]<<16)|(b[i+1]<<8)|b[i]) >>> 0;
}
function readAlarm(v) {
  var map = { 0: "power off", 1: "power on", 2: "device fault",
              3: "fault recovered", 4: "device invalid soon", 5: "device invalid" };
  return map[v] !== undefined ? map[v] : v;
}
function deviceInfoLen(type) {
  // 0xFF info fields: 0x01 version, 0x0f class, 0x0b status, 0xfe reset = 1 byte;
  // 0x09 hw, 0x0a fw, 0xff tsl = 2 bytes; 0x16 serial number = 8 bytes
  if (type === 0x09 || type === 0x0a || type === 0xff) return 2;
  if (type === 0x16) return 8;
  return 1;
}

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

Channel format: 05 8E gas status (0 normal / 1 alarm), 06 01 valve output (on/off), 07 01 relay output (on/off), 08 90 remaining life (UINT32 little-endian), FF 3F device alarm event. FF channels on join/power-on carry version, class and serial-number info and are skipped by length. Implemented from the published Milesight byte specification. For ThingsBoard the same channel logic goes into an uplink converter.

Uplink (hex)

058E0006010107010108908A510100

Decoded JSON

{ "gas_status": "normal", "valve_status": "on", "relay_output_status": "on", "life_remain": 86410 }
From the field

Configuration & pitfalls

Class C power

The GS101 keeps its receive window open for downlink valve and relay control, so it is mains powered. Plan a permanent supply, not battery.

Alarm uplinks are priority

Gas alarms are sent immediately, outside the reporting interval. Dashboard rules should treat gas_status alarm uplinks as priority events.

Valve and relay safe states

Decide whether the solenoid valve closes on alarm and define the relay logic before rollout, so the local fail-safe matches the building's safety plan.

Sensor end of life

The catalytic sensor has a finite service life. Alert on the life_remain countdown and the device invalid events so a unit is replaced before it stops protecting.

Your partner

How merkaio supports your GS101

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

Pre-staging & provisioning

We configure the GS101, 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 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.
It detects methane (CH4) and raises an alarm at a threshold as low as 8 % of the Lower Explosive Limit (LEL), with an 85 dB local buzzer and a remote LoRaWAN alarm uplink.
Yes. It has a solenoid valve output and a relay output, so on an alarm it can close the gas valve and switch external appliances such as a vent fan locally, and the decoder reports both states.
It is a Class C device on LoRaWAN port 85. Class C keeps the receive window open so the device can accept downlinks for valve and relay control in near real time.
No. As a Class C gas detector it is mains powered so it can listen continuously and drive the valve and relay, so plan for a permanent power supply rather than battery operation.
The GS101 reports a remaining service-life value and device-lifecycle events such as fault and end of life. Alert on the life_remain countdown so a unit is replaced before it stops protecting.
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.