DS-103 LoRaWAN 三路开关用户手册

设备信息:型号 DS-103,devEui ffffff1000054348,网关 IP 192.168.31.205,Modbus Slave ID 15,BACnet Device ID 105

1 协议概览

DS-103 在 Fport 210 上报三路开关状态、锁定状态、定时器状态及信号质量。

1.1 上行数据协议(Fport 210)

载荷格式(Fport 210):

字节位置 字段 说明
0 保留 固定 0x00(协议版本)
1 … N TLV 对 [Type(1 B)][Value(N B)] … 循环至结束

每个 Type 字节决定字段名称和后续 value 字节数:

Type Value字节数 字段名称 编码方式 换算 单位 说明
0x01 1 model uint8 型号码 = 0x5C
0x79 4 timestamp uint32 BE s 设备本地 Unix 时间戳
0x96 1 lockState uint8 0=解锁 1=锁定
0x22 1 switch1State uint8 0=断开 1=闭合 — 第1次出现 = 第1路
0x22 1 switch2State uint8 0=断开 1=闭合 — 第2次出现 = 第2路
0x22 1 switch3State uint8 0=断开 1=闭合 — 第3次出现 = 第3路
0xB0 4 switchTimerStatus bitfield32 BE Bit 0=ch1关定时 Bit 1=ch1开定时 Bit 2=ch2关定时 Bit 3=ch2开定时 Bit 4=ch3关定时 Bit 5=ch3开定时 Bit 30=锁定定时 Bit 31=解锁定时

JavaScript 解码示例:

// DS-103 Three-Way Switch — Fport 210 uplink decoder
function decodeUplink(bytes) {
  var i = 1, r = {}, swIdx = 0;
  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: {
        // Three consecutive 0x22 values = switch1, switch2, switch3
        swIdx++;
        r['switch'+swIdx+'State'] = bytes[i++]; // 0=OFF  1=ON
        break;
      }
      case 0x79: r.timestamp = u32(bytes,i); i+=4; break;
      case 0x96: r.lockState = bytes[i++]; break;
      case 0xB0: {
        var bits = u32(bytes,i); i+=4;
        r.timerCloseEnabled1 = (bits&0x01)!==0;
        r.timerOpenEnabled1  = (bits&0x02)!==0;
        r.timerCloseEnabled2 = (bits&0x04)!==0;
        r.timerOpenEnabled2  = (bits&0x08)!==0;
        r.timerCloseEnabled3 = (bits&0x10)!==0;
        r.timerOpenEnabled3  = (bits&0x20)!==0;
        r.timerLockEnabled   = (bits&0x40000000)!==0;
        r.timerUnlockEnabled = (bits&0x80000000)!==0;
        break;
      }
      default: i++; break;
    }
  }
  return r;
}
// Example payload (hex): 00 01 5C 79 69 CC 83 28 96 00 22 01 22 01 22 00 B0 00 00 00 00
// → { model:92, timestamp:1775010600, lockState:0, switch1State:1, switch2State:1, switch3State:0 }

脚本下载:LPP.zip

版本说明: LPP.js 基于 ChirpStack v4.17.0 开发和测试。不同版本的 ChirpStack JavaScript 编解码器 API 可能存在差异——如果您使用的是其他版本,请在部署前检查并根据需要调整脚本。

1.2 下行控制协议

DS-103 支持按通道或全通道开关控制(立即/延时/定时)以及锁定和取消定时器,下行使用 Fport 2。

Fport:20x09 0x5C(设备型号标识头)

载荷格式:09 5C [CmdCode] [Target?] [Params...] Target 字节0x01=第1路(左),0x02=第2路(中),0x03=第3路(右),0xFF=全部通道。 T = 延时/定时时间(uint32 BE,延时为秒数,定时为 Unix 时间戳)。 R = 重复标志:0x00=仅一次,0x01=每天重复。 锁定/解锁指令没有 Target 字节。

