logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

[BK7231N ] Teardown of TH08 LCD Calendar/clock/temperature/humidity, 3xAAA battery, backlight

morgan_flint 43893 254

TL;DR

  • TH08-CBU-ATH20-V2 is a LCD calendar/clock/temperature/humidity unit with a BK7231N CBU module, BL55070 LCD driver, and ATH20 sensor.
  • U3 appears to be the Tuya MCU, while U8 with a 32.768 kHz crystal likely handles RTC and LCD/backlight control, and Q1 switches Wi‑Fi power.
  • It runs from 3xAAA cells at 4.5V and was bought for 4.49€ as a Choice offer.
  • The Tuya app shows a 1 hour update interval, and pairing can fail because the device connects only briefly between updates.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • #211 21378297
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12639
    What sending of flags, what is it? Maybe there is something to correct.

    BatteryLevelPercent I will check in the Simulator right away and if there is seriously a bug I will fix it and upload the Release. Many people just do their Yaml because then there is 100% control over everything

    Ready channel settings - i.e. for the dpID of this device? My TH06 only offered humidity and temperature, no alarms, so I had no way to check that

    Added after 24 [minutes]:

    @GAAD added:
    
    setChannelType 2 BatteryLevelPercent
    setChannelLabel 2 MyBatteryABC
    
    .
    WinTest_3145CAFF diagnostic screen showing battery level at 67%, channel info, and MQTT status. .
    User interface of an application with device information and sensor status .
    Posted at:
    https://github.com/openshwprojects/OpenBK7231...mmit/3a1c3e9bbf6105e43d16653139a321a860de5207

    What is needed next? What else is missing?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #212 21379117
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    Generally, it is already ok.

    As for the rest, I think colleague @divadiow pasted the whole thing on the previous page
    I've experimented with these channels even started to configure them as read or text channels but it didn't really work out for me.

    
    {
      "1": {
        "name": "Temperature",
        "type": "obj",
        "mode": "ro",
        "trigger": "direct",
        "property": {
          "type": "value",
          "min": -200,
          "max": 600,
          "scale": 1,
          "step": 1
        }
      },
      "2": {
        "name": "Humidity",
        "type": "obj",
        "mode": "ro",
        "trigger": "direct",
        "property": {
          "type": "value",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "3": {
        "name": "Battery level state",
        "type": "obj",
        "mode": "ro",
        "trigger": "direct",
        "property": {
          "type": "enum",
          "range": ["low", "middle", "high"]
        }
      },
      "4": {
        "name": "Battery level",
        "type": "obj",
        "mode": "ro",
        "trigger": "direct",
        "property": {
          "type": "value",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "9": {
        "name": "Unit convert",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "enum",
          "range": ["c", "f"]
        }
      },
      "10": {
        "name": "Set maxtemp",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": -200,
          "max": 600,
          "scale": 1,
          "step": 1
        }
      },
      "11": {
        "name": "Set minitemp",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": -200,
          "max": 600,
          "scale": 1,
          "step": 1
        }
      },
      "12": {
        "name": "Set maxhum",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "13": {
        "name": "Set minihum",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "14": {
        "name": "Temp alarm",
        "type": "obj",
        "mode": "ro",
        "property": {
          "type": "enum",
          "range": ["loweralarm", "upperalarm", "cancel"]
        }
      },
      "15": {
        "name": "Humidity alarm",
        "type": "obj",
        "mode": "ro",
        "property": {
          "type": "enum",
          "range": ["loweralarm", "upperalarm", "cancel"]
        }
      },
      "17": {
        "name": "Temperature report",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 1,
          "max": 120,
          "scale": 0,
          "step": 1
        }
      },
      "18": {
        "name": "Humidity report",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 1,
          "max": 120,
          "scale": 0,
          "step": 1
        }
      },
      "19": {
        "name": "Temp sensitivity",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 3,
          "max": 20,
          "scale": 1,
          "step": 1
        }
      },
      "20": {
        "name": "Humidity sensitivity",
        "type": "obj",
        "mode": "rw",
        "property": {
          "type": "value",
          "min": 3,
          "max": 20,
          "scale": 0,
          "step": 1
        }
      }
    }
    


    It would be nice to complete:
    9 "Unit convert", this has already been tackled by colleague @smoeller95s
    10 "Set maxtemp",
    11 "Set minitemp",
    12 "Set maxhum",
    13 "Set minihum",
    14 "Temp alarm",
    15 "Humidity alarm",
    17 "Temperature report",
    18 "Humidity report",
    19 "Temp sensitivity",

    This would give the full functionality of the device and the convenience of configuration and, after all, we are reworking these devices not to lose but to gain. In most threads it is the case that if it works for someone, they write the rest either in OBK or in HA and no longer share it.
  • #213 21379148
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12639
    A lot of things like the alarm can be done in OBK itself, you don't have to do it on TuyaMCU, but if you need something I'll help. I can introduce new channels, and I'm also working on some more advanced options so that you can script the settings as you like. We already have an HTML Widgets system, so you can make any control you want, but it's probably too advanced for such a simple device....

    What was the problem with channels? You give a text field type then you can both receive and send. Unless you want to add a comma delimited text field type?

    Unit convert is supposed to be a radio button with two options?

    PS: Are you using the OBK simulator? It might be faster that way... for testing with HA
    Helpful post? Buy me a coffee.
  • #214 21379298
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    Do we stand a chance of something like this for example:
    
        visual:
          min_temperature: 10 °C      
          max_temperature: 30 °C      
          temperature_step: 0.1 °C
    
    switch:
      - platform: tuya
        name: "Power"
        icon: mdi:power
        switch_datapoint: 1           
        internal: True                
    
    sensor:
      - platform: tuya
        name: "Temperatura"
        device_class: "temperature"
        sensor_datapoint: 3
        unit_of_measurement: "°C"
        accuracy_decimals: 1
        filters:
          - multiply: 0.1
    
    number:
    - platform: "tuya"
      name: "Histereza"
      number_datapoint: 101
      min_value: 0.3
      max_value: 10.0
      step: 0.1
      multiply: 10
    
    - platform: "tuya"
      name: "Cool del"
      number_datapoint: 102
      min_value: 1
      max_value: 10
      step: 1
    
    - platform: "tuya"
      name: "Korekta T"
      number_datapoint: 103
      min_value: -10
      max_value: 10
      step: 0.1
      multiply: 10
    
    .


    User interface with thermostat settings .

    I know it takes more time in ESP it's not a web selector and probably autoexec won't solve the problem but maybe there are parameters for channels that can be set like range from to, divide by 10?
    Maybe it would be better to make one type for channels with data, e.g. temperature and as another option multiplier?
    With the development of the software, there will be more and more functions and options, so maybe it would be possible to sort this list alphabetically?
    You would certainly have to make a LowAlarm/HighAlarm channel for the alarm channels.

    My autoexec now looks like this:
    
    clearIO
    PowerSave 1
    startDriver NTP
    ntp_setServer 192.168.1.253
    waitFor NTPState 1
    ntp_timeZoneOfs 1
    startDriver TuyaMCU
    startDriver tmSensor
    // Flags 134743044
    
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1
    
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2
    
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 "Batt_state"
    linkTuyaMCUOutputToChannel 3 val 3
    
    setChannelType 4 BatteryLevelPercent
    setChannelLabel 4 "Batt_level"
    linkTuyaMCUOutputToChannel 4 val 4
    
    setChannelType 10 TextField
    setChannelLabel 10 "Set maxtemp"
    linkTuyaMCUOutputToChannel 10 val 10
    
    setChannelType 11 TextField
    setChannelLabel 11 "Set minitemp"
    linkTuyaMCUOutputToChannel 11 val 11
    
    setChannelType 12 TextField
    setChannelLabel 12 "Set maxhum"
    linkTuyaMCUOutputToChannel 12 val 12
    
    setChannelType 13 TextField
    setChannelLabel 13 "Set minihum"
    linkTuyaMCUOutputToChannel 13 val 13
    
    setChannelType 14 ReadOnly
    setChannelLabel 14 "Temp alarm"
    linkTuyaMCUOutputToChannel 14 val 14
    
    setChannelType 15 ReadOnly
    setChannelLabel 15 "Humidity alarm"
    linkTuyaMCUOutputToChannel 15 val 15
    
    setChannelType 17 TextField
    setChannelLabel 17 "Temperature report"
    linkTuyaMCUOutputToChannel 17 val 17
    
    setChannelType 18 TextField
    setChannelLabel 18 "Humidity report"
    linkTuyaMCUOutputToChannel 18 val 18
    
    setChannelType 19 TextField
    setChannelLabel 19 "Temp sensitivity"
    linkTuyaMCUOutputToChannel 19 val 19
    
    .

    typing a value e.g. 240 for max. temp. in the text field to trigger an alarm saves it in the OBK but does not send it to the MCU because after a reboot the old values still entered in the cloud are shown again.

    Edit: the sensor is powered by batteries and the MCU switches on the wifi module when sending the data, so the parameter changes must rather be saved in the HA and sent when the wifi is switched on, therefore these channels must be "editable" and "writable" in the HA.

    I don't use the simulator it's not a problem I have the sensor next to my PC and am testing but you may need to - is it under windows or linux?
    You asked about flags.
    The problem with sending flags is quite troublesome and I have read about it already with blinds.
    When I send in the autoexec setting the flags for example.
    "Flags 134743044"
    then the flags should turn on: 2,10,19,27,43,47
    but, unfortunately, above the 30th one, completely different flags are switched on.
    With roller shutters it is similar - I send flags and they move and other flags are switched on, most often button locking, as my colleagues wrote about in threads about roller shutters.
    It looks as if one of the higher flags is not included in the counting/recounting from bin to hex because I think that is how it is done and then the shift occurs but as I wrote I am not a programmer, it is just my thoughts.

    I have checked on WBR1 that the 31st flag is the last one to change the value of the flags, if you select all the flags from 1-30 there are enough digits, adding 31 causes overflow.
  • #215 21382506
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    I apologise for re-writing the post below the post but this is probably more readable and easier to translate to a non-Polish version.

    I have set up the low/high temperature and humidity alarms:
    For channels 14 and 15 as "ReadOnly"
    exceeding the lower threshold - value 0
    exceeding of the upper threshold - value 1
    no alarms, i.e. normal state - value 2

    So we need e.g. the following channels: LowAlarm / HighAlarm / Normal
    I think this will be fairly universal.

    Still a question what are the errors and info in the logs?
    
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 881 changes count.
    Info:CFG:####### Flash Save Can't Get Channel 14 (not enough space in array) #######
    Info:CFG:####### Flash Save Can't Get Channel 15 (not enough space in array) #######
    Error:CMD:no file early.bat err -2
    
    .

    Before I can do the thermostat settings from HA or the web I wanted to set the alarm values from autoexec but the command:
    "SetChannel" does not work:
    
    setChannelType 10 ReadOnly
    setChannelLabel 10 "Set max temp"
    linkTuyaMCUOutputToChannel 10 val 10
    SetChannel 10 250
    
    .
    maybe because the channel is read-only?
  • #216 21384337
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12639
    Thank you for your submissions! Your comments are very much appreciated.

    I may think about a system in this style, although in principle a lot of this can already be done via HTML Widgets and a custom page in HTML hosted on LittleFS:
    Alternative HTML control page for TOMPD-63-WIFI .
    Still, I think it will be worth adding what you say.

    I'm working on the flags problem, but sprintf/sscanf on MCU is different than on Win32 simulator and I'm a bit stuck:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1494

    
    Info:CFG:####### Flash Save Can't Get Channel 15 (not enough space in array) #######
    
    .
    If you did SetStartValue to -1 for channel 15 then this won't work, only the first channels have flash writes, due to saving flash cycles (we have a system that does one erase for many writes over several sectors, but the side effect is that the flashvars structure has a fixed size and has to be quite small).

    
    Error:CMD:no file early.bat err -2
    
    .
    This could be changed to a warning, this means that there is simply no early.bat in LittleFS

    In my opinion, this code:
    
    setChannelType 10 ReadOnly
    setChannelLabel 10 "Set max temp"
    linkTuyaMCUOutputToChannel 10 val 10
    SetChannel 10 250
    
    .
    should work. I typed it into the simulator and it goes through:
    https://github.com/openshwprojects/OpenBK7231...mmit/b1f745deb151019878b0718bdb1b4cce9ba78831
    Helpful post? Buy me a coffee.
  • #217 21385809
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    p.kaczmarek2 wrote:
    My opinion is that this code:
    Code: [expand][collapse][select all][copy to clipboard].
    setChannelType 10 ReadOnly
    setChannelLabel 10 "Set max temp"
    linkTuyaMCUOutputToChannel 10 val 10
    setChannel 10 250

    should work. I typed it into the simulator and it goes through:
    https://github.com/openshwproj...51019878b0718bdb1b4cce9ba78831
    .

    Unfortunately the values appear on the web page for a while and then the MCU sends the old ones.
    I guess it just doesn't accept them.
  • #218 21385904
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12639
    I have had no such problems, and have even recently operated an Atorch advanced meter in TuyaMCU:
    Advanced energy meter/thermostat with LCD Atorch S1TW-FR - cloudless operation .
    But that may be because the device in question here is a battery-powered device....
    I read somewhere that someone succeeded as he added:
    
    delay_s 0.5
    

    before sending the initial state.

    And yes you would have to look up how in the original firmware this is sent:
    TuyaMCU analyser - UART packet decoder for Tuya devices - dpID detector .

    You can also use tuyaMcu_sendState to send a packet directly.
    Here is the command documentation:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Instead of using setChannel then try while the device is running, live use tuyaMcu_sendState from the documentation to set the dpID (here 10) to a value of 250, complete its type itself, here you have a screenshot of the self-tests so that there is no doubt that it works and sends the packet:
    Screenshot of source code inside an editor, displaying tuyaMcu_sendState commands and test results. .


    Maybe it also needs to be sent via dpCache.
    The battery-powered TuyaMCU devices also have a so-called dpCache. In this case, this device queries the WiFi module itself at startup for these values:
    Code: C / C++
    Log in, to see the code
    .
    The WiFi module responds with a packet 0x10:
    Code: C / C++
    Log in, to see the code
    .
    I wrote about dpCache in this post:
    https://www.elektroda.com/rtvforum/topic3975583.html#20584330
    You use dpCache in two steps:
    1. you set a given channel to be remembered in Flash memory between reboots, here remember that only the first 10-12 channels are remembered, so use channels sequentially, not that you give the number 30....
    Suppose we use channel 5:
    
    // Make value persistant (stored between reboots), 
    // start value -1 means "remember last"
    SetStartValue 5 -1
    
    .
    2. when mapping a dpID to a channel you specify an additional argument, append 1, that is true for bDPCache:
    
    // link dpID 17 to channel 5, the type is val, extra '1' means that its dpCache variable
    linkTuyaMCUOutputToChannel 17 val 5 1
    
    .
    Configured this way, the device knows that when the MCU queries the dpCache, you need to send it the value of channel five in response.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #219 21503091
    smoeller95s
    Level 3  
    Posts: 5
    Rate: 1
    Hello
    I have a strange Problem. My updated devices work fine and im very happy. But sometimes when the Battery runs out and i not change it fast enough (some days) the firmware seems lost.
    The wifi icon on the lcd allways flash but the obk never come alive. No Wifi connection no hotspot. The only solution is erase all and then re flash. Only re flash is not enough.
    Had someone had the same problem before? I have ~ 15 devices and today the 4. had this Problem.
  • #220 21503990
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    I have the same problem with one TH08. I haven't resuscitated it yet but the symptoms are the same: when the battery is discharged the Wifi module is dead. The thermometer itself measures and displays measurements correctly i.e. the Tuya MCU is working properly.
  • ADVERTISEMENT
  • #221 21513410
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    I uploaded the OBK again yesterday. After connecting it, it gave programming but the WiFi network did not appear. I had to remove the CB3S upload the Tuya soft and again the OBK then worked. By the way the update to the latest version went. Now I am waiting for the battery to drain ;-) .
  • #222 21513752
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12639
    @insmod creates "fast wifi connect" modification, it should help with battery life in this type of device
    Helpful post? Buy me a coffee.
  • #223 21550631
    silver_mc
    Level 13  
    Posts: 76
    Rate: 11
    Hello,
    Has anyone encountered a version where the units are in °F and °C? In the Tuya app, it was possible to change them. In OpenBK, the units on the display are showing in °F. Is it possible to change this via a dpID? Unfortunately, I no longer have the original firmware as I lost it somewhere. :/
  • #226 21550661
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    glad to hear it :)
  • #227 21599220
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    Hello,
    I'm new to openBeken.
    I bought this temperature and humidity sensor at AliExpress:


    [BK7231N ] Teardown of TH08 LCD Calendar/clock/temperature/humidity, 3xAAA battery, backlight

    [BK7231N ] Teardown of TH08 LCD Calendar/clock/temperature/humidity, 3xAAA battery, backlight


    I can't find the correct pins to flash OpenBeken.
    Are the marked pins correct: for 3.3V, GND, TX, and RX?
    Where is the pin for CEN?

    Thank you.
  • #228 21599227
    DeDaMrAz
    Level 22  
    Posts: 604
    Help: 34
    Rate: 129
    blacksun2 wrote:
    I can't seem to find the correct pins to flash OpenBeken.
    Are the marked pins correct: for 3.3V, GND, TX, and RX?
    Where is the pin for CEN?


    Those are for the TuyaMCU most likely, You have CBU module so use this for pinout and reference - https://images.tuyacn.com/goat/pdf/01J6RB48RJ...er%20Platform_Tuya%20Developer%20Platform.pdf

    We have a flasher tool that has read flash/backup option, it is important that you backup CBU module for reference and whatever need may be.

    Search the forum for TuyaMCU driver and how to use it after you have flashed the module. I also think this device was done before so do some searching as well before we can move on with config and the rest.
  • #229 21599265
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    DeDaMrAz wrote:

    Those are for the TuyaMCU most likely
    CBU module so use this for pinout


    Sorry for the stupid question, but what is "TuyaMCU"?

    Regarding CBU, do I have to use the PINs at CBU-Board? Are there no contact-Point which I can use on the board? I am asking because of avoiding soldering.
  • #230 21599298
    DeDaMrAz
    Level 22  
    Posts: 604
    Help: 34
    Rate: 129
    blacksun2 wrote:
    Sorry for the stupid question


    there is no stupid questions only stupid answers :)

    TuyaMCu is the other chip on the board near which you've fount Rx and Tx pads, it is used for communicating with the sensor and LCD and only uses CBU module for WiFi communication via that UART (Rx and TX) no way for me to verify and the picture is not revealing much - just from experience.
    We are not touching that chip, only CBU module, so you may try to flash the device via those pads but be prepared for interuptions form TuyaMCU and being unable to flash it because of it.
  • ADVERTISEMENT
  • #231 21604667
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    [postid:b622992f1e][/postid:b622992f1e]
    I have now successfully flashed OBK 1.18.134 on my device.
    As long as the CBU is powered via the TTL USB, there is a permanent Wi-Fi connection, and the values are also published to HomeAssistant.
    Since the MCU is not powered, the values are naturally 0.

    I assembled the device and let it run overnight on batteries. There was not a single transmission to HomeAssistant.

    I use this autoexec.bat.
    I use almost the same autoexec.bat on a TH01. The behavior is the same here, too.

    What's the problem?

    
    startDriver NTP
    ntp_setServer fritz.box
    ntp_timeZoneOfs 2
    waitFor NTPState 1
    mqtt_broadcastInterval 20
    mqtt_broadcastItemsPerSec 20 
    startDriver TuyaMCU
    startDriver tmSensor
    waitFor MQTTState 1
    PowerSave 1
    
    
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1
    
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2
    
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 "Battery_Level"
    linkTuyaMCUOutputToChannel 3 val 3
    
    setChannelType 4 ReadOnly
    setChannelLabel 4 "Battery_Level_in_Percent"
    linkTuyaMCUOutputToChannel 4 val 4
    


    For commands like waitFor NTPState, mqtt_broadcastInterval, mqtt_broadcastItemsPerSec, waitFor MQTTState, etc., does the order in the autoexec.bat matter?
    Or does it matter where the commands are located in the file?
  • #232 21622917
    bogdanelhh
    Level 4  
    Posts: 8
    Rate: 6
    Hello, I flashed this bad boy
    PCB of a device with CBU module and labeled pads and electronic components.
    By hooking to cen, rx tx gnd and 3v3. To have it programmable I had to strip 3v3 below right side of push button between the two free pads. I also cut the rx tx traces on the back and resoldered them after flashing.
    Now the only issue I have is that it's not reporting to homeassistant, and that's because I suspect that tuyamcu shuts down cbu before he manages to connect or anything.
    Is there a way to increase the time cbu stays on? or even keep it on always and enable deepsleep?
  • #233 21623129
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    My autoexec:

    
    clearIO
    PowerSave 1
    startDriver NTP
    ntp_setServer xxx.xxx.xxx.xxx
    waitFor NTPState 1
    ntp_timeZoneOfs 1
    startDriver TuyaMCU
    startDriver tmSensor
    Flags 2251937253164036
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1
    setStartValue 1 -1
    
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2
    setStartValue 2 -1
    
    setChannelType 3 ReadOnlyLowMidHigh
    setChannelLabel 3 "Batt_state"
    linkTuyaMCUOutputToChannel 3 val 3
    setStartValue 3 -1
    
    setChannelType 4 BatteryLevelPercent
    setChannelLabel 4 "Batt_level"
    linkTuyaMCUOutputToChannel 4 val 4
    setStartValue 4 -1
    
    setChannelType 10 TextField
    setChannelLabel 10 "Set maxtemp"
    linkTuyaMCUOutputToChannel 10 val 10
    
    setChannelType 11 TextField
    setChannelLabel 11 "Set minitemp"
    linkTuyaMCUOutputToChannel 11 val 11
    
    setChannelType 12 TextField
    setChannelLabel 12 "Set maxhum"
    linkTuyaMCUOutputToChannel 12 val 12
    
    setChannelType 13 TextField
    setChannelLabel 13 "Set minihum"
    linkTuyaMCUOutputToChannel 13 val 13
    
    setChannelType 14 ReadOnly
    setChannelLabel 14 "Temp alarm"
    linkTuyaMCUOutputToChannel 14 val 14
    setStartValue 14 -1
    
    setChannelType 15 ReadOnly
    setChannelLabel 15 "Humidity alarm"
    linkTuyaMCUOutputToChannel 15 val 15
    setStartValue 15 -1
    
    setChannelType 17 TextField
    setChannelLabel 17 "Temperature report"
    linkTuyaMCUOutputToChannel 17 val 17
    
    setChannelType 18 TextField
    setChannelLabel 18 "Humidity report"
    linkTuyaMCUOutputToChannel 18 val 18
    
    setChannelType 19 TextField
    setChannelLabel 19 "Temp sensitivity"
    linkTuyaMCUOutputToChannel 19 val 19
    
    .

    It is important that these flags are enabled:
    Flag 2 10 19 37 51

    The new version of OBK with fast WiFi connection and everything is hula and even the battery life has slightly improved although unfortunately still far from the original. But something for something at least the Tuya cloud is not needed.
    To turn on the WiFi you have to press the button every few seconds: it turns on the backlight and turns on the power supply to the WiFi module is an option for an update also without disassembly.
  • #234 21623283
    bogdanelhh
    Level 4  
    Posts: 8
    Rate: 6
    >>21623129 now it seems to cooperate more, many thanks for settings. Have a nice one!
  • #235 21624057
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    GAAD wrote:

    
    setChannelType 4 BatteryLevelPercent
    setChannelLabel 4 "Batt_level"
    linkTuyaMCUOutputToChannel 4 val 4
    setStartValue 4 -1
    
    setChannelType 14 ReadOnly
    setChannelLabel 14 "Temp alarm"
    linkTuyaMCUOutputToChannel 14 val 14
    setStartValue 14 -1
    
    setChannelType 15 ReadOnly
    setChannelLabel 15 "Humidity alarm"
    linkTuyaMCUOutputToChannel 15 val 15
    setStartValue 15 -1
    
    .


    Are Channel 4, 14 and 15 original dp_ids from Tuya?
    How do you get them?
    I am asking because at https://iot.tuya.com, for my TH08b is only shown

    "code": "temp_current",
    "dp_id": 1,
    "code": "humidity_value",
    "dp_id": 2,
    "code": "battery_state",
    "dp_id": 3,
    "code": "temp_unit_convert",
    "dp_id": 9,
    "code": "temp_calibration",
    "dp_id": 23,
    "code": "hum_calibration",
    "dp_id": 24,

    Another question:
    How can I change time-format (12h AM-PM or 24h)?
  • #236 21624747
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    blacksun2 wrote:
    How do you get them?
    I am asking because at https://iot.tuya.com, for my TH08b is only shown

    how did you get these? usually you link a developer account with the Tuya app, pair device, then go into API explorer in dev portal to get dpID info. If you have factory fw dump or the Tuya config file downloaded I could check with that.
  • #237 21625533
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    divadiow wrote:
    usually you link a developer account with the Tuya app, pair device, then go into API explorer in dev portal to get dpID info. If you have factory fw dump or the Tuya config file downloaded I could check with that.

    That's my situation too. That's exactly how I did it.
    If you were thinking about the ltchiptool, it also only says that there are only these dp_IDs:
    Screenshot of terminal and warning dialog showing missing YAML data point mappings.

    Therefore, the question to GAAD was where he got the other dp_IDs from
    Attachments:
    • readResult_BK7231N_QIO_TH08B_2025-07-7-23-03-18.bin (2 MB) You must be logged in to download this attachment.
  • #238 21625539
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    yes, but this bit means it's matched it to the wrong schema

    Error: schema ID (000004vqh2) does not match device schema ID (eh4m6o)
  • #239 21625542
    blacksun2
    Level 8  
    Posts: 59
    Rate: 1
    divadiow wrote:
    yes, but this bit means it's matched it to the wrong schema


    I know.
    Because you have other oppotunities, I attached the backuped Firmware tool.
  • #240 21625617
    GAAD
    Level 17  
    Posts: 289
    Help: 3
    Rate: 19
    I knew the parameters I set on my thermometer were e.g. alarms. And when a channel reported the value I had set I knew that it was, for example, a maximum temperature alarm. I called up the alarms and took channel readings. These channels in the OBK don't do much anyway because so far I have not been able to send/edit these values. My version of this thermostat may also be different these devices change all the time. In ESPHome you can make the handling of the settings a little more convenient but for this sensor I have not tested
