DS-501 LoRaWAN Smart Plug User Guide

Device Information: Model DS-501, devEui ffffff1000048920, gateway IP 192.168.31.205, Modbus Slave ID 3, BACnet Device ID 102

1 Protocol Overview

The DS-501 reports switch state, lock state, voltage, current, active power, energy consumption, and signal quality on Fport 210.

Payload format (Fport 210):

Byte Field Description
0 Reserved Always 0x00 (protocol version)
1 … N TLV pairs [Type(1 B)][Value(N B)] … repeating until end

Each Type byte determines the field name and the number of following value bytes:

Type Value Bytes Field Name Encoding Scale Unit Notes
0x01 1 model uint8 Model code = 0x48
0x22 1 switch uint8 0=OFF 1=ON (relay state)
0x96 1 lockState uint8 0=unlocked 1=locked
0x79 4 timestamp uint32 BE s Device local Unix timestamp (0 if no RTC)
0x80 4 timerStatus bitfield32 BE Bit 0=timerCloseEnabled Bit 1=timerOpenEnabled Bit 30=timerLockEnabled Bit 31=timerUnlockEnabled
0x97 2 voltage uint16 BE ÷10 V e.g. 0x09C4=2500 → 250.0 V
0x98 2 current uint16 BE ÷100 A e.g. 0x0064=100 → 1.00 A
0x99 2 activePower int16 BE ÷100 W Signed; e.g. 0x00C8=200 → 2.00 W
0x9A 4 energy uint32 BE ÷100 kWh Cumulative energy; e.g. 100 → 1.00 kWh

JavaScript Decoder Example:

// DS-501 Smart Plug — Fport 210 uplink decoder
function decodeUplink(bytes) {
  var i = 1, r = {};
  function u16(b,o){ return (b[o]<<8)|b[o+1]; }
  function i16(b,o){ var v=u16(b,o); return v>32767?v-65536:v; }
  function u32(b,o){ return ((b[o]<<24)|(b[o+1]<<16)|(b[o+2]<<8)|b[o+3])>>>0; }
  while (i < bytes.length) {
    var t = bytes[i++];
    switch (t) {
      case 0x01: r.model       = bytes[i++]; break;
      case 0x22: r.switch      = bytes[i++]; break; // 0=OFF  1=ON
      case 0x79: r.timestamp   = u32(bytes,i); i+=4; break;
      case 0x80: {
        var bits = u32(bytes,i); i+=4;
        r.timerCloseEnabled = (bits&0x01)!==0;
        r.timerOpenEnabled  = (bits&0x02)!==0;
        r.timerLockEnabled  = (bits&0x40000000)!==0;
        r.timerUnlockEnabled= (bits&0x80000000)!==0;
        break;
      }
      case 0x96: r.lockState   = bytes[i++]; break;
      case 0x97: r.voltage     = u16(bytes,i)/10;  i+=2; break; // V
      case 0x98: r.current     = u16(bytes,i)/100; i+=2; break; // A
      case 0x99: r.activePower = i16(bytes,i)/100; i+=2; break; // W
      case 0x9A: r.energy      = u32(bytes,i)/100; i+=4; break; // kWh
      default:   i++; break;
    }
  }
  return r;
}
// Example payload (hex): 00 01 48 22 01 96 00 97 09 C4 98 00 64 99 00 C8 9A 00 00 00 64
// → { model:72, switch:1, lockState:0, voltage:250.0, current:1.00, activePower:2.00, energy:1.00 }

Script download: LPP.zip

Compatibility note: LPP.js is developed and tested against ChirpStack v4.17.0. The ChirpStack JavaScript codec API may differ across versions — if you are running a different ChirpStack version, review and adjust the script as needed before deployment.

The DS-501 supports immediate/delayed/scheduled switch and lock commands, and cancel-timer commands via Fport 2.

Fport: 20x09 0x48 (model device header)

Packet format: 09 48 [CmdCode] [Params...] All multi-byte values are big-endian (MSB first). T = delay/schedule time (uint32 BE, seconds or Unix timestamp). R = repeat flag: 0x00=once, 0x01=daily.

