logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] [CB3S] P01 Tuya PIR Motion Sensor Configuration and Outdoor Use Issues

rickbronson 2175 9
ADVERTISEMENT
  • #1 21051059
    rickbronson
    Level 3  

    Anyone dug into this battery-powered PIR Tuya device? The PIR output signal seems to only go into the TuyaMCU so I'm not sure how to configure it. Maybe someone has some ideas.

    Here is the picture of the device:
    White PIR motion sensor from Tuya with a visible round detection element.


    Here is the board showing the PIR, the 8-pin TuyaMCU (might be a Holtek part), and the CB3S:
    PCB with PIR sensor, TuyaMCU, and CB3S module.


    And lastly, my guess at a rough schema of the important parts.
    Tuya PIR circuit diagram with CB3S and CH340

    Note that I was able to flash the CB3S without unsoldering anything, but I had to use the CB340 USB-Serial. I'm guessing it has a higher drive capability to overcome the TuyaMCU's TX drive. Also, during my testing, I found that it doesn't work very well outside as any tree branch waving around in the wind seems to set it off. I realize the product states that it is not waterproof and thus not to be used outside, but I thought I could put it in a box.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #4 21060045
    divadiow
    Level 34  
    oh. hi. not sure what you mean tho. no programs need running, just the 72kb config file bit - from any web browser :)
  • ADVERTISEMENT
  • #6 21060655
    divadiow
    Level 34  
    cool, sorry. the link should have taken you to the right chapter in video.

    have you seen this tutorial https://www.elektroda.com/rtvforum/topic4049908.html#21053452

    I think the only DPID is

    DP 1, ENUM(ro), pir_state (人体感应状态)

    probably worth confirming using guide

    The tuya API response:

    Code: Text
    Log in, to see the code
  • #7 21061289
    rickbronson
    Level 3  
    Okay, thanks for the info.

    Rick
  • #8 21096966
    JardaLCZ
    Level 5  
    Hello, can we continue in this topic? I did not find any final or autoexec.bat example for this sensor.
    Can anybody guide me how to find correct DPIs? I tried ways from other topics but I am unsucessful yet.
    I have one unit flashed to Openbeken and one new with original firmware.

    This is backup before flashing:

    EDIT: 27.5.2024 - I accidentally pasted the wrong code. I edited the post to avoid confusing future readers.
    
    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    And the Tuya section starts at UNCOMMON POSITION 0
    
    {
    	"key":"null",
    	"lckey":"null",
    	"h_url":"null",
    	"h_ip":"null",
    	"hs_url":"null",
    	"hs_ip":"null",
    	"hs_psk":"null",
    	"hs_psk_ip":"null",
    	"mqs_url":"null",
    	"mqs_ip":"null",
    	"mq_url":"null",
    	"mq_ip":"null",
    	"ai_sp":"null",
    	"ai_sp_ip":"null",
    	"mq_psk":"null",
    	"mq_psk_ip":"null",
    	"time_z":"null",
    	"s_time_z":"null",
    	"wx_app_id":"null",
    	"wx_uuid":"null",
    	"dy_tls_m":"0",
    	"cloud_cap":"0",
    	"psk21_key":"null }token",
    	"region":"null",
    	"reg_key":"null",
    	"dns_prio":"00dAis_stride{uuid",
    	"psk_key":"iDVRoAK1u0qcQnNjdDnMxy2A9il27cPtXmcsk",
    	"auth_key":"3pRtjMCXkQYUPT7GHdtAhdbNUKYhwigO",
    	"ap_ssid":"SmartLife",
    	"ap_passwd":"null",
    	"country_code":"CN",
    	"bt_mac":"null",
    	"bt_hid":"null",
    	"prod_test":"false",
    	"fac_pin":"lf36y5nwb8jkxwgg }0{abi",
    	"id":"eb010305fb37ca8c14hnsc",
    	"swv":"2.1.5",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.4",
    	"pk":"rjzon9kyxpoeksj3",
    	"firmk":"keyr5qhaxgstx9ys",
    	"cadv":"1.0.3",
    	"cdv":"1.0.0",
    	"dev_swv":"1.0.0",
    	"s_id":"esi4xk",
    	"dtp":"9",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null }DAastro_timer{timestamp",
    	"index":"0}AVGBastro_timer{timestamp",
    	"ssid":"null",
    	"passwd":"null",
    	"md":"0",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"1",
    	"token":"null",
    	"cnt":"0}sAbaud_cfg{baud",
    	"mode":"ro",
    	"property":"{range",
    	"type":"enum}",
    	"{trigger":"direct"
    }
    
    
  • #9 21096981
    divadiow
    Level 34  
    is your device definitely the P01 PIR that is the focus of this thread?

    that firmware and product key seem to be for a TH01 temp/hum device
  • ADVERTISEMENT
  • #10 21097135
    JardaLCZ
    Level 5  

    @divadiow Thank you for noticing. I accidentally pasted the wrong code, so I edited my post to avoid confusing future readers. I flashed TH sensor recently.

    I found another article related to P01 later and successfully tested it. It seems to work:

    https://www.elektroda.com/rtvforum/topic4053536.html

    Autoexec.bat
    
    startDriver TuyaMCU
    startDriver tmSensor
    setChannelType 1 Motion
    linkTuyaMCUOutputToChannel 1 val 1
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 Battery
    linkTuyaMCUOutputToChannel 3 enum 3 


    Battery status is only 3 states as the TH sensor, low, mid, high.
    There is a 15 seconds delay between 1st move, the connecting to wifi and the publishing the message.


    There are these MQTT topics and states from my observations:

    PIR1/3/get
    message 2= battery high, 1=mid, 0=low


    PIR1/connected
    message online= move detected
    message offline= no move for cca 3,5 minutes after last move

Topic summary

The discussion revolves around the configuration and outdoor performance issues of the P01 Tuya PIR motion sensor, which utilizes a TuyaMCU for signal processing. Users are seeking guidance on how to configure the device, as the PIR output is routed solely to the TuyaMCU, leaving the BK7231N unconnected. A user shared a configuration file and discussed the challenges of using the sensor outdoors, noting that environmental factors like wind can trigger false alarms. Additional insights include the identification of relevant DPID values and the successful flashing of the device with OpenBeken firmware. The conversation also highlights the need for correct DPI identification and the sharing of autoexec.bat examples for proper functionality.
Summary generated by the language model.
ADVERTISEMENT