📢 Listen (AI):

Topic summary

✨ The discussion centers on the teardown, firmware modification, and protocol analysis of the TH08 LCD calendar/clock/temperature/humidity sensor powered by 3xAAA batteries with backlight, based on the BK7231N chip. The device is identified as a newer version of the TH06 model, featuring a TuyaMCU module communicating via a low-power Tuya serial protocol (version 00). Users successfully flashed OpenBK firmware without desoldering, enabling temperature, humidity, and battery monitoring with MQTT integration and NTP time synchronization. Key challenges included understanding the MCU-module communication, especially time synchronization commands and power management to optimize battery life. The MCU sends commands such as ObtainDPCache and ObtainLocalTime, with the WiFi module responding accordingly. Firmware updates improved battery consumption by ensuring the WiFi module powers down promptly after data transmission. The device’s RTC (U8) communicates with the MCU (U3) over a serial or I2C-like interface, with ongoing efforts to decode this traffic. Users experimented with modifying battery power sources, including LiPo and USB power mods with step-down regulators, confirming device operation at voltages between 3.3V and 4.5V. The Tuya app lacks options to adjust sensor reporting intervals, and attempts to change polling times via Tuya protocol commands were unsuccessful, likely due to firmware limitations. Serial sniffing and analysis tools like TuyaMCU Analyzer and SniffUART were used to decode dpIDs, confirming dpID 1 as temperature, dpID 2 as humidity, dpID 3 as battery state, and dpID 9 as Celsius/Fahrenheit setting. Firmware versions and MCU versions were compared, revealing some early versions had display update issues. The community contributed to improving OpenBK firmware to handle specific Tuya commands, including proper responses to WiFi signal strength queries, enhancing power management. MQTT integration with Home Assistant was refined, including battery level display improvements using LowMidHigh channel types. OTA updates and configuration changes require keeping the WiFi module powered, achievable via long button presses or hardware modifications. Attempts to use Tuya-cloudcutter for remote flashing were unsuccessful due to lack of matching profiles. Some users reported issues with sensor readings showing zero after flashing, possibly due to hardware revisions or firmware mismatches. Overall, the device is well-supported by OpenBK firmware with active community development focusing on power optimization, protocol decoding, and integration with home automation platforms.
Generated by the language model.