命令码 载荷字节 说明
0x00 09 5C 00 [target] 断开指定通道
0x01 09 5C 01 [target] 闭合指定通道
0x02 09 5C 02 解锁
0x03 09 5C 03 锁定
0x04 09 5C 04 [target] T3 T2 T1 T0 延时断开指定通道(T 秒)
0x05 09 5C 05 [target] T3 T2 T1 T0 延时闭合指定通道(T 秒)
0x06 09 5C 06 [target] T3 T2 T1 T0 R 定时断开指定通道
0x07 09 5C 07 [target] T3 T2 T1 T0 R 定时闭合指定通道
0x08 09 5C 08 T3 T2 T1 T0 延时 T 秒后解锁
0x09 09 5C 09 T3 T2 T1 T0 延时 T 秒后锁定
0x0A 09 5C 0A T3 T2 T1 T0 R 定时解锁
0x0B 09 5C 0B T3 T2 T1 T0 R 定时锁定
0x0C 09 5C 0C [target] 取消指定通道定时
0x0D 09 5C 0D 取消锁定定时
0x0E 09 5C 0E 查询当前状态

JavaScript 编码器示例:

// DS-103 Three-Way Switch — Fport 2 downlink encoder
function encodeDownlink(data) {
  // data.command  : 'off'|'on'|'delayOff'|'delayOn'|'scheduleOff'|'scheduleOn'|
  //                 'lock'|'unlock'|'cancelTimer'|'cancelLockTimer'|'query'
  // data.channel  : 1|2|3|'all'  (required for switch commands)
  // data.delaySeconds / data.scheduleAt / data.repeatDaily
  var H = [0x09, 0x5C];
  var u32 = function(n){ return [(n>>>24)&0xFF,(n>>>16)&0xFF,(n>>>8)&0xFF,n&0xFF]; };
  var targetMap = {1:0x01, 2:0x02, 3:0x03, all:0xFF};
  var ch = (data.channel !== undefined) ? (targetMap[data.channel] || 0xFF) : 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 'off':           return H.concat([0x00, ch]);
    case 'on':            return H.concat([0x01, ch]);
    case 'unlock':        return H.concat([0x02]);
    case 'lock':          return H.concat([0x03]);
    case 'delayoff':      return H.concat([0x04, ch].concat(u32(T)));
    case 'delayon':       return H.concat([0x05, ch].concat(u32(T)));
    case 'scheduleoff':   return H.concat([0x06, ch].concat(u32(T)).concat([R]));
    case 'scheduleon':    return H.concat([0x07, ch].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':   return H.concat([0x0C, ch]);
    case 'cancellocktimer': return H.concat([0x0D]);
    case 'query':         return H.concat([0x0E]);
    default: return [];
  }
}
// Examples:
//   encodeDownlink({command:'on',   channel:1})            → [0x09,0x5C,0x01,0x01]
//   encodeDownlink({command:'off',  channel:'all'})        → [0x09,0x5C,0x00,0xFF]
//   encodeDownlink({command:'delayOn', channel:2, delaySeconds:60}) → [0x09,0x5C,0x05,0x02,0x00,0x00,0x00,0x3C]

2 获取上行数据

⚠️ 以下示例中的 IP 地址(192.168.31.205 / 192.168.31.193)、ChirpStack API token、Slave ID、BACnet Device ID 及 devEui 均为演示示例,请替换为实际网关 IP、ChirpStack API token 及设备参数。

2.1 ChirpStack MQTT 订阅

订阅 MQTT topic 以接收实时上行数据:

应用 ID3ef9e6b9-ec54-4eda-86b8-a5fb46899f39 是网关内置的出厂默认 ChirpStack 应用。
如果您创建了其他应用,请替换为实际的应用 ID。

网关 IP192.168.31.205 为示例网关 WAN 口 IP,
请替换为您实际的网关 IP 地址。

设备 EUIffffff1000054348 为示例设备 EUI,
请替换为网关设备列表中显示的实际 EUI;
也可用 + 通配符一次订阅所有设备的数据。
# 订阅指定设备
mosquitto_sub -h 192.168.31.205 -p 1883 \
  -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/event/up"

# 订阅所有应用下所有设备(通配符)
mosquitto_sub -h 192.168.31.205 -p 1883 \
  -u gateway -P mqtt88888888 \
  -t "application/+/device/+/event/up"

上行数据载荷示例(JSON):

{
  "devEui": "ffffff1000054348",
  "fPort": 210,
  "object": {
    ...  (已解码的 LPP 字段)
  }
}

2.2 IoT Hub HTTP API

