logo elektroda
logo elektroda
X
logo elektroda

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

minusync 
Generic battery-powered temperature and humidity sensor.
It is from Aliexpress but as always there simple search there brings up more relevant results then looking at some specific seller








I can confirm that flashing it using Python and OpenBK7231N_QIO file works. The new flashing tool by OB doesn't seem to be ready yet.
I am also not sure but it is said to be using a CHT8305 sensor.

CB3S datasheet: https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076
CHT8305: http://sensylink.com/a/products/lm2/CHT8305.html





At the moment it seems that it does not have a driver yet, but the discussion about CHT8305 driver seems to be going on here https://github.com/openshwprojects/OpenBK7231T_App/issues/584

I also have no idea how to set the pins for this device. In addition to temp and hum information, battery information should also be received. Also, this device probably requires a deep sleep option. (Originally in app it had the option to set custom polling time)

Update:
Summary of how to get your sensor working.

If you have successfully overwritten the sensor software, connect to the sensor's temporary AP and set up your wifi and MQTT on browser address 192.168.4.1.
When the sensor restart is done, you can find the sensor's new address in your router's DHCP lease table.
Connect from your web browser to that address.
Set sensor flags 10 and 19 to true.
In configuring general tab set uptime seconds something btwn 5-15 seconds.
Open the Web Application and update the software to the latest version. (optional)
Create an u desktop autoexec.bat file with the following content:

startDriver tuyaMCU
startDriver tmSensor
linkTuyaMCUOutputToChannel 1 val 1
setChannelType 1 Temperature_Div10
linkTuyaMCUOutputToChannel 2 val 2
setChannelType 2 Humidity


drop bat file to the filesystem box (in web application).
Restart sensor.
Wait a few minutes to see if the sensor reads data. On the sensor home page, you should also see that two divers are working.
If OK, in order for MQTT to work, you must now remove the external power supply of the sensor and leave it only on the batteries. I managed to leave the chip power leads inside the case in case I need them in the future.

If you are using Home Assistant you need to add to your configuration.yaml file the following (Modify it according to your own setup!):

 mqtt:
  sensor:
    - name: "your sensor name here"
      unique_id: your sensor unique id here (you choose it yourself)
      state_topic: "your sensor mqtt topic here/1/get"
      unit_of_measurement: 'C'
      value_template: "{{ (value | float * 0.1 | round(1)) }}"
      
    - name: "your sensor name here"
      unique_id: your sensor unique id here (you choose it yourself)
      state_topic: "your sensor mqtt topic here/2/get"
      unit_of_measurement: '%'
      value_template: "{{ value }}"


Restart HA and check your entities.
These settings may change at any time if HA or OpenBekken changes its software!

About Author
minusync wrote 56 posts with rating 3 . Been with us since 2023 year.

Comments

p.kaczmarek2 08 Jan 2023 12:47

Thank you, the CHT8305 driver submitted by @ByteMangler will be added hopefully today, I am just waiting for his response. Your post lacks information where to buy, can you show us where such sensor... [Read more]

minusync 08 Jan 2023 13:37

Sure I have multimeter https://obrazki.elektroda.pl/7571237400_1673181348_thumb.jpg https://obrazki.elektroda.pl/1976368200_1673181348_thumb.jpg [Read more]

p.kaczmarek2 08 Jan 2023 14:37

What is the marking on IC1 and Q2? I can't see very well. Does RXD1 and TXD1 of BK7321 module connects to pins of IC1, and if yes, to which pins? [Read more]

minusync 08 Jan 2023 16:49

It is extremely hard to make readable photos bcs the light from markings only reflects at distinct angles. about IC1 it should be UM8005 https://www.unicmicro.com/index.php/en/show-75-127.html "UM8005... [Read more]

superjedi 08 Jan 2023 20:11

Hi everyone, I started working on this module this morning, flashing it is not an issue, (VCC/RX/TX/GND hooked up, needs reset during flashing procedure) I can confirm that the UM8005 is the MCU... [Read more]

p.kaczmarek2 08 Jan 2023 21:02

I didn't check each packet precisely yet, but in general it looks similar to supported TuyaMCU door sensor. It's worth giving a try Here are results from my TuyaMCU analyzer: https://obrazki.elektroda.pl/4639993900_1673207384_thumb.jpg... [Read more]

superjedi 08 Jan 2023 21:19

Unfortunately, it fails flags 10/19 set to 1 MQTT configured Startup command text being: backlog startDriver tuyaMCU; startDriver tmSensor; linkTuyaMCUOutputToChannel 1 val 1; setChannelType 1 Temperature_Div10;... [Read more]

minusync 08 Jan 2023 21:40

I did it Result was not sucess Temperature Channel 1 value 0.00 C Humidity Channel 2 value 0 Percent On the other hand, there is always the possibility that I did something wrong [Read more]

superjedi 08 Jan 2023 21:41

Nevermind, it seems to work - I was powering it through direct 3.3V without any batteries but I guess there may be a diode somewhere and/or a different power path to the MCU that prevented it from being... [Read more]

p.kaczmarek2 08 Jan 2023 21:47

So it's ok? Do you get results to HA? You might also need to set RETAIN flags in flags. Always retain. Do you mean 3.3V directly to WiFi module? No, you can't do that. It won't work that way. First... [Read more]

minusync 08 Jan 2023 22:51

However, I have a feeling that it doesn't really work. With battery power, I can't access the device settings directly, but HA does not show real data. https://obrazki.elektroda.pl/9821186100_167... [Read more]

p.kaczmarek2 08 Jan 2023 22:55

@minusync are you aware about that Home Assistant Discovery does not yet support TuyaMCU devices? You have to create the YAML code for that. You can find an example there: LCD calendar/thermometer/hygrometer... [Read more]

superjedi 08 Jan 2023 23:20

No clue, I'm planning to use them with grafana, I have no instance of HA, so far it seems to work but it doesn't seem to be reliable, though, this may not be an OpenBK related issue at all. Is there... [Read more]

minusync 09 Jan 2023 00:29

HA has again changed something https://obrazki.elektroda.pl/1034919700_1673220011_thumb.jpg It seems that the OB yaml guide is no longer correct. Not sure but I think it should be now something... [Read more]

p.kaczmarek2 10 Jan 2023 00:54

I don't know currently if there is any way to do a safer OTA with that MCU turning off the WiFi module after a given time. We might need to dig deeper in Tuya docs. But yes, it's problematic... I... [Read more]

ionoleinic 10 Jan 2023 12:54

Hi, i have a similar device, tmperature and hum sensor.I think it is powered by mcu on board, and i want to ask if i can flash it now with OpenBeken or i should first read a log file from it with comands... [Read more]

minusync 10 Jan 2023 14:39

I got another similar device to work. I can now at least read the data from the device menu. I don't know what the problem with the first one was, they are basically clones. The bigger problem is the... [Read more]

p.kaczmarek2 10 Jan 2023 15:53

Please always try to make a 2MB flash backup, both for safety and for OTA hack, and post it here, I can forward it to Cutter team. It won't hurt if it's a duplicate. . @ionoleinic I am unable to guess... [Read more]

minusync 10 Jan 2023 18:37

I will try to describe the situation with yaml this is what was suggested by you but gives a general error about new rules. sensor: - platform: mqtt name: "Temp" state_topic:... [Read more]