FAQ

TL;DR: For TH08/TH08B owners who want OpenBeken without killing battery life, the key fix is low-power Tuya handling: battery life improved from 3 days to nearly 2 months, and one contributor confirmed, "the MCU turns off the module as soon as the last packet from the module is received" after the protocol fix. [#20802807]

Why it matters: This FAQ turns a 9-page reverse-engineering thread into a practical flashing, recovery, and configuration reference for BK7231/BK7238-based TH08 sensors.

Option Power behavior reported in thread Typical result
Original Tuya firmware about 6 weeks to nearly 2 months on batteries Best battery life, cloud-dependent
Early OpenBeken builds about 3 days on 3xAAA NiMH Functional, but poor low-power handling
Updated OpenBeken after low-power packet fix about 2 weeks on alkalines with level still high, or close to original behavior Best cloud-free compromise

Key insight: The TH08 is not a simple Wi-Fi sensor. A separate TuyaMCU controls sensor reads, LCD updates, and power to the Wi-Fi module, so flashing and battery life both depend on handling that MCU correctly. [#20723152]

Quick Facts

  • The original TH08 teardown identified 3xAAA power, a 2.8 V main rail, BK7231N-based CBU Wi-Fi module, AHT20-class temperature/humidity sensing, and BL55070 LCD driving on PCB TH08-CBU-ATH20-V2 2023/07/22. [#20723152]
  • Measured battery-state thresholds on one TH08 were High→Medium at 4.0 V and Medium→Low at 3.1 V; below 3.0 V the 2.8 V regulator output started to drop and the LCD dimmed. [#20804228]
  • Reported prices were €11.79 advertised and €4.49 paid on AliExpress for the original TH08 listing. [#20723152]
  • A USB power mod worked with a USB-C socket + step-down regulator set to 4.2 V, and another user later confirmed operation even from 5 V without regulator overheating. [#20791566]
  • Home Assistant update behavior on original firmware was not hourly-only in practice: users observed about 2-minute updates on change and about 15–17 minutes when values stayed stable. [#20724719]

How do I flash OpenBeken on the TH08 or TH08B battery temperature and humidity sensor without bricking the CBU/BK7231 module?

Flash it as a TuyaMCU device, not as a standalone Wi-Fi sensor. 1. Back up the original firmware first. 2. Isolate the Wi-Fi module from the TuyaMCU or the MCU will fight the UART. 3. Power the CBU directly at 3.3 V for flashing, then restore the cut or lifted connections before normal use. Several users reported flashing failure around 70% unless RX/TX and sometimes CEN were isolated, while backup reads could still succeed. [#20918829]

Which traces or pins need to be cut, lifted, or isolated on the TH08 PCB so the TuyaMCU does not interfere with UART flashing?

On the original TH08, isolate at least the MCU-to-CBU UART path, and often CEN too. The proven methods were: cut the traces between the MCU and the RX1/TX1 pads, or lift the MCU pin tied to CEN so the TuyaMCU cannot reset the CBU during flashing. On later TH08B-style boards, users reported that lifting or isolating pin 8/CEN was often the decisive fix, while some revisions still needed RX/TX isolation as well. [#20929625]

What is TuyaMCU in the TH08 design, and how does it communicate with the CBU Wi-Fi module and the LCD controller?

"TuyaMCU" is a secondary microcontroller that manages the sensor, LCD logic, backlight, and low-power behavior, while the CBU handles Wi-Fi only. In the first TH08 teardown, the MCU talked to the CBU over RX1/TX1, read the sensor over I2C, and coordinated with a separate display/RTC-related IC. That split design is why OpenBeken must emulate the low-power serial protocol instead of driving the whole device directly. [#20723152]

What is a dpID in the Tuya protocol, and how do I find the correct dpIDs for temperature, humidity, battery, and unit conversion on TH08 variants?

"dpID" is a Tuya data-point identifier that names one device value or setting, such as temperature, humidity, or unit selection, and defines its type and range. On the original TH08, thread captures confirmed dpID 1 = temperature, 2 = humidity, 3 = battery state, and 9 = °C/°F unit. Users found them by UART sniffing with TuyaMCUAnalyzer, Tuya IoT developer pages, or firmware/config extraction from backups. [#20729519]

Why does the TH08 show temperature and humidity as zero in OpenBeken even though the LCD still displays valid readings?

That usually means OpenBeken is not receiving valid TuyaMCU packets, even though the standalone MCU still updates the LCD. The most common causes were wrong UART conditions, artificial CBU power during testing, wrong baud assumptions, or a bad RX solder joint. One user fixed zeros immediately after repairing the MCU RX connection and then saw normal Tuya packets such as dpID 1 = 264 and dpID 2 = 11 in the log. [#21002511]

How should autoexec.bat be configured for a TH08 or TH08B so OpenBeken reports temperature, humidity, battery state, and NTP time correctly?

Start NTP, TuyaMCU, and tmSensor, then map channels 1/2/3 to dpIDs 1/2/3 with temperature_div10, Humidity, and ReadOnlyLowMidHigh. A working baseline was: startDriver TuyaMCU, startDriver tmSensor, startDriver NTP, ntp_setServer ..., ntp_timeZoneOfs ..., setChannelType 1 temperature_div10, linkTuyaMCUOutputToChannel 1 val 1, setChannelType 2 Humidity, linkTuyaMCUOutputToChannel 2 val 2, setChannelType 3 ReadOnlyLowMidHigh, linkTuyaMCUOutputToChannel 3 val 3. For some variants, adding tuyaMcu_defWiFiState 4 solved missing reports. [#20893860]

Why does the TH08 keep losing Wi-Fi or become inaccessible after the batteries run down, and what reflashing or configuration steps recover it?

Low battery can leave the CBU in a bad state after repeated failed boots. Multiple users reported a pattern where the LCD still worked, the Wi-Fi icon flashed, but OpenBeken no longer brought up Wi-Fi or AP mode until the CBU was erased and reflashed. One later workaround was rebuilding with flash runtime variables disabled, because the suspected failure mode was repeated brownouts corrupting flash during boot-count or state writes. [#21745721]

What causes the TH08 battery life to drop from weeks on original Tuya firmware to only a few days on some OpenBeken builds?

Early OpenBeken builds did not finish the low-power Tuya handshake the way the MCU expected, so the Wi-Fi module stayed on far too long. Users measured the module staying awake for more than 1 minute on some OpenBeken builds instead of about 10 seconds on stock firmware, and battery life dropped to about 3 days on rechargeable AAA cells. That was traced to missing or wrong low-power protocol packets, not to the sensor itself. [#20746981]

How was the missing low-power Tuya packet handled so the MCU powers off the Wi-Fi module promptly and saves battery on TH08?

The fix was to implement the missing low-power reply that the MCU expected when it queried router signal strength near the end of the wake cycle. Before that fix, OpenBeken answered incorrectly and the MCU kept the CBU alive while waiting. After the new handling landed in later 1.17.30x builds, users confirmed the MCU now cut power to the Wi-Fi module immediately after the last packet, restoring near-stock low-power behavior. [#20796796]

How can I keep the TH08 Wi-Fi module awake long enough to access the OpenBeken web interface, run OTA updates, or change settings?

Use the device’s own wake behavior or temporarily bypass power control. A long button press can keep the module awake long enough for OTA and settings on many TH08 units, and some users also forced the CBU on by wiring the module ground or supply directly past the MCU-controlled switch. On one tested build, a long press held the module awake for about 92 seconds, which was enough for web access and changes. [#21072200]

Which dpID or raw Tuya command changes the TH08 display from °F to °C, and how do I send it from OpenBeken?

On TH08 variants discussed in the thread, dpID 9 is the temperature-unit selector. When normal state writes did not work, users succeeded by sending the raw packet 55AA001000070101090400010026 after a short delay, for example with delay_s 2 followed by uartSendHex ... in autoexec.bat. Another contributor confirmed that packet switched the display from °F to °C reliably on their unit. [#21550660]

What is dpCache in low-power Tuya devices, and when do I need it instead of a normal tuyaMcu_sendState command?

"dpCache" is a low-power Tuya startup cache that stores selected settings in the Wi-Fi module so the MCU can fetch them immediately after wake-up, before normal cloud traffic begins. You need it for battery-powered parameters that the MCU requests with packet 0x10, especially settings it expects at boot. In OpenBeken, that means marking a mapping as dpCache and storing the linked channel persistently, rather than only pushing the value with a normal runtime tuyaMcu_sendState. [#21385904]

How do I troubleshoot NTP time sync problems on the TH08 when the display stays at 1970 or 2070 and the log shows NTP receive errors?

First fix the NTP server and time zone, because the usual cause was a bad or unreachable server address. One user used a LAN IP as NTP and kept getting NTP_CheckForReceive: Error while receiving server's msg; switching to a valid reachable server resolved the wrong 1970/2070 display time. Also set the correct offset manually, because OpenBeken in this thread did not yet auto-handle DST, so Portugal needed 0 or 1, while Spain used 1 or 2 depending on season. [#21074347]

For battery-powered room sensors like the TH08, how does Zigbee compare with Wi-Fi in terms of power consumption and long-term usability?

Zigbee is markedly better for battery life in this use case. The thread’s direct comparison was practical rather than theoretical: users saw original Wi-Fi TH08 behavior lasting 6 weeks to nearly 2 months, but poorly tuned OpenBeken Wi-Fi builds could drop to 3 days. One contributor explicitly noted that Zigbee battery devices are much more efficient because transmit power cost is far lower than conventional Wi-Fi. [#20743433]

What are the battery level thresholds on the TH08, and how safe is it to power the device from USB, LiPo, or rechargeable AAA cells instead of the original 3xAAA setup?

Measured thresholds on one TH08 were 4.0 V for High→Medium and 3.1 V for Medium→Low, with the low-battery icon appearing below 3.1 V. The same user reported stable operation from 5 V USB, while another used a 4.2 V USB-C step-down mod successfully. Rechargeable 1.2 V AAA NiMH cells worked, but early OpenBeken power handling could drain them in about 3 days; after low-power fixes, battery life improved substantially. [#20804228]
Generated by the language model.
ADVERTISEMENT