发送 GET 请求获取设备最新状态:

curl -s "http://192.168.31.205:8070/api/getStatus?devEui=ffffff1000054348"
{
  "success": true,
  "result": {
    "ds103ControlState": false,
    "ds103RepeatDaily": false,
    "lockState": 0,
    "switch1State": false,
    "switch2State": false,
    "switch3State": false,
    "timestamp": 1775030018,
    "switchTimerStatus": 0,
    "timerCloseEnabled1": false,
    "timerOpenEnabled1": false,
    "timerCloseEnabled2": false,
    "timerOpenEnabled2": false,
    "timerCloseEnabled3": false,
    "timerOpenEnabled3": false,
    "timerLockEnabled": false,
    "timerUnlockEnabled": false,
    "model": "DS-103"
  }
}

2.3 IoT Hub Modbus TCP — Python 脚本

脚本下载:modbus_tcp_read.py

使用 modbus_tcp_read.py 一次性读取所有寄存器:

python3 modbus_tcp_read.py --ip 192.168.31.205 --port 502 \
    --slaveId 15 --sensorType DS-103
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
================================================================================================================================================================
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 CEF0           | 1775030000         | second
ds103ControlTarget       | 9      | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0000                | 0.0                | none
ds103ControlState        | 10     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
ds103ControlMode         | 11     | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0000                | 0.0                | none
ds103DelaySeconds        | 12     | 03  | Int32      | Big(ABCD)    | 2   | x1       | 0000 0000           | 0.0                | seconds
ds103ScheduleTimestamp   | 14     | 03  | UnixTime   | Big(ABCD)    | 2   | x1       | 0000 0000           | 0                  | seconds
ds103RepeatDaily         | 16     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
lockState                | 17     | 03  | Int16      | Big(ABCD)    | 1   | x1       | 0000                | 0.0                | none
switch1State             | 18     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
switch2State             | 19     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
switch3State             | 20     | 03  | Bit/Bool   | Big(ABCD)    | 1   | x1       | 0000                | false              | none
... (25 fields total)

2.4 IoT Hub Modbus TCP — Modbus Poll

工具下载:Modbus Poll 9.5.0.1507.zip

  1. 打开 Modbus Poll,连接 192.168.31.205:502,Slave ID 15
  2. 菜单 Setup → Read/Write Definition,功能码选 FC03,起始地址 6,长度 65
  3. 点击 OK — 数值实时刷新

2.5 IoT Hub BACnet BIP — Python 脚本

脚本下载:bacnet_read.py

使用 bacnet_read.py 读取所有 BACnet 对象:

python3 bacnet_read.py --ip 192.168.31.205 --port 47808 --id 105
Target: 192.168.31.205:47808 | BACnet ID: 105 | Scan: 10500-10599
------------------------------------------------------------
Type | Instance | Offset | Value                    | Object Name
------------------------------------------------------------
BI   | 10502    | 2      | active                   | ffffff1000054348.online
AI   | 10503    | 3      | 1775030016.00            | ffffff1000054348.lastOnlineTime
AV   | 10504    | 4      | 0.00                     | ffffff1000054348.ds103ControlTarget
BV   | 10505    | 5      | inactive                 | ffffff1000054348.ds103ControlState
AV   | 10506    | 6      | 0.00                     | ffffff1000054348.ds103ControlMode
AV   | 10507    | 7      | 0.00                     | ffffff1000054348.ds103DelaySeconds
AV   | 10508    | 8      | 0.00                     | ffffff1000054348.ds103ScheduleTimestamp
BV   | 10509    | 9      | inactive                 | ffffff1000054348.ds103RepeatDaily
BV   | 10510    | 10     | inactive                 | ffffff1000054348.lockState
BV   | 10511    | 11     | inactive                 | ffffff1000054348.switch1State
BV   | 10512    | 12     | inactive                 | ffffff1000054348.switch2State
BV   | 10513    | 13     | inactive                 | ffffff1000054348.switch3State
... (28 objects total)

2.6 IoT Hub BACnet BIP — YABE

工具下载:SetupYabe_v2.1.0.exe

  1. 打开 YABE,连接 192.168.31.205:47808
  2. 在设备树中展开设备 105
  3. 浏览 AI/BI/AV/BV/CV 对象,查看实时数值

