A good room sensor answers three questions: is anyone here, how is the light and how is the air? With a few Grove units and a small ESP32 board you can build a sensor that fits your room and stays local in Home Assistant, with no cloud service. Here we go through which parts do what, what they cost and how to connect them.
Products in this guide
Presence: PIR or TMOS?
A regular PIR sensor such as the PIR AS312 (U004) reacts to movement. It is cheap and simple for hallways, stairs and garages, where someone walks past. The problem is that it stops seeing you when you sit still, for example at a desk or on the sofa, and the light goes out.
The TMOS PIR (U185) (STHS34PF80) is made for presence, including people sitting still, so it suits offices and living rooms better. Check the current ESPHome documentation to see how the sensor is supported before you decide. If you want it in a compact ESPHome node, be aware that support may require extra components or custom code.
Air: CO2, climate and gases
- The CO2 Unit SCD40 (U103) measures carbon dioxide with a Sensirion SCD40. CO2 is the best indicator of when it is time to ventilate, especially in bedrooms and home offices.
- The climate sensor (U001-C) gives temperature, humidity and air pressure (SHT30 and QMP6988). It is the basis of almost every room sensor.
- The TVOC/eCO2 SGP30 (U088) measures TVOC and eCO2 with an SGP30. eCO2 is an estimate from organic gases, not a true CO2 measurement. If you want real CO2, the SCD40 is the right choice.
Light: DLight
The DLight (U136) (BH1750) measures brightness in lux. Use it to turn lights on only when it is actually dark, or to dim a screen in the evening.
Comparison
| Sensor | Measures | Good for |
|---|---|---|
| PIR AS312 (U004) | Motion | Hallway, stairs, garage |
| TMOS PIR (U185) | Presence, also when sitting still | Office, living room |
| CO2 Unit SCD40 (U103) | CO2, temperature, humidity | Bedroom, home office |
| climate sensor (U001-C) | Temperature, humidity, pressure | Any room |
| DLight (U136) | Light (lux) | Lighting control |
Boards and hubs
An ATOM Lite (C008) or AtomS3 Lite (C124) is enough as the brain, both with a Grove port. If you want a board with a screen that shows the values, there is the AtomS3R (C126).
All the units above speak I2C and share the same Grove port, as long as they have different addresses. With the Grove hub 1 to 3 (U006) you split one port into three. If two units share an address, or you have many, the PaHub v2.1 (U040-B-V21) (I2C hub 1 to 6) takes care of it. Use short cables: the Grove cable 10 cm (A034) is enough inside a box, the Grove cable 1 m (A034-D) when you need more reach.
Example project: bedroom sensor
Goal: see CO2, temperature, humidity and light in Home Assistant, and get a notification when CO2 is too high.
- Connect the CO2 Unit SCD40 (U103), climate sensor (U001-C) and DLight (U136) to a Grove hub 1 to 3 (U006) and the hub to the board's Grove port.
- Create a new device in ESPHome and add the sensors. The components scd4x, sht3xd, qmp6988 and bh1750 exist in ESPHome:
i2c:
sda: GPIO26
scl: GPIO32
sensor:
- platform: scd4x
co2:
name: "CO2"
- platform: sht3xd
temperature:
name: "Temperature"
humidity:
name: "Humidity"
address: 0x44
- platform: bh1750
name: "Light"
address: 0x23
The pins are for the ATOM Lite. On the AtomS3 Lite the Grove SDA is GPIO2 and SCL is GPIO1. Add the air pressure from the QMP6988 with the qmp6988 component once the rest works.
- Flash the board over USB the first time; after that it can be updated wirelessly.
- In Home Assistant, create an automation that sends a notification when CO2 stays above, say, 1,000 ppm for a while.
Getting started
- Start with the climate sensor. It is cheap and shows right away that the chain of ESPHome and Home Assistant works.
- Add one sensor at a time and check that it appears before adding the next.
- Place the CO2 sensor at breathing height, away from windows and fans.
- Place the climate sensor away from the board. The electronics get warm and can push the temperature up.
FAQ
Do I need both the CO2 unit and the climate sensor?
The CO2 Unit SCD40 (U103) also measures temperature and humidity, so a simple sensor can manage with it alone. The climate sensor adds air pressure and is cheap if you build several rooms.
Can a PIR turn off the light while I sit still?
Yes, that is a common limitation of PIR. That is why the TMOS PIR (U185) exists for people sitting still.
Does the sensor have to be on Wi-Fi?
The boards above use Wi-Fi to reach Home Assistant. Everything can run locally without internet.
How many sensors fit on one board?
It is decided by the I2C addresses and the Grove port. With a hub, four or five units on the same board is fine.