CmdCode Packet Bytes Description
0x00 09 48 00 01 Socket OFF immediately
0x01 09 48 01 01 Socket ON immediately
0x02 09 48 02 Unlock (remove keypad lock)
0x03 09 48 03 Lock (lock operation)
0x04 09 48 04 FF T3 T2 T1 T0 Socket OFF after delay T seconds
0x05 09 48 05 FF T3 T2 T1 T0 Socket ON after delay T seconds
0x06 09 48 06 FF T3 T2 T1 T0 R Schedule socket OFF at Unix time T (R=repeat)
0x07 09 48 07 FF T3 T2 T1 T0 R Schedule socket ON at Unix time T (R=repeat)
0x08 09 48 08 T3 T2 T1 T0 Unlock after delay T seconds
0x09 09 48 09 T3 T2 T1 T0 Lock after delay T seconds
0x0A 09 48 0A T3 T2 T1 T0 R Schedule unlock at Unix time T
0x0B 09 48 0B T3 T2 T1 T0 R Schedule lock at Unix time T
0x0C 09 48 0C 01 Cancel socket timer
0x0D 09 48 0D Cancel lock timer
0x0E 09 48 0E Query current status

JavaScript Encoder Example:

// DS-501 Smart Plug — Fport 2 downlink encoder
// Returns a byte array to send via LoRaWAN Fport 2.
function encodeDownlink(data) {
  // data.command: 'socketOff'|'socketOn'|'unlock'|'lock'|'query'|'cancelTimer'|'cancelLockTimer'
  // data.delaySeconds  (optional) : uint32, for delayed commands
  // data.scheduleAt    (optional) : Unix timestamp uint32, for scheduled commands
  // data.repeatDaily   (optional) : bool
  var H = [0x09, 0x48];
  var u32 = function(n){ return [(n>>>24)&0xFF,(n>>>16)&0xFF,(n>>>8)&0xFF,n&0xFF]; };
  var T = (data.delaySeconds !== undefined) ? data.delaySeconds : (data.scheduleAt || 0);
  var R = data.repeatDaily ? 0x01 : 0x00;
  var cmd = String(data.command||'').trim().toLowerCase();
  switch(cmd) {
    case 'socketoff':     case 'off':         return H.concat([0x00, 0x01]);
    case 'socketon':      case 'on':          return H.concat([0x01, 0x01]);
    case 'unlock':                            return H.concat([0x02]);
    case 'lock':                              return H.concat([0x03]);
    case 'delayoff':   return H.concat([0x04, 0xFF].concat(u32(T)));
    case 'delayon':    return H.concat([0x05, 0xFF].concat(u32(T)));
    case 'scheduleoff':return H.concat([0x06, 0xFF].concat(u32(T)).concat([R]));
    case 'scheduleon': return H.concat([0x07, 0xFF].concat(u32(T)).concat([R]));
    case 'delayunlock':return H.concat([0x08].concat(u32(T)));
    case 'delaylock':  return H.concat([0x09].concat(u32(T)));
    case 'scheduleunlock': return H.concat([0x0A].concat(u32(T)).concat([R]));
    case 'schedulelock':   return H.concat([0x0B].concat(u32(T)).concat([R]));
    case 'canceltimer':      case 'cancelsocket': return H.concat([0x0C, 0x01]);
    case 'cancellocktimer':  case 'cancellock':   return H.concat([0x0D]);
    case 'query': return H.concat([0x0E]);
    default: return [];
  }
}
// Examples:
//   encodeDownlink({command:'socketOn'})          → [0x09,0x48,0x01,0x01]
//   encodeDownlink({command:'delayOff', delaySeconds:30}) → [0x09,0x48,0x04,0xFF,0x00,0x00,0x00,0x1E]
//   encodeDownlink({command:'scheduleOn', scheduleAt:1761177600, repeatDaily:true})
//       → [0x09,0x48,0x07,0xFF,0x69,0x0E,0x2E,0x00,0x01]
⚠️ The IP addresses (192.168.31.205 / 192.168.31.193), ChirpStack API token, Slave ID, BACnet Device ID, and devEui in the examples below are for demonstration only. Replace them with your actual gateway IP, ChirpStack API token, and device parameters.

2.1 ChirpStack MQTT Subscription

Subscribe to the MQTT topic to receive real-time uplink frames:

Application ID3ef9e6b9-ec54-4eda-86b8-a5fb46899f39 is the factory-default ChirpStack
application built into the gateway. Replace it with your actual application
ID if you have created a different one.

Gateway IP192.168.31.205 is the gateway WAN port IP shown as an
example. Replace it with your actual gateway IP address.

Device EUIffffff1000048920 is the EUI of the example device.
Replace it with the EUI shown in the gateway device list, or use +
as a wildcard to subscribe to all devices at once.
# Subscribe to one specific device
mosquitto_sub -h 192.168.31.205 -p 1883 \
  -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/event/up"

# Subscribe to ALL devices on ALL applications (wildcard)
mosquitto_sub -h 192.168.31.205 -p 1883 \
  -u gateway -P mqtt88888888 \
  -t "application/+/device/+/event/up"

Example uplink payload (JSON):