3 发送控制指令

DS-103 支持按通道或全通道开关控制(立即/延时/定时)以及锁定和取消定时器,下行使用 Fport 2。

⚠️ 以下示例中的 IP 地址(192.168.31.205 / 192.168.31.193)、ChirpStack API token、Slave ID、BACnet Device ID 及 devEui 均为演示示例,请替换为实际网关 IP、ChirpStack API token 及设备参数。

脚本下载:modbus_tcp_write.py · bacnet_write.py

示例 1a:立即闭合 / 断开左路开关(闭合)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel left --value 1
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch1State: 1
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel left --value 1
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch1State: 1
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": true,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": true,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 1b:立即闭合 / 断开左路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel left --value 0
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch1State: 0
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel left --value 0
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch1State: 0
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": false,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": false,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 2a:立即闭合 / 断开中路开关(闭合)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel middle --value 1
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch2State: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch2State: 1
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel middle --value 1
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch2State: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch2State: 1
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": true,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": true,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 2b:立即闭合 / 断开中路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel middle --value 0
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch2State: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch2State: 0
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel middle --value 0
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch2State: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch2State: 0
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": false,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": false,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 3a:立即闭合 / 断开右路开关(闭合)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel right --value 1
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch3State: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch3State: 1
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel right --value 1
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch3State: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch3State: 1
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": true,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": true,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 3b:立即闭合 / 断开右路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel right --value 0
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch3State: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch3State: 0
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel right --value 0
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch3State: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch3State: 0
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": false,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": false,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 4a:立即闭合 / 断开全部开关(闭合)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel all --value 1
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch1State: 1
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel all --value 1
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch1State: 1
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": true,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": true,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 4b:立即闭合 / 断开全部开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switch --channel all --value 0
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch1State: 0
Link confirmation time: 5.167s
Control completed in: 5.178s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switch --channel all --value 0
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch1State: 0
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": false,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": false,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 5a:锁定 / 解锁所有开关(锁定)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lock --value 1
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 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
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: 1
Link confirmation time: 5.000s
Control completed in: 5.010s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lock --value 1
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  lockState: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: 1
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": true,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": true,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 5b:锁定 / 解锁所有开关(解锁)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lock --value 0
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 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
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=0 signed=0
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: 0
Link confirmation time: 5.000s
Control completed in: 5.010s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lock --value 0
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 0
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  lockState: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=0
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: 0
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": false,
      "ds103ControlMode": 0,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":0,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": false,
    "ds103ControlMode": 0,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 6a:延时 5 秒后闭合 / 断开左路开关(闭合)
