Blitzwolf BW-AR01 air quality meter

I have purchased this air quality meter from here: Blitzwolf® bw-ar01 wifi air quality monitor temp and humidity air detector wireless smoke co2 alarm app remote control smart linkage work with smart life tuya app Sale - Banggood.com

Since this is a brand new device, probably others may be interested in more details, so I put here some info on this product for future reference.

At the moment has no support via the Tuya v2 integration (although works with the Tuya app). I was curious if I could install ESPHome on it so I took it apart to see whats inside:

  • has a TYWE3S Wifi chip. Luckily ESP8266 based so ESPHome/Tasmota should be possible, but if you (like me) were hoping for an ESP32 based device in a relatively nice case to connect external BT sensors then this is not the right device
  • temperature and humidity are handled by a DHT20 sensor, which is an updated version of the well known DHT11 Introducing DHT20 Temperature and Humidity Sensor and Comparing it with DHT11! - Lastest Open Tech From Seeed It seems the communication protocol is different, to ESPHome support is questionable.
  • KQM6600TA seems to be the TVOC sensor, again doesn’t seem to be supported by ESPHome at the moment, google comes up with results in chinese mostly.
  • the PCB has rather curious markings, like TP1, TP2, TP3, etc. instead of GPIOs that I would expect. Probably I could track them to the pins of the TYWE3S chip by impendance meausurement.
  • It seems to have a header for connecting dupont wires which looks like an RX/TX/GND/3V3 connector, but its unmarked.

Attached I am sending a few pictures of the PCB and a screenshot from the Tuya app. Will be playing with it a bit further, in the meantime if you have any ideas what to try I am happy to check it out.


1 Like

In my limited experience TP=test point. In other words somewhere interesting to stick a multimeter or oscilloscope probe. See what you can trace with a continuity probe.

1 Like

Also dht 20 https://github.com/esphome/feature-requests/issues/1398

1 Like

(Sorry for having to split this over multiple posts, but I can only add two links as a new user to this forum, but I figure this is a case when more relevant links are worth it):

This seems like the same device as the the “Tuya Smart Air Box” (v2?).