{
  "devEui": "ffffff1000048920",
  "fPort": 210,
  "object": {
    ...  (decoded LPP fields)
  }
}

2.2 IoT Hub HTTP API

Send a GET request to retrieve the latest device state:

curl -s "http://192.168.31.205:8070/api/getStatus?devEui=ffffff1000048920"
{
  "success": true,
  "result": {
    "ds501ControlState": false,
    "ds501RepeatDaily": false,
    "switch": true,
    "lockState": 1,
    "voltage": 241.8,
    "current": 0,
    "activePower": 0,
    "energy": 16.97,
    "timestamp": 1775029074,
    "timerCloseEnabled": false,
    "timerOpenEnabled": false,
    "timerLockEnabled": false,
    "timerUnlockEnabled": false,
    "model": "DS-501"
  }
}

2.3 IoT Hub Modbus TCP — Python Script

Script download: modbus_tcp_read.py

Use modbus_tcp_read.py to poll all registers at once:

python3 modbus_tcp_read.py --ip 192.168.31.205 --port 502 \
    --slaveId 3 --sensorType DS-501
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
================================================================================================================================================================
Attribute                | Addr   | FC  | Format     | Order        | Cnt | Scale    | Raw(Hex)            | Value              | Unit
----------------------------------------------------------------------------------------------------------------------------------------------------------------
online                   | 6      | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0001                | true               | none
lastOnlineTime           | 7      | 03  | UnixTime   | Big(ABCD)    | 2   | x1       | 69CC CB40           | 1775029056         | second
ds501ControlTarget       | 9      | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0000                | 0.0                | none
ds501ControlState        | 10     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
ds501ControlMode         | 11     | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0000                | 0.0                | none
ds501DelaySeconds        | 12     | 03  | Int32      | Big(ABCD)    | 2   | x1       | 0000 0000           | 0.0                | seconds
ds501ScheduleTimestamp   | 14     | 03  | UnixTime   | Big(ABCD)    | 2   | x1       | 0000 0000           | 0                  | seconds
ds501RepeatDaily         | 16     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
switch                   | 17     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0001                | true               | none
lockState                | 18     | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0001                | 1.0                | none
voltage                  | 19     | 03  | Int16(S)   | Big(ABCD)    | 1   | /10      | 0972                | 241.8              | volt
current                  | 20     | 03  | Int16(S)   | Big(ABCD)    | 1   | /100     | 0000                | 0.00               | ampere
... (22 fields total)

2.4 IoT Hub Modbus TCP — Modbus Poll

Tool download: Modbus Poll 9.5.0.1507.zip

  1. Open Modbus Poll, connect to 192.168.31.205:502, Slave ID 3
  2. Menu Setup → Read/Write Definition, set Function Code = FC03, Start Address = 6, Length = 62
  3. Click OK — values update in real-time

2.5 IoT Hub BACnet BIP — Python Script

Script download: bacnet_read.py

Use bacnet_read.py to read all BACnet objects:

python3 bacnet_read.py --ip 192.168.31.205 --port 47808 --id 102
Target: 192.168.31.205:47808 | BACnet ID: 102 | Scan: 10200-10299
------------------------------------------------------------
Type | Instance | Offset | Value                    | Object Name
------------------------------------------------------------
BI   | 10202    | 2      | active                   | ffffff1000048920.online
AI   | 10203    | 3      | 1775028992.00            | ffffff1000048920.lastOnlineTime
AV   | 10204    | 4      | 0.00                     | ffffff1000048920.ds501ControlTarget
BV   | 10205    | 5      | inactive                 | ffffff1000048920.ds501ControlState
AV   | 10206    | 6      | 0.00                     | ffffff1000048920.ds501ControlMode
AV   | 10207    | 7      | 0.00                     | ffffff1000048920.ds501DelaySeconds
AV   | 10208    | 8      | 0.00                     | ffffff1000048920.ds501ScheduleTimestamp
BV   | 10209    | 9      | inactive                 | ffffff1000048920.ds501RepeatDaily
BV   | 10210    | 10     | active                   | ffffff1000048920.switch
BV   | 10211    | 11     | active                   | ffffff1000048920.lockState
AI   | 10212    | 12     | 241.80                   | ffffff1000048920.voltage
AI   | 10213    | 13     | 0.00                     | ffffff1000048920.current
... (25 objects total)

2.6 IoT Hub BACnet BIP — YABE

Tool download: SetupYabe_v2.1.0.exe

  1. Open YABE, connect to 192.168.31.205:47808
  2. Expand Device 102 in the device tree
  3. Browse AI/BI/AV/BV/CV objects to view real-time values