设备收到指令后,延迟 5 秒再执行开关动作。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel left --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel left --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": true,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": true,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 6b:延时 5 秒后闭合 / 断开左路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel left --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel left --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": false,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": false,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 7a:延时 5 秒后闭合 / 断开中路开关(闭合)
设备收到指令后,延迟 5 秒再执行开关动作。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel middle --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel middle --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": true,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": true,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 7b:延时 5 秒后闭合 / 断开中路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel middle --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel middle --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": false,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": false,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 8a:延时 5 秒后闭合 / 断开右路开关(闭合)
设备收到指令后,延迟 5 秒再执行开关动作。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel right --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel right --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": true,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": true,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 8b:延时 5 秒后闭合 / 断开右路开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel right --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel right --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": false,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": false,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 9a:延时 5 秒后闭合 / 断开全部开关(闭合)
设备收到指令后,延迟 5 秒再执行开关动作。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel all --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel all --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": true,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": true,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 9b:延时 5 秒后闭合 / 断开全部开关(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchDelay --channel all --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchDelay --channel all --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": false,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": false,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 10a:定时每天闭合 / 断开左路开关(2026-04-01 10:30)(闭合)
定时 2026-04-01 10:30:00(CST)时间戳 1775010600,每天重复。可通过 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 15 --sensorType DS-103 switchSchedule --channel left --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel left --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": true,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": true,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 10b:定时每天闭合 / 断开左路开关(2026-04-01 10:30)(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchSchedule --channel left --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel left --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": false,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": false,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 11a:定时每天闭合 / 断开中路开关(2026-04-01 10:30)(闭合)
定时 2026-04-01 10:30:00(CST)时间戳 1775010600,每天重复。可通过 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 15 --sensorType DS-103 switchSchedule --channel middle --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel middle --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": true,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": true,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 11b:定时每天闭合 / 断开中路开关(2026-04-01 10:30)(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchSchedule --channel middle --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=2 signed=2
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel middle --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 2
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=2
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 2,
      "ds103ControlState": false,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":2,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 2,
    "ds103ControlState": false,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 12a:定时每天闭合 / 断开右路开关(2026-04-01 10:30)(闭合)
定时 2026-04-01 10:30:00(CST)时间戳 1775010600,每天重复。可通过 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 15 --sensorType DS-103 switchSchedule --channel right --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel right --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": true,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": true,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 12b:定时每天闭合 / 断开右路开关(2026-04-01 10:30)(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchSchedule --channel right --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=3 signed=3
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel right --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 3
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=3
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 3,
      "ds103ControlState": false,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":3,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 3,
    "ds103ControlState": false,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 13a:定时每天闭合 / 断开全部开关(2026-04-01 10:30)(闭合)
定时 2026-04-01 10:30:00(CST)时间戳 1775010600,每天重复。可通过 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 15 --sensorType DS-103 switchSchedule --channel all --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel all --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": true,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": true,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 13b:定时每天闭合 / 断开全部开关(2026-04-01 10:30)(断开)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 switchSchedule --channel all --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=255 signed=255
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 switchSchedule --channel all --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 255
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=255
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 255,
      "ds103ControlState": false,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":255,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 255,
    "ds103ControlState": false,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 14a:延时 5 秒后锁定 / 解锁(锁定)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lockDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lockDelay --value 1 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": true,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": true,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 14b:延时 5 秒后锁定 / 解锁(解锁)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lockDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=1 signed=1
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=5 signed=5
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lockDelay --value 0 --delaySeconds 5
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 1
  ds103DelaySeconds: 5
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=1
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=5
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": false,
      "ds103ControlMode": 1,
      "ds103DelaySeconds": 5,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":1,"ds103DelaySeconds":5,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": false,
    "ds103ControlMode": 1,
    "ds103DelaySeconds": 5,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 15a:定时每天锁定 / 解锁(2026-04-01 10:30)(锁定)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lockSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=1 signed=1
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lockSchedule --value 1 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 1
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=active
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": true,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":true,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": true,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 15b:定时每天锁定 / 解锁(2026-04-01 10:30)(解锁)

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 lockSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=2 signed=2
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=27084 signed=27084
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=33576 signed=-31960
    ds103RepeatDaily -> register 16 (4x40017) raw=1 signed=1
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 lockSchedule --value 0 --scheduleTimestamp 1775010600 --repeatDaily
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 2
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 1775010600
  ds103RepeatDaily: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=2
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=1775010600
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=active
No immediate read-back confirmation defined for this command.
Control completed in: 0.011s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": false,
      "ds103ControlMode": 2,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 1775010600,
      "ds103RepeatDaily": true
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":2,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":1775010600,"ds103RepeatDaily":true}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": false,
    "ds103ControlMode": 2,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 1775010600,
    "ds103RepeatDaily": true
  }
}

示例 16:取消延时/定时开关指令(以左路为例)
取消指定通道的延时/定时闭合或断开指令。可将 --channel left/middle/right/all 改为对应通道。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 cancelSwitchTimer --channel left
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 3
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: (unchanged)
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
  Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 8
    ds103ControlTarget -> register 9 (4x40010) raw=1 signed=1
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=3 signed=3
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  switch1State: (unchanged)
Link confirmation time: 5.000s
Control completed in: 5.010s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 cancelSwitchTimer --channel left
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 1
  ds103ControlState: 0
  ds103ControlMode: 3
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  switch1State: (unchanged)
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=1
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=3
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  switch1State: (unchanged)
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 1,
      "ds103ControlState": false,
      "ds103ControlMode": 3,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":1,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 1,
    "ds103ControlState": false,
    "ds103ControlMode": 3,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}

示例 17:取消延时/定时锁定指令
取消延时/定时锁定指令。

Modbus TCP:

