Air Box WP6003

I know im a lil late to the party. I have 2 of these airboxes and would be great to be able to use them with Home Assistant, you mentioned that the found example was for a esphome costume component, i assume you meant custom lol. does this mean i use the code you have on github as a cpp or .h file in esphome to compile it alongside the rest of the needed packages?

I’ve never created a custom ESPHome component so I don’t know. I think it uses different libs and the data processing/passing to HA would also need to be changed.

Got it, Yea i took a look at making custom components last night, it might just be a matter of altering your existing code, ill take a crack at it, i do appreciate the reply though!

3 Likes

Any news in the integration with esphome?

2 Likes

yes and no, i am working on integrating another component into esphome but will help me do this one too if i can get it done. still not gona be any time soon

Since I coded on this as well I’ll post my git repo for the version I made:

I basically wrapped all the code from saso5 into a cpp class and referenced that in the custom component, but it’s not working properly atm as every other component stops getting data… therefore I assume I created a deadlock somewhere (probably during the BLE connection setup phase), but since I’m a cpp noob and currently not having enough free time I’m hoping someone else might be able to fix my code :grinning_face_with_smiling_eyes:

3 Likes

I managed to fix my codebase so that it’s currently working for two different WP6003’s as custom components. There’s still lot’s of cleanup to do but for the time being feel free to use my repo for inspiration! :smiley:
Also 3 out of 4 times the initial BLE connection seems to be stuck… What worked for me is just resetting the ESP until you get all WP6003s connected properly.

1 Like

Thanks for this custom component. It seems to be working but my readings are unusual compared to an Awair Element I have.

The two readings are correlated by wildly off in scale, other than temperature. The large swings correspond to when I open a window or turn on the AC. I’m curious what other people’s readings look like.

Note: my yaml is a copy/paste of the example with different variables, like WiFi, and one small change to convert TVOC to ppb but otherwise the same.

    - name: "Office - WP6003 TVOC"
      unit_of_measurement: ppb
      accuracy_decimals: 3
      filters:
        - multiply: 1000

Good day, guys
Could you please clarify me how to integrate device to HA? Over Bluetooth or WiFi? I’ve never worked with ESP Home, but I created node as in example and I see in console that WiFi connection failed.

I know this thread is about esp home and home kit, but can someone figure out a solution for Google Assistant? Would love to use this sensor with Google.

Guys, is anyone who could help me ?

As I understand this device only has a VOC and temperature sensor. CO2 is calculated from that so it shouldn’t be trusted.
Even VOC is probably some cheep sensor, so I would trust Awair data more, but the data seems to be roughly aligned, just the scale is off.

The ESP32 connects to HA over WiFi as is standard for ESPHome. The ESP will scan for WP6003 over bluetooth using Reg1nleifr’s code which is installed via ESPHome.

But, before getting into any of this you should first troubleshoot your WiFi connectivity because if you can’t get a generic ESPHome to connect then this won’t work either.

Hi everyone,

I’m working on a tool to add BLE devices to HA with MQTT integration. It requires Bluetooth on Linux and python (it is not ESP32 firmware). Recently I’ve added WP6003 support, so you can try it with your devices:

2 Likes

thank you and good luck!

Dear Devbis,
how install your tool on hassio to take data form my wp6003?
thanks

Hi @Volleynet76 , unfortunately, I don’t use hassio and docker images for Home Assistant. So I can’t help you with the exact steps, but if you run it in a container, you should mount /var/run/dbus in the container to forward Bluetooth events.

Hello,
There have been an update on esphome since June 2021.
Esphome can now let us receive a notification and parse the data using a lambda function…
Please find below my blog article where I’ve added the code/configuration.

@kylehase
regardings different values with different sensors, i had a bme680 & a ccs811 for some time before i found the wp6003
these two have similar values but differ from the wp6003
my suspicion is that the wp6003 shows absolute values, while my other 2 sensors show delta values
top left is ccs811, right is bme680, bottom left is wp6003

@omarghader
pdata[6] is also part of temperature or high values become negative
but i am using your solution with 2 devices and a wemos_d1_mini32 more or less successfully for a few months now.
the unstable nature of the ble client implementation leads to sensors randomly vanishing in HA so i made an automation which reboots the esp32 every few hours.
sometimes the reboot switch vanishes so i need to manuelle reboot it, but that happens rarely.

@Reg1nleifr
since the BLE Client lib is unstable, i tried your custom component
but i tried to compile it for an M5Stamp-C3
support for the stamp-c3 requires to use the most current esp32-idf >= 2.0
so i use this

  - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.4

this leads to

In file included from src/main.cpp:37:
src/wp6003.h:3:10: fatal error: BLEDevice.h: No such file or directory


  • Looking for BLEDevice.h dependency? Check our library registry!
  • CLI > platformio lib search “header:BLEDevice.h”
  • Web > PlatformIO Registry

the Platformio search leads to an outdated lib from nkolban, and further search ( Forks · nkolban/esp32-snippets · GitHub ) leads to a fork of his BLE lib which supposedly fix the changes of the recent changes in the esp32-idf:
GitHub - W-M-D/esp32-snippets: Sample ESP32 snippets and code fragments
but this is in no form like the BLE lib, idk how the original author packages this to the BLE lib to be usable

but i can’t get it to compile with esphome using this reference

libraries:

any suggestions from anyone?
should i do a new thread ?
made a separate thread for this problem BLE using custom component no longer compiling since ESP-IDF update because of hardware

i have weird value jumps on TVOC:
when the value rises above 3.2 it immediately goes to 4.8