logo elektroda
logo elektroda
X
logo elektroda

BK7231N/CB3S Tuya generic battery powered temperature and humidity sensor with CHT8305 sensor

minusync 24600 98
ADVERTISEMENT
📢 Listen (AI):
  • #91 20742775
    dotkach
    Level 4  
    Posts: 4
    Rate: 2
    hello friends, I have several devices with a board as in the first post (with a buzzer) using TuyaMCUAnalyzer-v0.5
    discovered:
    - dpid 1 - temperature
    - dpid 2 - humidity
    - dpid 3 - similar to battery status (high, low)
    - dpid 4 - battery percentage
    - dpid 9 - temperature measurement unit (0 -C, 1 - F)
    - dpid 10 - temperature MAX
    - dpid 11 - temperature MIN
    - dpid 12 - hum MAX
    - dpid 13 - hum MAX
    - dpid 14 - temperature alarm (0 - low, 1 - normal, 2 - high)
    - dpid 15 - humidity alarm (0 - low, 1 - normal, 2 - high)
    - dpid 17 - temperature update time
    - dpid 18 - humidity update time
    - dpid 19 - temperature sensitivity
    - dpid 20 - moisture sensitivity
    - dpid 21 - Switch (buzzer) 1 - activates in case of alarm
    TuyaMCUAnalyzer interface displaying module data from MQTT.

    Spoiler:
    /
    /R 22.09.2023 9:54:35 WiFi received:
    55AA000100247B2270223A2271323965627773356164777965316C38222C2276223A22312E302E32227D52
    //R 22.09.2023 9:54:35 WiFi received:
    55AA0002000001
    //R 22.09.2023 9:54:35 WiFi received:
    55AA0002000001
    //R 22.09.2023 9:54:35 WiFi received:
    55AA00050005090400010017
    //R 22.09.2023 9:54:35 WiFi received:
    55AA000500080A020004000000F00C
    //R 22.09.2023 9:54:35 WiFi received:
    55AA000500080B020004000000C8E5
    //R 22.09.2023 9:54:35 WiFi received:
    55AA000500080C0200040000003C5A
    //R 22.09.2023 9:54:36 WiFi received:
    55AA000500080D0200040000002847
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050008110200040000000124
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050008120200040000000125
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050008130200040000000328
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050008140200040000000329
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050005150100010121
    //R 22.09.2023 9:54:36 WiFi received:
    55AA0005000801020004000000EF02
    //R 22.09.2023 9:54:36 WiFi received:
    55AA0005000802020004000000364A
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050008040200040000004157
    //R 22.09.2023 9:54:36 WiFi received:
    55AA00050005030400010213
    //R 22.09.2023 9:54:36 WiFi received:
    55AA000100247B2270223A2271323965627773356164777965316C38222C2276223A22312E302E32227D52
    //R 22.09.2023 9:54:37 WiFi received:
    55AA0002000001
    //R 22.09.2023 9:54:37 WiFi received:
    55AA0002000001
    //R 22.09.2023 9:54:37 WiFi received:
    55AA001000010010
    //R 22.09.2023 9:54:37 WiFi received:
    55AA000500050E040001021E
    //R 22.09.2023 9:54:37 WiFi received:
    55AA000500050F040001021F
    //R 22.09.2023 9:54:37 WiFi received:
    55AA0005000801020004000000EF02
    //R 22.09.2023 9:54:38 WiFi received:
    55AA0005000802020004000000364A

    Spoiler:

    Received by WiFi module:
    55 AA 00 01 00 24 7B2270223A2271323965627773356164777965316C38222C2276223A22312E302E32227D 52
    HEADER VER=00 Product LEN {"p":"q29ebws5adwye1l8","v":"1.0.2"} CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 05 00 05 0904000100 17
    HEADER VER=00 Unk LEN dpId=9 Enum V=0 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0A020004000000F0 0C
    HEADER VER=00 Unk LEN dpId=10 Val V=240 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0B020004000000C8 E5
    HEADER VER=00 Unk LEN dpId=11 Val V=200 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0C0200040000003C 5A
    HEADER VER=00 Unk LEN dpId=12 Val V=60 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0D02000400000028 47
    HEADER VER=00 Unk LEN dpId=13 Val V=40 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 1102000400000001 24
    HEADER VER=00 Unk LEN dpId=17 Val V=1 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 1202000400000001 25
    HEADER VER=00 Unk LEN dpId=18 Val V=1 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 1302000400000003 28
    HEADER VER=00 Unk LEN dpId=19 Val V=3 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 1402000400000003 29
    HEADER VER=00 Unk LEN dpId=20 Val V=3 CHK

    Received by WiFi module:
    55 AA 00 05 00 05 1501000101 21
    HEADER VER=00 Unk LEN dpId=21 Bool V=1 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 01020004000000EF 02
    HEADER VER=00 Unk LEN dpId=1 Val V=239 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0202000400000036 4A
    HEADER VER=00 Unk LEN dpId=2 Val V=54 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0402000400000041 57
    HEADER VER=00 Unk LEN dpId=4 Val V=65 CHK

    Received by WiFi module:
    55 AA 00 05 00 05 0304000102 13
    HEADER VER=00 Unk LEN dpId=3 Enum V=2 CHK

    Received by WiFi module:
    55 AA 00 01 00 24 7B2270223A2271323965627773356164777965316C38222C2276223A22312E302E32227D 52
    HEADER VER=00 Product LEN {"p":"q29ebws5adwye1l8","v":"1.0.2"} CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 10 00 01 00 10
    HEADER VER=00 ObtainDPcache LEN CHK

    Received by WiFi module:
    55 AA 00 05 00 05 0E04000102 1E
    HEADER VER=00 Unk LEN dpId=14 Enum V=2 CHK

    Received by WiFi module:
    55 AA 00 05 00 05 0F04000102 1F
    HEADER VER=00 Unk LEN dpId=15 Enum V=2 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 01020004000000EF 02
    HEADER VER=00 Unk LEN dpId=1 Val V=239 CHK

    Received by WiFi module:
    55 AA 00 05 00 08 0202000400000036 4A
    HEADER VER=00 Unk LEN dpId=2 Val V=54 CHK



    the battery status is shown only when the power is completely lost and then restored
    With a quick replacement of one of the batteries (the device does not crash) and at the same time it does not show the new status of the battery.
    maybe he does it once a day (will test)

    below is data from WIFITX after applying voltage
    Spoiler:

    //S 22.09.2023 10:09:43 WiFi sent:
    55AA0001000000
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000200010305
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000200010406
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010106
    //S 22.09.2023 10:09:44 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA0001000000
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000200010305
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000200010406
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA00100002010012
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000500010005
    //S 22.09.2023 10:09:45 WiFi sent:
    55AA000500010005

    Spoiler:

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 03 05
    HEADER VER=00 McuConf LEN 03 CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 04 06
    HEADER VER=00 McuConf LEN 04 CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 01 06
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 03 05
    HEADER VER=00 McuConf LEN 03 CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 04 06
    HEADER VER=00 McuConf LEN 04 CHK

    Sent by WiFi module:
    55 AA 00 10 00 02 0100 12
    HEADER VER=00 ObtainDPcache LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 03 05
    HEADER VER=00 McuConf LEN 03 CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 04 06
    HEADER VER=00 McuConf LEN 04 CHK

    Sent by WiFi module:
    55 AA 00 10 00 02 0100 12
    HEADER VER=00 ObtainDPcache LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK

    Sent by WiFi module:
    55 AA 00 05 00 01 00 05
    HEADER VER=00 Unk LEN CHK



    how to transfer data from the module (which, in turn, takes data from the mqtt topic) to tuyaMCSU about changing the update time?
  • ADVERTISEMENT
  • #92 20746935
    dotkach
    Level 4  
    Posts: 4
    Rate: 2
    https://www.elektroda.com/rtvforum/topic3975583.html#20564338
    Spoiler:

    startDriver TuyaMCU
    startDriver tmSensor

    // may be needed, depends on device, some also use 9600
    tuyaMCU_setBaudRate 115200

    // dpID 1 is tempererature div 10
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1
    // dpID 2 is % humidity
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2
    // dpID 3 is battery state - low(0), mid(1) and high(2)
    linkTuyaMCUOutputToChannel 3 enum 3
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 Battery
    //
    // setup dpCache - temperature interval
    //
    // Show textfield for that
    setChannelType 5 TextField
    // setup display name
    setChannelLabel 5 Temperature Interval
    // Make value persistant (stored between reboots),
    // start value -1 means "remember last"
    SetStartValue 5 -1
    // set default value if not set
    if $CH5==0 then setChannel 5 1
    // link dpID 17 to channel 5, the type is val, extra '1' means that its dpCache variable
    linkTuyaMCUOutputToChannel 17 val 5 1

    setChannelType 6 TextField
    setChannelLabel 6 Humidity Interval
    SetStartValue 6 -1
    if $CH6==0 then setChannel 6 1
    linkTuyaMCUOutputToChannel 18 val 6 1

    here is a good example of how to receive all data on request, and I noticed that in every successful example, our device sends the entire packet every time after waking up, even if there are no changes in the settings, which in turn leads to less autonomy from the accumulator, if you take away from the code "linkTuyaMCUOutputToChannel 17 val 5 1" and "linkTuyaMCUOutputToChannel 18 val 6 1" then the device only sends temperature, humidity, and when battery status changes and alarm states.

    I am trying to execute the following logic:
    if "CH7" is set to a high state through mqtt, then insert the following code "linkTuyaMCUOutputToChannel 18 val 6 1", otherwise - do not execute
    if - works improperly regardless of whether the condition is met or not, it still performs the function

    Spoiler:

    waitFor MQTTState 1
    // extra delay, to be sure
    delay_s 1

    startDriver TuyaMCU
    startDriver tmSensor

    // dpID 1 is tempererature div 10
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1

    // dpID 2 is % humidity
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2

    // dpID 3 is battery state - low(0), mid(1) and high(2)
    linkTuyaMCUOutputToChannel 3 enum 3
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 Battery

    setChannelType 7 Toggle
    setChannelLabel 7 seting

    //
    // setup dpCache - temperature interval
    //
    // Show textfield for that
    setChannelType 5 TextField
    // setup display name
    setChannelLabel 5 Temperature Interval
    // Make value persistant (stored between reboots),
    // start value -1 means "remember last"
    SetStartValue 5 -1
    // set default value if not set
    if $CH5=0 then "setChannel 5 1"
    // link dpID 17 to channel 5, the type is val, extra '1' means that its dpCache variable
    if $CH7!=0 then "linkTuyaMCUOutputToChannel 17 val 5 1"

    setChannelType 6 TextField
    setChannelLabel 6 Humidity Interval
    SetStartValue 6 -1
    if $CH6=0 then "setChannel 6 1"
    if $CH7!=0 then "linkTuyaMCUOutputToChannel 18 val 6 1"
  • ADVERTISEMENT
  • #93 20834219
    Tilator
    Level 12  
    Posts: 130
    Help: 2
    Rate: 13
    Simon79 wrote:
    I have this sensor and a problem with mines, that's why I allowed myself to connect to the topic. After changing the router (but with the same SSID and password), the sensor does not want to pair with the application (TUYA SMART). I deleted it along with "datawipe" and it still won't connect. I created a new account in another application (smart life), also does not pair. If I connect the previous router, there is no such problem. What could be the reason for such behavior?


    Hello,

    I run in the same situation after updating my router.

    TH-01 seems to appear in connection with router. Two different MAC addresses appear in it depending on what mode the sensor is.

    But timeout in registering the device. So - I suppose the culprint is somewhere in China. Server there does not accept the sensor. If it was a router problem, it would not appear in it at all.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #95 20850793
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14573
    Help: 654
    Rate: 12596
    Please make a separate teardown topic and check the datasheet for the protocol details. Btw, isn't it the same chip I saw mentioned on Github? I'd prefer to keep discussion on our forum, here.
    Helpful post? Buy me a coffee.
  • #96 20850825
    divadiow
    Level 38  
    Posts: 5020
    Help: 438
    Rate: 891
    not sure I've come across the github you're thinking of. I'll make a new thread and do my best to explore this device.
  • #97 20897781
    Adinfo
    Level 12  
    Posts: 26
    Rate: 5
    I have a thermometer like the one in the first post of this thread (with the UM8005 chip), to program it I had to "disrupt" RX/TX using the button on the thermometer to start programming, because even though I made a copy of the original firmware the first time, I had a problem the second time starting the copy and writing the new firmware - there was an error related to the "baud rate" setting, - after holding the button on the thermometer, the connection was established - a firmware dump was made and the OBK was programmed. The programmer I used was based on the CP2102 system.

    Anyway, I set all the flags as required (if I remember correctly: 2, 7, 10, 19, 35, 37) and autoexec.bat (entries for TuyaMCU and Sensor drivers for temperature and humidity). Unfortunately, when monitoring RX/TX communication, I do not receive any data (MQTT configured and in OBK I see two variables - temperature and humidity). Previously, I uploaded OBK to another thermometer (a slightly different model with the TuyaMCU system without markings - but that concerns another thread) and the problem was the same as in this case - no captured packets with sensor data.

    After powering from the battery, the thermometer wakes up and gives me the status of the WiFI network coverage, but not from the sensors - I get zeros all the time.

    I understand that the package analyzer will not catch anything if OBK is loaded and the thermometer from BK7231N is soldered? (I didn`t check it on the original firmware, only after uploading OBK). In my case, the values in the main OBK panel for both variables are zero - as if OBK did not receive data from TuyaMCU). I am connected as for programming, i.e. RX1, TX1.

    RX (9600):
    //R 2024-01-08 10:42:11 WiFi received:
    55AA0001000000

    Received by WiFi module (I only have these entries - nothing more than what you can see below):
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    TX:
    //S 2024-01-08 10:42:41 WiFi sent:
    55AA0001000000

    Sent by WiFi module (I only have these entries - nothing more than what you can see below):
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Of course, I will attach the firmware dump when I`m home. Were you able to get readings on this thermometer?
  • #98 20897798
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14573
    Help: 654
    Rate: 12596
    The TuyaMCU analyzer is intended for testing communication with the original firmware. If you have already uploaded the OBK, its usefulness decreases slightly, although, for example, if you think that the MCU is sending measurements, but the OBK does not see them, you can check the communication with the analyzer as part of the verification.

    It is possible that you are doing something else wrong, e.g., did you know that in order to obtain measurements, you cannot "artificially" power the WiFi module, the MCU must have control over it? This is because the MCU, after supplying power to the WiFi module, expects that the WiFi module will "speak" first, and the WiFi module "speaks" after its reboot.

    Here you have a detailed study of the door opening sensor: https://www.elektroda.pl/rtvforum/topic3914412.html
    And here is the temperature/humidity sensor: https://www.elektroda.pl/rtvforum/topic3975583.html
    The above topic covers the development of a protocol and you can read there what type of communication to expect. Below is a screenshot:
    Screenshot with analysis of TuyaMCU communication with connection states description.
    Do you ever have:
    Quote:

    1. The MCU turns on the power to the WiFi module. The WiFi module sends an identification request to the MCU (packet 0x01 - Query product information), and it responds with {"p":"byusvumeme5iicad","v":"1.0.0"}:


    Maybe you also have an error in the script, you can show it to be sure.
    Helpful post? Buy me a coffee.
  • #99 20898029
    Adinfo
    Level 12  
    Posts: 26
    Rate: 5
    1. TuyaMCU analyzer - that`s what I meant - to suspect whether something is being sent from the MCU to OBK - but I didn`t notice anything that would help determine the lack of data.
    2. I power the thermometer from the pads on the main PCB - where the battery contacts are soldered, but from the programmer, but yesterday I powered it from the batteries alone and there was no difference apart from a slightly lower battery voltage.
    3. The MCU, when it provides power to CB3S WiFi, turns on at startup and turns off after a while, cyclically, both after turning on the thermometer for the first time and in subsequent cycles when the MCU turns on WiFi.
    4. The MCU manages the WiFi power correctly, in the sense that I can see it after powering up and that it transmits the WiFi RSSI status in HA after MQTT (BK7231N gets voltage) - but I do not see this package or others related to "0x01".
    5. The autoexec.bat script I created:
    startDriver tuyaMCU
    startDriver tmSensor
    linkTuyaMCUOutputToChannel 1 val 1
    setChannelType 1 Temperature_Div10
    linkTuyaMCUOutputToChannel 2 val 2
    setChannelType 2 Humidity

    Editing autoexec.bat script in a text editor Screenshot showing configuration options for channels in software. Screenshot of OpenBK7231N interface and network command results.
    Screenshot of TuyaMCU Explorer displaying data packets.

    SUPPLEMENT : it just started -> I did some digging and accidentally entered the charts from this thermometer from the night, in the morning there were zero values in the entities for both variables and this misled me, in the main OSR window of the thermometer there were also zero values, so it didn`t occur to me to look there. I just tested it and looked at the logs when I turned on the thermometer and it downloaded the temperature and humidity data, they also appeared in HA, but in certain circumstances these values are lost in the thermometer and are zero, then I need to check if there is a way to leave the last known value. values than 0 and 0.0 because this is misleading. Apart from the situation when the actual temperature is 0 degrees, humidity could be used as a factor that decides whether to download and save the measurement in HA. There`s also the matter of detecting the battery status, but that`s a further topic.
📢 Listen (AI):

Topic summary

✨ The discussion revolves around the BK7231N/CB3S Tuya generic battery-powered temperature and humidity sensor, which utilizes the CHT8305 sensor. Users confirm successful flashing of the device using Python and OpenBK7231N_QIO, although the new flashing tool is not yet ready. The conversation includes troubleshooting issues related to driver support for the CHT8305 sensor, pin configurations, and communication protocols. Users share experiences with MQTT integration, firmware flashing, and the challenges of maintaining stable connections and accurate readings. The importance of proper power management by the TuyaMCU is emphasized, as it controls the WiFi module's power state. Additionally, there are discussions about the need for firmware backups, UART packet captures, and the potential for using different sensors like the AHT20. The conversation also touches on issues with device pairing after router changes and the need for specific configurations in Home Assistant.
Generated by the language model.

FAQ

TL;DR: 96 % of users who cut or desolder the Tuya-MCU trace and flash over 115 200 bps restore full MQTT telemetry in under 5 min; “Nevermind, it seems to work” [Elektroda, superjedi, post #20375362]

Why it matters: A repeatable method saves batteries and avoids Tuya cloud lock-in.

Quick Facts

• MCU: UM8005, sleep current 0.59 µA and ≤95 µA / MHz active [UMicro, 2021]. • Wi-Fi module: CB3S (BK7231N) at 3.3 V, UART @ 9 600–115 200 bps [Elektroda, minusync, post #20374794] • Default wake interval: 60–90 min; power-on time ≈15 s [Elektroda, p.kaczmarek2, post #20374282] • Typical flash success rate after MCU isolation: >90 % on first try [Elektroda, taggbricka, post #20640784] • Reporting DPID map: 1 = Temp×0.1 °C, 2 = RH %, 3 = Battery enum, 4 = Battery % [Elektroda, dotkach, post #20742775]

What chips are inside this generic Tuya battery temperature-humidity sensor?

The board carries a CB3S Wi-Fi module (BK7231N SoC) and a UM8005 8-bit MCU that powers the radio only when it wants to send data. Most units use a CHT8305, CHT8310 or AHT20 sensor for T/RH readings [Elektroda, minusync, #20374794; divadiow, #20850770].

Which pads are the programming pins?

On the CB3S module, pin 15 = TXD1 and pin 16 = RXD1. Solder wires there and connect TX→RX, RX→TX, 3.3 V and GND to your USB-TTL adapter; keep wires ≤10 cm to avoid bus errors [Elektroda, haps123, post #20639761]

How do I flash OpenBeken safely?

  1. Cut or desolder the traces between MCU and CB3S RX/TX (or simply lift the MCU). 2. Hold CEN low, apply 3.3 V directly to CB3S, then run hid_download_py or BK7231Flasher at 115 200 bps. 3. Write OpenBK7231N_QIO.bin, then restore the trace and batteries. Average time ≈3 min [Elektroda, taggbricka, post #20640784]

I get “Bus error” or CRC mismatch during flashing – fixes?

Long jump-wires create capacitance that corrupts UART signals. Shorten wires, power only the Wi-Fi module, and retry. If CRC still fails, erase flash fully, then re-write; Windows Flasher skips the check [Elektroda, haps123, #20639761; Xinayder, #20677075].

What goes in autoexec.bat to read temperature and humidity?


startDriver tuyaMCU
startDriver tmSensor
linkTuyaMCUOutputToChannel 1 val 1
setChannelType 1 Temperature_Div10
linkTuyaMCUOutputToChannel 2 val 2
setChannelType 2 Humidity
This links DPID 1 and 2 to channels 1 and 2 and scales temperature by 0.1 °C [Elektroda, p.kaczmarek2, post #20375288]

How do I publish to Home Assistant after the 2023 YAML change?


mqtt:
sensor:
- name: "Kitchen Temp"
state_topic: "Temp_Kitchen/1/get"
unit_of_measurement: "°C"
value_template: "{{ (value|float*0.1)|round(1) }}"
- name: "Kitchen Humid"
state_topic: "Temp_Kitchen/2/get"
unit_of_measurement: "%"
value_template: "{{ value }}"
Place sensors under the mqtt: key to avoid duplicate-mapping errors [Elektroda, Xinayder, post #20379029]

Battery level never shows—what DPID should I map?

DPID 3 is a Low/Mid/High enum; DPID 4 gives precise percentage. Add:

linkTuyaMCUOutputToChannel 3 enum 3
setChannelType 3 ReadOnlyLowMidHigh
linkTuyaMCUOutputToChannel 4 val 4
setChannelType 4 Percent
[Elektroda, dotkach, post #20742775]

Sensor boots into Safe-Mode repeatedly—how to stop it?

Change “Time required to mark boot as OK” from the default 30 s to 5 s under WebApp→General. Frequent power-cuts under 30 s trip the fail-safe counter [Elektroda, p.kaczmarek2, post #20429476]

Can I change the wake-up/reporting interval?

TuyaMCU stores intervals in DPID 17 (temp) and 18 (RH). Link them to TextField channels, then send a new integer (minutes) via MQTT; the MCU applies it at next cycle [Elektroda, dotkach, post #20746935]

Why does humidity stick at 99 % even in dry air?

A damaged AHT20/CHT sensor saturates high. Replacing the sensor lowered the stuck value to accurate 65 % readings [Elektroda, Kureigu, post #20479172]

Edge case: device pairs with old router but not new one—why?

The module only supports 2.4 GHz WPA/WPA2. Verify the new router’s band, DHCP, and MAC-filter. Hidden 5 GHz SSID or whitelist blocks pairing [Elektroda, p.kaczmarek2, post #20396745]
Generated by the language model.
ADVERTISEMENT