3 Sending Control Commands

The DS-501 supports immediate/delayed/scheduled switch and lock commands, and cancel-timer commands via Fport 2.

⚠️ The IP addresses (192.168.31.205 / 192.168.31.193), ChirpStack API token, Slave ID, BACnet Device ID, and devEui in the examples below are for demonstration only. Replace them with your actual gateway IP, ChirpStack API token, and device parameters.

Script downloads: modbus_tcp_write.py · bacnet_write.py

Example 1a: Immediate Switch Connect / Disconnect — Connect / Close (ON)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switch --value 1
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch: 1
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switch --value 1
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=0
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  switch: 1
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":true,"ds501ControlMode":false,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": true,
      "ds501ControlMode": 0,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": true,
    "ds501ControlMode": 0,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 1b: Immediate Switch Connect / Disconnect — Disconnect / Open (OFF)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switch --value 0
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch: 0
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switch --value 0
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=0
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  switch: 0
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":false,"ds501ControlMode":false,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": false,
      "ds501ControlMode": 0,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": false,
    "ds501ControlMode": 0,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 2a: Immediate Lock / Unlock — Lock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lock --value 1
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: 1
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lock --value 1
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=0
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: 1
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":false,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": true,
      "ds501ControlMode": 0,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": true,
    "ds501ControlMode": 0,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 2b: Immediate Lock / Unlock — Unlock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lock --value 0
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: 0
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lock --value 0
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 0
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=0
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: 0
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":false,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": false,
      "ds501ControlMode": 0,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":0,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": false,
    "ds501ControlMode": 0,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 3a: Delayed Switch (after 5 s) — Connect / Close (ON)
The device will wait 5 seconds before executing the switch command.

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switchDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switchDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=1
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=5
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":true,"ds501ControlMode":true,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": true,
      "ds501ControlMode": 1,
      "ds501DelaySeconds": 5,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": true,
    "ds501ControlMode": 1,
    "ds501DelaySeconds": 5,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 3b: Delayed Switch (after 5 s) — Disconnect / Open (OFF)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switchDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switchDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=1
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=5
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":false,"ds501ControlMode":true,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": false,
      "ds501ControlMode": 1,
      "ds501DelaySeconds": 5,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": false,
    "ds501ControlMode": 1,
    "ds501DelaySeconds": 5,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 4a: Scheduled Switch (2026-04-01 10:30 CST, repeat daily) — Connect / Close (ON)
Scheduled for 2026-04-01 10:30:00 CST (Unix timestamp 1775010600). Compute via: date -d '2026-04-01 10:30:00 +0800' +%s

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switchSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds501RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switchSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 1
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=2
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=1775010600
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": true,
      "ds501ControlMode": 2,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 1775010600,
      "ds501RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": true,
    "ds501ControlMode": 2,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 1775010600,
    "ds501RepeatDaily": true
  }
}

Example 4b: Scheduled Switch (2026-04-01 10:30 CST, repeat daily) — Disconnect / Open (OFF)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 switchSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds501RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 switchSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=2
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=1775010600
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":true,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": false,
      "ds501ControlMode": 2,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 1775010600,
      "ds501RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": false,
    "ds501ControlMode": 2,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 1775010600,
    "ds501RepeatDaily": true
  }
}

Example 5a: Delayed Lock / Unlock (after 5 s) — Lock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lockDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lockDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=1
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=5
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":true,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": true,
      "ds501ControlMode": 1,
      "ds501DelaySeconds": 5,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": true,
    "ds501ControlMode": 1,
    "ds501DelaySeconds": 5,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 5b: Delayed Lock / Unlock (after 5 s) — Unlock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lockDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lockDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 1
  ds501DelaySeconds: 5
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=1
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=5
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":true,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":false,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": false,
      "ds501ControlMode": 1,
      "ds501DelaySeconds": 5,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":1,"ds501DelaySeconds":5,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": false,
    "ds501ControlMode": 1,
    "ds501DelaySeconds": 5,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 6a: Scheduled Lock / Unlock (2026-04-01 10:30 CST, repeat daily) — Lock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lockSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=1 signed=1
    ds501ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds501RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lockSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 1
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=active
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=2
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=1775010600
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": true,
      "ds501ControlMode": 2,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 1775010600,
      "ds501RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":true,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": true,
    "ds501ControlMode": 2,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 1775010600,
    "ds501RepeatDaily": true
  }
}