python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 15 --sensorType DS-103 cancelLockTimer
Target: 192.168.31.205:502 | Slave ID: 15 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 3
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 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
    ds103ControlTarget -> register 9 (4x40010) raw=254 signed=254
    ds103ControlState -> register 10 (4x40011) raw=0 signed=0
    ds103ControlMode -> register 11 (4x40012) raw=3 signed=3
    ds103DelaySeconds -> register 12 (4x40013) raw=0 signed=0
    ds103DelaySeconds -> register 13 (4x40014) raw=0 signed=0
    ds103ScheduleTimestamp -> register 14 (4x40015) raw=0 signed=0
    ds103ScheduleTimestamp -> register 15 (4x40016) raw=0 signed=0
    ds103RepeatDaily -> register 16 (4x40017) raw=0 signed=0
Observed values:
  lockState: (unchanged)
Link confirmation time: 5.000s
Control completed in: 5.010s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。

Modbus Poll:

  1. 连接网关(IP 192.168.31.205,端口 502,Slave ID 15
  2. 菜单 Functions → 16 Write Multiple Registers
  3. 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
  4. 点击 Send 发送写入指令

BACnet BIP:

python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 105 --sensorType DS-103 cancelLockTimer
Target: 192.168.31.205:47808 | BACnet ID: 105 | Sensor: DS-103
Expected values:
  ds103ControlTarget: 254
  ds103ControlState: 0
  ds103ControlMode: 3
  ds103DelaySeconds: 0
  ds103ScheduleTimestamp: 0
  ds103RepeatDaily: 0
Expected confirmed state:
  lockState: (unchanged)
Attempt 1/1: writing control values (default)...
YABE write guide:
  ds103ControlTarget -> object analog-value,10504 | property present-value | type=analog-value | write=254
  ds103ControlState -> object binary-value,10505 | property present-value | type=binary-value | write=inactive
  ds103ControlMode -> object analog-value,10506 | property present-value | type=analog-value | write=3
  ds103DelaySeconds -> object analog-value,10507 | property present-value | type=analog-value | write=0
  ds103ScheduleTimestamp -> object analog-value,10508 | property present-value | type=analog-value | write=0
  ds103RepeatDaily -> object binary-value,10509 | property present-value | type=binary-value | write=inactive
Observed values:
  lockState: (unchanged)
Link confirmation time: 0.010s
Control completed in: 0.086s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。

YABE:

  1. 连接网关(IP 192.168.31.205,端口 47808),展开设备 105
  2. 参照上方脚本输出中的 YABE write guide,找到对应对象
  3. 右键该对象 → Write Property,属性选 present-value,填入目标值后点击 Write

IoT Hub HTTP:

接口路径: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":"ffffff1000054348","params":{"ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'
{
  "success": true,
  "result": {
    "devEui": "ffffff1000054348",
    "status": "buffered"
  }
}

ChirpStack REST API:

接口路径:POST http://192.168.31.205:8090/api/devices/ffffff1000054348/queue

curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff1000054348/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-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}}'
{
  "id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "queueItem": {
    "confirmed": false,
    "isPending": false,
    "object": {
      "model": "DS-103",
      "ds103ControlTarget": 254,
      "ds103ControlState": false,
      "ds103ControlMode": 3,
      "ds103DelaySeconds": 0,
      "ds103ScheduleTimestamp": 0,
      "ds103RepeatDaily": false
    }
  }
}

ChirpStack MQTT:

mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
  -t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff1000054348/command/down" \
  -m '{"flushQueue":true,"devEui":"ffffff1000054348","confirmed":false,"object":{"model":"DS-103","ds103ControlTarget":254,"ds103ControlState":false,"ds103ControlMode":3,"ds103DelaySeconds":0,"ds103ScheduleTimestamp":0,"ds103RepeatDaily":false}}'

格式化后的 JSON 内容:

{
  "flushQueue": true,
  "devEui": "ffffff1000054348",
  "confirmed": false,
  "object": {
    "model": "DS-103",
    "ds103ControlTarget": 254,
    "ds103ControlState": false,
    "ds103ControlMode": 3,
    "ds103DelaySeconds": 0,
    "ds103ScheduleTimestamp": 0,
    "ds103RepeatDaily": false
  }
}