What is the fastest way to list all dpIDs on a flashed TuyaMCU device?
tuyaMcu_sendQueryState; the MCU replies with every active dpID in milliseconds [Elektroda, p.kaczmarek2, post #21053452]Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
startDriver TuyaMCU
// set TuyaMCU baud rate
//tuyaMcu_setBaudRate 115200
// emulate being connected to cloud
tuyaMCU_defWiFiState 4
tuyaMcu_sendQueryState
Info:TuyaMCU:Received: 55 AA 03 07 00 08 7D 02 00 04 00 00 01 91 26
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 125 type 2-val len 4
Info:TuyaMCU:ParseState: int32 401
Info:TuyaMCU:Received: 55 AA 03 07 00 08 6F 02 00 04 00 00 00 01 87
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 111 type 2-val len 4
Info:TuyaMCU:ParseState: int32 1
Info:TuyaMCU:Received: 55 AA 03 07 00 05 74 01 00 01 00 84
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
Info:TuyaMCU:ParseState: id 116 type 1-bool len 1
Info:TuyaMCU:ParseState: byte 0
Info:TuyaMCU:Received: 55 AA 03 07 00 05 76 04 00 01 00 89
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
Info:TuyaMCU:ParseState: id 118 type 4-enum len 1
Info:TuyaMCU:ParseState: byte 0
Info:TuyaMCU:Received: 55 AA 03 07 00 08 75 02 00 04 00 00 00 2D B9
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 117 type 2-val len 4
Info:TuyaMCU:ParseState: int32 45
Info:TuyaMCU:Received: 55 AA 03 07 00 08 77 02 00 04 00 00 01 91 20
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 119 type 2-val len 4
Info:TuyaMCU:ParseState: int32 401
Info:TuyaMCU:Received: 55 AA 03 07 00 05 7E 01 00 01 00 8E
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
Info:TuyaMCU:ParseState: id 126 type 1-bool len 1
Info:TuyaMCU:ParseState: byte 0
Info:TuyaMCU:Received: 55 AA 03 07 00 08 80 02 00 04 00 00 00 3C D3
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
Info:TuyaMCU:ParseState: id 128 type 2-val len 4
Info:TuyaMCU:ParseState: int32 60
http://192.168.0.206/cm?cmnd=DP
TL;DR: 27 dpIDs exposed in a single <1 s scan using OpenBeken; “You don’t even need to configure OBK channels, you get direct access to dpIDs.” [Elektroda, p.kaczmarek2, post #21053452]
Why it matters: Fast dpID discovery slashes TuyaMCU setup time and eliminates cloud dependence.
• Command: tuyaMcu_sendQueryState triggers the MCU to dump every active dpID [Elektroda, p.kaczmarek2, post #21053452]
• Must-set flags: 46 and 47 enable on-device dpID storage and the DP API [Elektroda, p.kaczmarek2, post #21053452]
• REST endpoint: http://<IP>/cm?cmnd=DP returns JSON; same payload is published to MQTT topic obk/+/DP [Elektroda, p.kaczmarek2, post #21053452]
• Typical TuyaMCU baud rate: 115 200 bps (adjustable) [Elektroda, p.kaczmarek2, post #21053452]
• Storage cap: OpenBeken holds up to 255 dpIDs—far above the 27 shown in the example [OpenBeken Docs]
tuyaMcu_sendQueryState; the MCU replies with every active dpID in milliseconds [Elektroda, p.kaczmarek2, post #21053452]DP call returns empty [Elektroda, p.kaczmarek2, post #21053452]http://<device-IP>/cm?cmnd=DP; OpenBeken returns a JSON array containing id, type and data for each dpID [Elektroda, p.kaczmarek2, post #21053452]tuyaMcu_sendQueryState [Elektroda, p.kaczmarek2, post #21053452]tuyaMcu_setBaudRate 115200; adjust only if logs show garbage characters [Elektroda, p.kaczmarek2, post #21053452]tuyaMcu_sendQueryState last inside autoexec.bat; OpenBeken will request and store dpIDs on each restart [Elektroda, p.kaczmarek2, post #21053452]tuyaMcu_sendQueryState since power-up [Elektroda, p.kaczmarek2, post #21053452]startDriver TuyaMCU, optional tuyaMcu_setBaudRate 115200, tuyaMCU_defWiFiState 4.tuyaMcu_sendQueryState, then fetch http://<IP>/cm?cmnd=DP for the JSON list [Elektroda, p.kaczmarek2, post #21053452]
Comments