Example 6b: Scheduled Lock / Unlock (2026-04-01 10:30 CST, repeat daily) — Unlock

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 lockSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds501RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 lockSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 2
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 1775010600
  ds501RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=2
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=1775010600
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":false,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": false,
      "ds501ControlMode": 2,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 1775010600,
      "ds501RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":2,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":1775010600,"ds501RepeatDaily":true}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": false,
    "ds501ControlMode": 2,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 1775010600,
    "ds501RepeatDaily": true
  }
}

Example 7: Cancel Switch Timer
Clears any pending delayed or scheduled connect/disconnect command for the socket.

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 cancelSwitchTimer
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 3
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: (unchanged)
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=3 signed=3
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch: (unchanged)
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 cancelSwitchTimer
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 1
  ds501ControlState: 0
  ds501ControlMode: 3
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  switch: (unchanged)
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=1
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=3
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  switch: (unchanged)
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 1,
      "ds501ControlState": false,
      "ds501ControlMode": 3,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":1,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 1,
    "ds501ControlState": false,
    "ds501ControlMode": 3,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}

Example 8: Cancel Lock Timer
Clears any pending delayed or scheduled lock/unlock command.

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 3 --sensorType DS-501 cancelLockTimer
Target: 192.168.31.205:502 | Slave ID: 3 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 3
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: (unchanged)
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds501ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds501ControlState -> register 10 (4x40011) raw=0 signed=0
    ds501ControlMode -> register 11 (4x40012) raw=3 signed=3
    ds501DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds501DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds501ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds501ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds501RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: (unchanged)
Link confirmation time: 0.133s
Control completed in: 0.144s
The script automatically writes registers and reads them back for verification. The Modbus Poll write guide section in the output can be used directly as a reference for manual writes in Modbus Poll.

Modbus Poll:

  1. Connect to the gateway (IP 192.168.31.205, Port 502, Slave ID 3)
  2. Menu Functions → 16 Write Multiple Registers
  3. Refer to the Modbus Poll write guide in the script output above for the Register Address and value to enter
  4. Click Send to send the write command

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 102 --sensorType DS-501 cancelLockTimer
Target: 192.168.31.205:47808 | BACnet ID: 102 | Sensor: DS-501
Expected values:
  ds501ControlTarget: 254
  ds501ControlState: 0
  ds501ControlMode: 3
  ds501DelaySeconds: 0
  ds501ScheduleTimestamp: 0
  ds501RepeatDaily: 0
Expected confirmed state:
  lockState: (unchanged)
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds501ControlTarget -> object analog-value,10204 | property present-value | type=analog-value | write=254
  ds501ControlState -> object binary-value,10205 | property present-value | type=binary-value | write=inactive
  ds501ControlMode -> object analog-value,10206 | property present-value | type=analog-value | write=3
  ds501DelaySeconds -> object analog-value,10207 | property present-value | type=analog-value | write=0
  ds501ScheduleTimestamp -> object analog-value,10208 | property present-value | type=analog-value | write=0
  ds501RepeatDaily -> object binary-value,10209 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: (unchanged)
Link confirmation time: 0.010s
Control completed in: 0.085s
The script automatically writes and reads back for verification. The YABE write guide section in the output can be used directly as a YABE manual-write reference.

YABE:

  1. Connect to the gateway (IP 192.168.31.205, Port 47808), expand Device 102
  2. Refer to the YABE write guide in the script output above to locate the corresponding object
  3. Right-click the object → Write Property, set the property to present-value, enter the target value, then click Write

IoT Hub HTTP:

Endpoint: POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
  -H "Content-Type: application/json" \
  -d '{"devEui":"ffffff1000048920","params":{"ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000048920",
    "status": "buffered"
  }
}

ChirpStack REST API:

Endpoint: POST http://192.168.31.205:8090/api/devices/ffffff1000048920/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000048920/queue' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

Formatted JSON payload:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-501",
      "ds501ControlTarget": 254,
      "ds501ControlState": false,
      "ds501ControlMode": 3,
      "ds501DelaySeconds": 0,
      "ds501ScheduleTimestamp": 0,
      "ds501RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000048920/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000048920","confirmed":false,"object":{"model":"DS-501","ds501ControlTarget":254,"ds501ControlState":false,"ds501ControlMode":3,"ds501DelaySeconds":0,"ds501ScheduleTimestamp":0,"ds501RepeatDaily":false}}'

Formatted JSON payload:

{
  "flushQueue": true,
  "devEui": "ffffff1000048920",
  "confirmed": false,
  "object": {
    "model": "DS-501",
    "ds501ControlTarget": 254,
    "ds501ControlState": false,
    "ds501ControlMode": 3,
    "ds501DelaySeconds": 0,
    "ds501ScheduleTimestamp": 0,
    "ds501RepeatDaily": false
  }
}