The device does not come with an USB to Serial chip, so it has to be flashed via a separate serial cable. You might have some luck if you haven’t updated it with tuya-convert (https://github.com/ct-Open-Source/tuya-convert) OTA but my particular device was running a too recent firmware, so I had to flash it the manual way over a serial connection.

Flashing the device:

  • Compile the ESPHome Tuya configuration for TYWE3S.

  • Attach the USB to TTL Serial cable to the device.

  • Upload firmware.

1 Like

ESPHome Tuya configuration for the TYWE3S

Here is an example ESPHome configuration:

substitutions:
  devicename: espsmartairbox
  ch2o_formaldehyde: ch2o_formaldehyde
  temperature: temperature
  humidity: humidity
  voc: voc
  carbon_dioxide: carbon_dioxide

esphome:
  name: ${devicename}
  platform: ESP8266
  board: esp01_1m
  
  on_boot:
    # work around https://github.com/esphome/feature-requests/issues/607
    - sensor.template.publish:
        id: ${ch2o_formaldehyde}_skips
        state: 0
    - sensor.template.publish:
        id: ${temperature}_skips
        state: 0
    - sensor.template.publish:
        id: ${humidity}_skips
        state: 0
    - sensor.template.publish:
        id: ${voc}_skips
        state: 0
    - sensor.template.publish:
        id: ${carbon_dioxide}_skips
        state: 0

# Enable logging, but not to serial, because it's shared with the Tuya MCU
logger:
  baud_rate: 0

api:
  password: !secret your_api_password_secret
ota:
  password: !secret your_ota_password_secret

wifi:
  ssid: !secret your_wifi_ssid_secret
  password: !secret your_wifi_password_secret
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${devicename} Fallback Hotspot"
    password: !secret your_wifi_ap_password_secret

captive_portal:

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

# register sensors for the datapoints
sensor:
  - platform: tuya
    name: ${ch2o_formaldehyde}
    sensor_datapoint: 21
    accuracy_decimals: 2
    filters:
      # work around https://github.com/esphome/feature-requests/issues/607
      - lambda: auto s = id(${ch2o_formaldehyde}_skips); if(s->state >= 6) { return x; } else { s->publish_state(s->state+1); return {}; }
      - multiply: 0.01
    unit_of_measurement: "mg/m3"
    icon: "mdi:chemical-weapon"
    state_class: "measurement"
  - platform: tuya
    name: ${temperature}
    sensor_datapoint: 18
    accuracy_decimals: 1
    filters:
      # work around https://github.com/esphome/feature-requests/issues/607
      - lambda: auto s = id(${temperature}_skips); if(s->state >= 2) { return x; } else { s->publish_state(s->state+1); return {}; }
      - multiply: 0.1
    unit_of_measurement: "°C"
    icon: "mdi:temperature"
    device_class: "temperature"
    state_class: "measurement"
  - platform: tuya
    name: ${humidity}
    sensor_datapoint: 19
    accuracy_decimals: 1
    filters:
      # work around https://github.com/esphome/feature-requests/issues/607
      - lambda: auto s = id(${humidity}_skips); if(s->state >= 2) { return x; } else { s->publish_state(s->state+1); return {}; }
      - multiply: 0.1
    unit_of_measurement: "%"
    device_class: "humidity"
    state_class: "measurement"
  - platform: tuya
    name: ${voc}
    sensor_datapoint: 2
    accuracy_decimals: 1
    filters:
      # work around https://github.com/esphome/feature-requests/issues/607
      - lambda: auto s = id(${voc}_skips); if(s->state >= 6) { return x; } else { s->publish_state(s->state+1); return {}; }
      - multiply: 0.1
    unit_of_measurement: "ppm" #µg/m³?
    device_class: "volatile_organic_compounds"
    state_class: "measurement"
  - platform: tuya
    name: ${carbon_dioxide}
    sensor_datapoint: 22
    accuracy_decimals: 0
    filters:
      # work around https://github.com/esphome/feature-requests/issues/607
      - lambda: auto s = id(${carbon_dioxide}_skips); if(s->state >= 6) { return x; } else { s->publish_state(s->state+1); return {}; }
    unit_of_measurement: "ppm"
    device_class: "carbon_dioxide"
    state_class: "measurement"

  # work around https://github.com/esphome/feature-requests/issues/607
  - platform: template
    id: ${ch2o_formaldehyde}_skips
    internal: true
    accuracy_decimals: 0
  - platform: template
    id: ${temperature}_skips
    internal: true
    accuracy_decimals: 0
  - platform: template
    id: ${humidity}_skips
    internal: true
    accuracy_decimals: 0
  - platform: template
    id: ${voc}_skips
    internal: true
    accuracy_decimals: 0
  - platform: template
    id: ${carbon_dioxide}_skips
    internal: true
    accuracy_decimals: 0

This contains an attempt to map the datapoints provided by the MCU to some sensible sensors. Please let me know if these are off, I’ve only tested with the Tuya Smart Air Box.

It was important to set baud_rate: 0 for the logger in the above config, because the TYWE3S uses the serial port to communicate with the Tuya MCU.

1 Like

Attaching the serial cable

I just temporarily soldered some Dupont cables to these locations:

Then connected the Dupont cables to my serial programmer.

Upload firmware

Just use ESPHome.

I had to try to flash multiple times before it got through, with various error messages. I ended up taking the command line that ESPHome printed it was using and running it over and over again until it worked (with the baud rate of 460800 instead of the automatically suggested lower 115200)…

## Note on the serial programmer / interface attachment

I used an old serial cable from Adafruit that I had lying around, but there are some newer recommendations available over at https://tasmota.github.io/docs/Getting-Started/#serial-to-usb-adapter.

There are other options here, mentioned in https://tasmota.github.io/docs/TuyaMCU-Devices/#tywe3s-connection-options, but I found just soldering to be easy enough and figured it would be more stable rather than trying to press-fit a jumper header.

## More information:

- https://esphome.io/components/tuya.html
- https://esphome.io/components/sensor/tuya.html
- https://tasmota.github.io/docs/devices/TYWE3S/
- https://tasmota.github.io/docs/TuyaMCU/
- https://tasmota.github.io/docs/TuyaMCU-Devices/
- Data Sheet: https://developer.tuya.com/en/docs/iot/wifie3smodule?id=K9605ua1cx9tv
5 Likes

so the sensor is finally supported in HA 2021.11, so finally I have a better overview of the measured values and it seems none of the values except temperature and humidity change. I have moved the sensor to my bedroom over night and naturally i was expecting the CO2 values to go up during 3 people sleeping there (my daughter usually moves to our bedroom after midnight), but there’s no significant change in the CO2 values that would correspond to the actual behaviour of our household (CO2 values going up when we sleep there and going down when we open the windows)

image

anybody with a similar experience?

1 Like

So, I have the “tuya version” with Zigbee SoC, but everything else is the same (the PCB is v1.1 so some parts are different but the sensors are the same. it is connected through zigbee2mqtt to my HA.)

1, I have absolutely the same values (358-368 ppm jumping ut and down.) for CO2. I’m also curious what is measuring the CO2, if there is only a temperature and humidity sensor and a TVOC sensor (KQM6600TA is only a TVOC sensor, there is no any connection with CO2)

So I am sceptic with this device

I have a Tuya device with the same sensor but the PCB layout is a little bit different. The linear regulator is placed under the ESP.

Flashing using the pins was always interrupted by writing errors. It was necessary to remove chip reading out the sensors which is on the same serial interface the the programming interface.

The values are also not changing over the time. Lets see, maybe it need some time for calibration.

Thank you so much for this! I have successfully converted my AR-01 to ESPHome. This should be documented somewhere. If it is, I haven’t found it.

I did have to do minor adjustments to the config:

esphome:
  name: ${devicename}
  platform: ESP8266
  board: esp01_1m

  on_boot:
    ...

to:

esphome:
  name: ${devicename}

  on_boot:
    ...

esp8266:
  board: esp01_1m

Finally continued working on this sensor. I share your experience. It seems that sensor datapoint for this sensor is incorrect.

Edit:
Playing with the device a bit more and checking the datapoints it just seems that this device doesn’t have a proper CO₂ measurement. I have a very good air quality sensor which I thought to use to calibrate the BW-AR01 so I was monitoring values coming from all 5 AR01 data points and comparing their changes to the CO₂ changes from the other sensor. No value matched CO₂ going up and down.

I did validate that datapoint 18 is temperature and 19 is humidity.

To test the VOC detection I exposed the sensor to isopropyl alcohol and datapoints 21 and 22 jumped in values.

Datapoint 2 is the only one I didn’t see budge in any scenario. I’m assuming that datapoint 21 is actually VOC and I’m unsure of what 22 and 2 are representing.

Also, for the logger use this config instead of 0 baud_rate:

logger:
  hardware_uart: UART0_SWAP

Edit 2:
Looking at the PCB, I don’t see a CO2 measurement sensor. Unfortunately, this device is going to trash in my case.

Here is a newer variant, supposedly containing a PM2.5 as well. What’s your take?

It seems that the newer variant also doesn’t have CO₂ measurement, or I am not understanding the thread correctly.

I recently found a variant that seems to have an actual CO₂ sensor, as per comments of the product:

You’ll need a WiFi version if you want to flash ESPHome on it.

Thanks a lot to all the contributors in this thread. I used these devices with the localtuya integration for a couple of months now, experiencing all kinds of instabilities. Finaly took the leap and flashed ESP-Home onto one of them following this thread. And it seems to be working great right away. So again, thanks a lot! I’ll flash a couple more of those now…

One question (which will show off my whole inexperince with all of this): What do i need to change in the yaml to turn off the blue LED?

Lifth

Edit Well, seems like i got lucky with the first device suceeding to flash on the second attempt. The remaining 6 were quite a bit more challenging, because of the Tuya MCU making some noise on the TX and RX as mentioned above. I used a ESP-Home, a CP2102 USB to TTL converter in combination with the Jig described here:

Couldn’t find the Baud-Rate setting mentioned above, so i just kept banging my head against the wall with flash-attempts. The only strategy that seemed to help was replugging the USB-Converter and asap clicking the “plugged into this pc”-option.

With the latest ESP-Home Version i changed the device class of DP02 ininthe code provided above from volatile_organic_compounds to volatile_organic_compounds_parts. That gets rid of the annoying warning from the home assistant integration.

Custom uart device KQM6600TA whitout ATmega chip and tuya datapoint:

https://www.homeassistant-cz.cz/viewtopic.php?p=9518#p9518

helper page: https://blog.csdn.net/weixin_45700726/article/details/107179149