JTY-AN-503A LoRaWAN Smoke Detector User Guide
Device Information: Model JTY-AN-503A, devEui ffffff100004e970, gateway IP 192.168.31.205, Modbus Slave ID 5, BACnet Device ID 104
1 Protocol Overview
The JTY-AN-503A reports smoke event, smoke status, alarm status, battery voltage, tamper status, and signal quality on Fport 210.
1.1 Uplink Data Protocol (Fport 210)
Payload format (Fport 210):
| Byte | Field | Description |
|---|---|---|
| 0 | Reserved | Always 0x00 (protocol version) |
| 1 … N | TLV pairs | [Type(1 B)][Value(N B)] … repeating until end |
Each Type byte determines the field name and the number of following value bytes:
| Type | Value Bytes | Field Name | Encoding | Scale | Unit | Notes |
|---|---|---|---|---|---|---|
0x01 |
1 | model |
uint8 | — | — | Model code = 0x51 |
0x84 |
1 | smokeStatus |
uint8 | — | — | 0=normal 1=smoke alarm (status) |
0x31 |
1 | smokeEvent |
uint8 | — | — | 0=normal 1=smoke event triggered |
0x10 |
2 | temperature |
int16 BE | ÷100 | °C | e.g. 0x09F6=2550 → 25.50 °C |
0x77 |
1 | tamperState |
uint8 | — | — | 0=normal 1=tampered |
0x82 |
1 | selfCheckEvent |
uint8 | — | — | 0=normal 1=self-check event |
0x04 |
2 | batteryVoltage |
uint16 BE | ÷1000 | V | mV raw value ÷1000 = V |
0x05 |
1 | batteryLowEvent |
uint8 | — | — | 0=normal 1=low-voltage event |
JavaScript Decoder Example:
// JTY-AN-503A Smoke Detector — Fport 210 uplink decoder
function decodeUplink(bytes) {
var i = 1, r = {};
function u16(b,o){ return (b[o]<<8)|b[o+1]; }
function i16(b,o){ var v=u16(b,o); return v>32767?v-65536:v; }
while (i < bytes.length) {
var t = bytes[i++];
switch (t) {
case 0x01: r.model = bytes[i++]; break;
case 0x04: r.batteryVoltage = u16(bytes,i)/1000; i+=2; break;
case 0x05: r.batteryLowEvent = bytes[i++]; break;
case 0x10: r.temperature = i16(bytes,i)/100; i+=2; break;
case 0x31: r.smokeEvent = bytes[i++]; break; // 0=normal 1=alarm
case 0x77: r.tamperState = bytes[i++]; break;
case 0x82: r.selfCheckEvent = bytes[i++]; break;
case 0x84: r.smokeStatus = bytes[i++]; break; // 0=normal 1=alarm
default: i++; break;
}
}
return r;
}
// Example payload (hex): 00 01 51 84 00 31 00 10 09 B8 77 00
// → { model:81, smokeStatus:0, smokeEvent:0, temperature:25.04, tamperState:0 }
Script download: LPP.zip
Compatibility note: LPP.js is developed and tested against ChirpStack v4.17.0. The ChirpStack JavaScript codec API may differ across versions — if you are running a different ChirpStack version, review and adjust the script as needed before deployment.
2 Getting Uplink Data
⚠️ The IP addresses (192.168.31.205/192.168.31.193), ChirpStack API token, Slave ID, BACnet Device ID, and devEui in the examples below are for demonstration only. Replace them with your actual gateway IP, ChirpStack API token, and device parameters.
2.1 ChirpStack MQTT Subscription
Subscribe to the MQTT topic to receive real-time uplink frames:
Application ID —3ef9e6b9-ec54-4eda-86b8-a5fb46899f39is the factory-default ChirpStack
application built into the gateway. Replace it with your actual application
ID if you have created a different one.
Gateway IP —192.168.31.205is the gateway WAN port IP shown as an
example. Replace it with your actual gateway IP address.
Device EUI —ffffff100004e970is the EUI of the example device.
Replace it with the EUI shown in the gateway device list, or use+
as a wildcard to subscribe to all devices at once.
# Subscribe to one specific device
mosquitto_sub -h 192.168.31.205 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff100004e970/event/up"
# Subscribe to ALL devices on ALL applications (wildcard)
mosquitto_sub -h 192.168.31.205 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/+/device/+/event/up"
Example uplink payload (JSON):
{
"devEui": "ffffff100004e970",
"fPort": 210,
"object": {
... (decoded LPP fields)
}
}
2.2 IoT Hub HTTP API
Send a GET request to retrieve the latest device state:
curl -s "http://192.168.31.205:8070/api/getStatus?devEui=ffffff100004e970"
{
"success": true,
"result": {
"batteryVoltage": 3.09,
"batteryVoltageState": 0,
"tamper": 1,
"tamperEvent": 0,
"smokeStatus": 0,
"selfCheckEvent": 0,
"model": "JTY-AN-503A"
}
}
2.3 IoT Hub Modbus TCP — Python Script
Script download: modbus_tcp_read.py
Use modbus_tcp_read.py to poll all registers at once:
python3 modbus_tcp_read.py --ip 192.168.31.205 --port 502 \
--slaveId 5 --sensorType JTY-AN-503A
Target: 192.168.31.205:502 | Slave ID: 5 | Sensor: JTY-AN-503A
================================================================================================================================================================
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 8E5D | 1775013469 | second
temperature | 9 | 03 | Int16(S) | Big(ABCD) | 1 | /100 | 0000 | 0.0 | celsius
batteryVoltage | 10 | 03 | Int16(S) | Big(ABCD) | 1 | /100 | 0135 | 3.09 | volt
batteryVoltageState | 11 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
tamper | 12 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0001 | 1.0 | none
tamperEvent | 13 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
smokeEvent | 14 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
smokeStatus | 15 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
selfCheckEvent | 16 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
model | 41 | 03 | String(24B) | ASCII | 12 | x1 | 4A54 592D 414E 2D35 ... | JTY-AN-503A | none
rssi | 53 | 03 | Int16 | Big(ABCD) | 1 | x1 | FFC5 | -59.0 | none
... (13 fields total)
2.4 IoT Hub Modbus TCP — Modbus Poll
Tool download: Modbus Poll 9.5.0.1507.zip
- Open Modbus Poll, connect to
192.168.31.205:502, Slave ID5 - Menu Setup → Read/Write Definition, set Function Code = FC03, Start Address =
6, Length =49 - Click OK — values update in real-time
2.5 IoT Hub BACnet BIP — Python Script
Script download: bacnet_read.py
Use bacnet_read.py to read all BACnet objects:
python3 bacnet_read.py --ip 192.168.31.205 --port 47808 --id 104
Target: 192.168.31.205:47808 | BACnet ID: 104 | Scan: 10400-10499
------------------------------------------------------------
Type | Instance | Offset | Value | Object Name
------------------------------------------------------------
BI | 10402 | 2 | active | ffffff100004e970.online
AI | 10403 | 3 | 1775013504.00 | ffffff100004e970.lastOnlineTime
AI | 10404 | 4 | 0.00 | ffffff100004e970.temperature
AI | 10405 | 5 | 3.09 | ffffff100004e970.batteryVoltage
AI | 10406 | 6 | 0.00 | ffffff100004e970.batteryVoltageState
AI | 10407 | 7 | 1.00 | ffffff100004e970.tamper
AI | 10408 | 8 | 0.00 | ffffff100004e970.tamperEvent
AI | 10409 | 9 | 0.00 | ffffff100004e970.smokeEvent
AI | 10410 | 10 | 0.00 | ffffff100004e970.smokeStatus
AI | 10411 | 11 | 0.00 | ffffff100004e970.selfCheckEvent
CV | 10415 | 15 | JTY-AN-503A | ffffff100004e970.model
AI | 10416 | 16 | -59.00 | ffffff100004e970.rssi
... (13 objects total)
2.6 IoT Hub BACnet BIP — YABE
Tool download: SetupYabe_v2.1.0.exe
- Open YABE, connect to
192.168.31.205:47808 - Expand Device 104 in the device tree
- Browse AI/BI/AV/BV/CV objects to view real-time values