logo elektroda
logo elektroda
X
logo elektroda

Tuya Combustible Gas Alarm DY-RQ400A WB2S Setup, Features, and Data Points - WIP

divadiow 2697 14
ADVERTISEMENT
  • Helpful post
    #1 21136431
    divadiow
    Level 38  
    Here I will document my journey, however long that might be, with a Tuya Combustible Gas Alarm model DY-RQ400A which employs a WB2S (BK7231T) module in tandem with a Runjet RJM8L151F6P6 MCU, (Chinese and machine-translated English datasheet attached).

    PCB with electronic components. Close-up of the internal circuitry of the Tuya gas alarm model DY-RQ400A. Tuya DY-RQ400A-W module on a wooden table. Printed circuit board of Tuya combustible gas alarm model DY-RQ400A. Close-up of a circuit board for the Tuya DY-RQ400A gas alarm with electronic components.
    Tuya DY-RQ400A gas sensor on a wooden table. Electrical plug with RESET label and locking mechanism on a wooden surface. A printed circuit board with electronics and wires on a wooden table. Close-up of the inside of a flammable gas alarm showing the Runjet RJM8L151F6P6 chip on a circuit board. Tuya DY-RQ400A gas alarm module on a wooden table.
    Plug-in combustible gas alarm with a red button.

    User manual for a gas alarm with configuration and diagnostics details. WiFi combustible gas alarm instruction manual with description, installation instructions, and specifications.

    And inside the Tuya app when paired

    Device update screen showing No updates available. Screenshot of an app displaying gas alarm settings with various configuration options. Tuya app interface showing a connected gas sensor and an offline motion sensor. Gas sensor app screen showing No gas alarm and a reading of 0.1 LEL.

    A quick Google for the model of this device shows that other teardowns, with nice pictures, are available elsewhere, so I feel the need to investigate everything as if it was a total unknown is somewhat reduced. The datapoint IDs are as follows:

    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    One of the first things I did was connect up to 2TX to check the boot output:

    Code: Text
    Log in, to see the code


    Unexpectedly, the MCU does not get in the way of firmware dump for me on this device, and so I attach the backup file.

    A quick gander at the MCU comms in one direction with TuyaMCU Explorer during boot, pairing and then a self-test - which I've highlighted in this pic - dpID9

    Screenshot of TuyaMCU Explorer/Analyzer with packet data.

    Before I flash OpenBeken I'd like to do some more TuyaMCU analysis and probably film the device LED behaviour through pairing mode, dormancy and alarm sounding. For now I will park this because I need to fit a new kitchen tap and service the car! 😁
    Attachments:
    • readResult_BK7231T_QIO_2024-28-6-22-41-09.bin (2 MB) You must be logged in to download this attachment.
    • EN_RJM8L151F6P6.pdf (9.79 MB) You must be logged in to download this attachment.
    • CN_RJM8L151F6P6.pdf (3.13 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • Helpful post
    #2 21138809
    p.kaczmarek2
    Moderator Smart Home
    Thank you for your presentation. I am really starting to think that we need a way to support custom enumerations more easily.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21139592
    divadiow
    Level 38  
    So with Tuya firmware, when first plugged in it'll do a little test siren and flash its single tri-colour 5050 SMD LED red, green then blue. When it's in pairing mode it semi-fast flash green.





    once paired it'll be a static green if no elevated gas levels are detected

    Gas sensor connected to a power strip with a green LED indicator.

    then you can press the button at paired or unpaired state to start a self-test. this can also be done from the app.





    Sensor pre-heating indicator LED cycle





    Lighter fluid bursts from a lighter didn't seem to set it off but isobutane mix Capingaz certainly did. A single button press clears the alarm state





    Added after 1 [hours] 46 [minutes]:

    I believe the combustible gas sensor to be a Winsen MP-4

    Code: Text
    Log in, to see the code

    Combustible gas sensor Winsen MP-4 shown from the side with four pins.

    Winsen MP-4 gas sensor specifications table.
    Attachments:
    • mp-4(v1_5)-manual.pdf (770.64 KB) You must be logged in to download this attachment.
  • Helpful post
    #4 21139756
    divadiow
    Level 38  
    regarding my earlier detection for isobutane, ChatGPT notes the following after analysing the Winsen datasheet

    Code: Text
    Log in, to see the code


    Added after 8 [hours] 57 [minutes]:

    I've soldered the device back up to two USB-TTL adaptors to look at the MCU behaviour.

    Here is power-up, pre-heating and finally short bursts of lighter fluid into the sensor.

    Code: Text
    Log in, to see the code


    It's fascinating to see dpID5 (Range: 0 to 1000 (LEL - Lower Explosive Limit)) levels change as the gas is suddenly present and then the values drop as it dissipates:

    Screenshot of TuyaMCU Explorer/Analyzer program.

    Added after 26 [minutes]:

    boot with notes:

    Screenshot of the TuyaMCU Explorer application showing WiFi communication data and gas sensor status.

    lighter fluid emission with notes:

    Screenshot of the TuyaMCU Explorer/Analyzer software showing data from a WiFi module.
  • #5 21140157
    p.kaczmarek2
    Moderator Smart Home
    Nice progress. By the way, this dpID:
    
    DP 12, BOOL(rw), alarm_switch (报警开关) (alarm switch)
    

    it's marked as RW (Read/Write) instead of RO (Read Only), does it mean that you can just enable the alarm at any moment from the OBK? So the alarm could be reused as alarm for, I don't know, other sensor?
    Helpful post? Buy me a coffee.
  • #6 21141009
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    it's marked as RW (Read/Write) instead of RO (Read Only), does it mean that you can just enable the alarm at any moment from the OBK? So the alarm could be reused as alarm for, I don't know, other sensor?


    not sure yet, just started to play.

    I've done the basic ro enums and other bits

    OpenBK_BK7231T_WB2S_Gas interface screen with test buttons.

    Code: Text
    Log in, to see the code


    dpID 12 button doesn't do anything. dpID 9 button makes the LED do a little colour sequence only

    Added after 8 [hours] 44 [minutes]:

    I thnk I'm going to reflash back to factory to capture more MCU data from actions taken in the Tuya app.

    It's shame I can't get a flash of the factory fw into a pairing state on a dev WB3S so I can work on OBK/factory in parallel. I'm guessing the WB3S is waiting for something from the MCU, which isn't there.

    Do I remember correctly seeing some post once about faking a series of MCU responses so a factory fw would complete boot? I might be misremembering.
  • ADVERTISEMENT
  • #7 21141202
    p.kaczmarek2
    Moderator Smart Home
    divadiow wrote:

    Do I remember correctly seeing some post once about faking a series of MCU responses so a factory fw would complete boot? I might be misremembering.

    I've actually made something opposite - faking a series of WiFi module responses:
    Screenshot of a WiFi module simulation app for battery device testers.
    It seems that you need an opposite thing. Or maybe you can just do that with Realterm?
    Helpful post? Buy me a coffee.
  • #8 21141213
    divadiow
    Level 38  
    oh. I don't recall seeing that tool before. I'll have a go at Realterm or just flash between OBK/factory

    Added after 48 [seconds]:

    p.kaczmarek2 wrote:
    I've actually made something opposite - faking a series of WiFi module responses:

    yes. probably what I remember

    Added after 2 [hours] 10 [minutes]:

    on a different note, and to hit the 600 device milestone (oh, too late), this device could be added. The template won't change but the autoexec is obviously a work in progress.

    https://github.com/OpenBekenIOT/webapp/pull/129

    Added after 11 [hours] 16 [minutes]:

    so yes, you can initiate a self-test (auto-detect toggle) but it'll only sound for a fixed short period.

    Screenshot of gas alarm settings with Auto-Detect switch highlighted in red.

    so far:

    OpenBK_BK7231T_WB2S_Gas interface with various buttons and statuses

    Added after 4 [minutes]:

    and when you toggle dpID9 self-test, the button goes green while in test mode, the checking status value changes to 0 and the alarm state changes to 0. When complete dpID 9 button goes red again

    OpenBK interface panel with self-test and alarm mode enabled.

    Added after 57 [minutes]:

    most readings and functions are in place. the alarm duration (1-180s) selection is not yet sorted. I don't imagine 180 buttons with individual hex sends it the best way to make that available!

    So far

    User interface of OpenBK BK7231T WB2S for gas detector management.

    with

    Code: Text
    Log in, to see the code
  • Helpful post
    #9 21142379
    p.kaczmarek2
    Moderator Smart Home
    Maybe TextField button can be used for alarm duration (1-180s)?
    I've used it in the past for the timer:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    This is how TextField looks like:
    Screenshot of the WinTest_3145CAFF application interface with a text field and buttons.
    Helpful post? Buy me a coffee.
  • #10 21142412
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    it's marked as RW (Read/Write) instead of RO (Read Only), does it mean that you can just enable the alarm at any moment from the OBK? So the alarm could be reused as alarm for, I don't know, other sensor?


    ah. specifically, dpID 12 just turns the function of the whole device on/off, not the alarm tone itself. there doesn't appear to be an alarm tone only ability - the closest being the self-test

    Added after 10 [hours] 24 [minutes]:

    p.kaczmarek2 wrote:
    Maybe TextField button can be used for alarm duration (1-180s)?


    OK

    OpenBK_BK7231T_WB2S_Gas user interface with alarm settings.

    and I can see from tuyaMcu_sendQueryState that the values I choose in the textfield are set in the MCU

    12 seconds:

    Code: Text
    Log in, to see the code


    73 seconds:

    Code: Text
    Log in, to see the code


    I've had to do away with this for now though in autoexec because it means trying to map the same dpID to different OBK channels. I'm looking around to see if there's a way to do write and separately read, so the currently-set value is displayable.

    Code: Text
    Log in, to see the code


    Added after 1 [minutes]:

    Screenshot showing a setting for Channel #3 where dpID is 3 with alarm duration set to 180 seconds.

    Added after 32 [seconds]:

    also if "channel" can be hidden

    Added after 2 [hours] 7 [minutes]:

    Image of a section of instructions forbidding the use of a lighter to test the gas alarm's ventilation holes to avoid damaging the internal sensor of the alarm.

    oh
  • ADVERTISEMENT
  • #11 21144483
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    Thank you for your presentation. I am really starting to think that we need a way to support custom enumerations more easily.


    Yes. Not quite sure what that would look like. Something so you could use a command like "linkCustomEnum [tgChannel] [enumVal] [displayVal]".

    So, for example, the dpID1 value shown on this gas alarm could just be "Checking" "Success", "Fail" etc instead of 0, 1, 2..
  • #12 21164293
    divadiow
    Level 38  
    divadiow wrote:
    I've had to do away with this for now though in autoexec because it means trying to map the same dpID to different OBK channels. I'm looking around to see if there's a way to do write and separately read, so the currently-set value is displayable.


    is it possible to separately show the current state of each channel and to be able to set it elsewhere?
  • #13 21277741
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    It seems that you need an opposite thing. Or maybe you can just do that with Realterm?

    I don't think I ever did try Realterm

    BUT it looks like there's an official Tuya tool to emulate an MCU. I attach the TuyaMCU module debugging assistant version 2.2.3.5. This is download for v2.1.3 that updates to 2.2.3.5: https://images.tuyacn.com/smart/solution/deve...urce/aa68e8df-de83-5e2e-b8c1-d189b46168e9.zip

    I've not had a chance to try it out, but I've seen it used to respond to a flashed Beken dev board with missing TuyaMCU. This then meant getting the firmware fully booted and into AP/pairing mode.

    Screenshot of Tuya Module Debugging Assistant version 2.2.3.5.
    Attachments:
    • updateSetup.exe (2.48 MB) You must be logged in to download this attachment.
  • #14 21280904
    p.kaczmarek2
    Moderator Smart Home
    So now we can flash OBK to converted NodeMCU with BK7231 and let PC simulate TuyaMCU?

    It's by default in Chinese, but here you can change language:
    User interface of an MCU simulation software, default in Chinese.
    Helpful post? Buy me a coffee.
  • #15 21280950
    divadiow
    Level 38  
    yes. Attached is an example function point json to use.

    Screenshot of the interface of Tuya module debugging assistant version 2.2.3.5.

    it decodes stuff like TuyaMCU Analyser, to a degree.

    I was playing with the Atorch S1 firmware with a view to eventually capturing the 1.0.7 TuyaMCU firmware upgrade that gets offered by the Tuya app once paired. I could not get the firmware to pair though. I guess there's a lot to understand about all the communications that need to occur to make such a thing happen.

    Nice and neat - all possible with just this and the PC:
    Electronic board with a connected USB cable on a wooden table.
    Attachments:
    • TuyaMCUEmulate.zip (1.02 KB) You must be logged in to download this attachment.

Topic summary

✨ The discussion revolves around the setup and features of the Tuya Combustible Gas Alarm model DY-RQ400A, which utilizes the WB2S (BK7231T) module and Runjet RJM8L151F6P6 MCU. Users share insights on the device's initial setup, including its LED indicators during pairing and alarm states. The Winsen MP-4 sensor is identified as the gas detection component, effective for detecting methane and isobutane. Participants explore the device's firmware capabilities, including alarm toggling, self-test functions, and the potential for custom enumerations. Tools like Realterm and a TuyaMCU debugging assistant are discussed for emulating and testing the device's functionalities.

FAQ

TL;DR: DY‑RQ400A testing shows an MP‑4 sensor rated 300–10000 ppm; “Lighter fluid bursts didn’t seem to set it off.” LED states cover boot, pairing, preheat, alarm, and self‑test via button/app. [Elektroda, divadiow, post #21139592]

Why it matters: This FAQ helps tinkerers and integrators set up, map DPIDs, and troubleshoot TuyaMCU/OpenBeken on the DY‑RQ400A without guesswork.

Quick Facts

What hardware is inside the Tuya DY‑RQ400A gas alarm?

It uses a Tuya WB2S (BK7231T) Wi‑Fi/BT module paired with a Runjet RJM8L151F6P6 MCU. The teardown and boot logs confirm the Tuya SDK, product key, and BLE advertising on start. A tri‑color 5050 LED provides status feedback during boot and operation. Photos and UART captures are provided in the thread for reference. [Elektroda, divadiow, post #21136431]

What data points (DPIDs) does this alarm expose, and what are their roles?

Documented DPs include: DP1 checking_result (enum), DP2 gas_sensor_state (enum), DP3 alarm_time 1–180 s (value), DP5 gas_sensor_value 0–1000 LEL (value), DP8 alarm_ringtone (enum, 5 options), DP9 self_checking (bool), DP10 preheat (bool), DP12 alarm_switch (bool), DP14 muffling (bool), plus test DPs 101–104. Types and ranges are shown with both Chinese labels and English descriptions. [Elektroda, divadiow, post #21136431]

How do I interpret DP5 “gas_sensor_value” and its LEL scale?

DP5 is a 0–1000 scale representing gas concentration against the lower explosive limit. During quick gas exposure tests, DP5 spiked from 0 to 19, then decayed as the air cleared. Expect higher readings with stronger or sustained leaks. During preheat, values can remain low or stable until the sensor warms up. [Elektroda, divadiow, post #21139756]

How do I start a self‑test from the device or OpenBeken?

Press the front button to start a self‑test, or toggle DP9 when mapped in OpenBeken. The LED runs a short color sequence, and the device beeps briefly. How‑To: 1) Start TuyaMCU in OBK. 2) Map DP9 as a toggle channel. 3) Tap the toggle to run the test. [Elektroda, divadiow, post #21141213]

Can I use the siren as a general alarm triggered by other sensors?

Not directly. DP12 is read/write but acts as a master device enable/disable, not a siren trigger. The only direct tone you can invoke is the brief self‑test via DP9. “DP12 just turns the function of the whole device on/off.” [Elektroda, divadiow, post #21142412]

What do the LEDs mean during boot, pairing, normal operation, preheat, and alarm?

On boot it briefly beeps and sweeps the tri‑color LED red→green→blue. Pairing shows a semi‑fast green flash. Normal operation holds a static green when gas is normal. A preheat indicator cycles until the sensor is ready. A single button press clears an active alarm state. [Elektroda, divadiow, post #21139592]

Which gas sensor is inside, and which gases does it detect?

The author identifies the sensor as a Winsen MP‑4, specified for methane/natural gas with a typical 300–10000 ppm range. In testing, short lighter‑fluid bursts failed to trigger, but an isobutane Campingaz shot did. A single press clears the alarm afterward. [Elektroda, divadiow, post #21139592]

How can I set the alarm duration (DP3) without tons of buttons in OBK?

Use a TextField control in OpenBeken to input seconds (1–180). The device applied values like 12 s and 73 s, confirmed by TuyaMCU logs (DP3 updates). How‑To: 1) Add a TextField UI. 2) Enter a value 1–180. 3) Send and verify DP3 in logs. [Elektroda, divadiow, post #21142412]

How do I change the alarm ringtone (DP8) from OpenBeken?

Create httpButtons and send TuyaMCU UART frames for DP8 enum values. The author used enum 0–4 to select the five tones, with each button sending a specific uartsendhex payload. If your app shows 1–5, note the device still accepted 0–4 over UART. [Elektroda, divadiow, post #21141213]

Why won’t my WB3S dev board with factory firmware enter pairing on the bench?

Factory Tuya firmware expects MCU handshakes. Without MCU responses, the module may not fully boot into pairing. This is a common bench‑test pitfall when the TuyaMCU is absent. Emulate the MCU, or wire a responder, to let the Wi‑Fi module complete its boot path. [Elektroda, divadiow, post #21141009]

How can I emulate a TuyaMCU on a PC to unlock pairing for testing?

Use Tuya’s “TuyaMCU Module Debugging Assistant.” It can emulate the MCU protocol so a flashed Beken board reaches AP/pairing. The linked package updates to v2.2.3.5 and has been shown driving a dev board with missing TuyaMCU. [Elektroda, divadiow, post #21277741]

Can I simulate TuyaMCU to test OpenBeken mappings more easily?

Yes. Load a function‑point JSON in Tuya’s Debugging Assistant, set serial to your OBK device, and interactively send DP frames. The UI can decode frames similar to TuyaMCU Analyzer. You can switch the tool’s language in settings. [Elektroda, divadiow, post #21280950]

What UART frames should I expect during boot and gas events?

You’ll see 55 AA heartbeats, Wi‑Fi state, and State (0x07) frames carrying DP updates. Preheat toggles DP10, and gas exposure raises DP5 values in small steps (e.g., up to 19), then they decay as the gas dissipates. [Elektroda, divadiow, post #21139756]

Are custom enumerations supported for friendlier status labels in OBK?

Not natively in this thread’s builds. A maintainer noted, “we need a way to support custom enumerations more easily.” Workarounds use labels and aliases, but a first‑class mapping would improve UX for enums like DP1. [Elektroda, p.kaczmarek2, post #21138809]

Can I display a DP’s current state and set it from a different place in OBK?

The author sought separate read/write handling for the same DP (e.g., DP3). Mapping the same DP to multiple channels conflicted with the current setup. A feature request asks to show state while setting it elsewhere. [Elektroda, divadiow, post #21164293]

Which product identifiers appear in the logs, and where do I find them?

Boot logs print the Tuya product key and firmware key, plus serial number and Wi‑Fi state. Example output shows product_key 13nrj1aeeaqh54cz and firmware_key key34ak4q5rmrkef during initialization. These help match cloud definitions and troubleshoot pairing. [Elektroda, divadiow, post #21136431]
ADVERTISEMENT