PiicoDev ens160 air quality sensor with ESPHome/Home Assistant

Greetings friendly makers,

I am interested in seeing if anybody has integrated the Piico Dev sensors into Home Assistant using ESPHome as I followed some online guides from github but can’t get the sensor to register properly?

I am using an Adafruit QT PY ESP32-S3 hooked up with a PiicoDeV cable and the sensor shows a green light and the initial setup works yet I get an error code that causes the Wireless Install to fail?

Any assistance would be greatly appreciated as I much prefer using an ESP32 device that I can integrate with ESPHome to use with my other sensors/cameras, etc.

I’m using the following in the YAML:

name: sensor-ens160
friendly_name: sensor-ens160

board: adafruit_qtpy_esp32s3_nopsram
type: arduino

id: i2c_component
sda: 3
scl: 4
scan: True


  • source: github://pr#4243
    • ens160


  • platform: ens160
    name: “eCO2 Value”
    id: en160_sensor_eco2
    name: “Total Volatile Organic Compounds”
    id: ens160_sensor_tvoc
    name: “Air Quality Index”
    id: ens160_sensor_aqi
    address: 0x53
    update_interval: 10s


Could not find any blog or video. You can post your question to home assistant community:


Thanks for the tip as I will try the Home Assistant Forum to hopefully find a working solution.

I suspect its something in the script as the device shows a green light but unsure why the script rejects it as I have a Grove sensor working using a QT PY ESP32-C3 without issues and the PiicoDev sensors are better value for DIY projects.

With thanks!

1 Like

Hi Razor
Have you checked for any difference in the pin connections. I just had a quick look and the connectors seem to be mirror image but in this day and age where everyone uses their own “standard” it would depend on which pin is called “1” so in this case it would depend on which pin is “1”
Cheers Bob


Hi @Robert93820

Its y understanding that PiicoDev supports Qwiic and STEMMA QT and the sensor displays a green light but I’m literally stumped as not sure what different cable to try and the documentation seems to be tailored for Micropython and not Arduino/ESP IDF…?

I guess I can go back to using it with a Raspberry Pi/Pico as I know that will work but not really sure how I then integrate that into my Home Assistant setup, if that’s even possible?

Thanks for the suggestions


I have it integrated. You can do it with MQTT or a HTTP request from a Pi/Pi Pico W. Will post my code when I get the chance. You can do either of these through WiFi or what I do is connect the Pi Pico to the computer hosting HASS and write a Python script to read the REPL, then make the HTTP request to the Home Assistant api. What are you hosting HASS on?


Hi Steven,

Thanks for the reply and offer as I made sure to stock up on Pico’s so the sample code would be greatly appreciated, so no rush.

I’m currently running Supervised Home Assistant on a 16GB Orange Pi 5 using Debian and have integrated some ESP32-CAMs and a Grove gas Sensor using a ESP32-C3 QT PY from Adafruit which all run fine.

I’m still new to things so appreciate any help as I’m yet to run MQTT but am more than happy to give it a good go!


1 Like

Hi Razor,

I havent used ESPHome for any projects so not certain about the setup but the ESP32-S3 uses different pins than specified in your YAML.
Updating to the following hopefully will work!

All that was changed are the SDA and SCL pins, according to the pinout on Adafruits site
The console should also update:

Let us know how you go if it doesn’t work!



Eureka!!! I’m really grateful for all the suggestions and who knew all I had to do was use the correct i2c pin reference as now I have my first PiicoDev sensor working within ESPHome!

I plan on adding a few more Air Quality Sensors to the home as they’re affordable so here’s hoping this helps others looking to incorporate PiicoDev into their own Home Assistant setup.



Hi Razor,

Awesome! Glad to hear you got it up and running, that combo looks perfect to tuck away.

PS: I’ve got some of these clean looking enclosures at home that might work!


1 Like

Thanks for the suggestion as it saves me 3D printing some and they seem to be well priced. :ok_hand:

1 Like