The sheer convenience of using it makes many pick smart devices and sensors off the shelf. When the cost starts compounding, most folks hit the brakes on their dream smart home project. Also, I realized that I was locked into a smart home ecosystem. If you’re willing to build a smart home from scratch or a few devices, I recommend using ESPHome and Home Assistant together.

ESPHome, an open-source project, lets you program ESP32 and ESP8266 microcontrollers, along with sensors and other hardware, to build powerful smart home devices. You can buy sensors for less than $10 to hook up to ESP32 boards and build smart devices that can give commercial ones a run for their money. You can check out these ESPHome-friendly sensors that cost under $10 and can replace entire smart devices.

Single temperature, humidity, and pressure sensor

Better climate readings for automations

Getting weather stations or smart thermostats that show fringe weather data is convenient and fancy. Commercial climate sensors cost $40 or more and feature a display, though they are battery-operated. But these sensors depend on either cloud services or specific apps, and they're vendor-locked. Also, some operate only with specific all-in-one IoT hubs.

You can pick up a highly popular BME280 sensor that measures temperature, humidity, and barometric pressure. The modules cost between $3–$6 and work great as a multi-sensor setup. By flashing the ESPHome firmware on it, you can pair it with Home Assistant as a smart home hub to capture weather data. Alternatively, you can build your own multi-sensor climate control or e-Ink weather station using ESP32-compatible components.

Magnetic Reed Switch

Building smarter doors with minimal effort

Making windows and doors smarter requires a separate contact sensor. That unit works only with specified compatible hubs or smart home ecosystems. The catch being that they work perfectly with the smart devices and hub from the same vendor, and cost roughly $20 a pop. For some reason, they’re big enough to be visible on the doors, windows, and even drawers. These sensors run on a battery that lasts roughly two years.

In comparison, you can buy a magnetic reed switch for under $2 per unit and set it up with ESPHome. When configuring the YAML for flashing in ESPHome, you can add a debounce filter to introduce a delay and reduce false positives, and also set the mode to report when the door is open. You can define the sensor to wait and detect if the door or window is actually open. And you can adjust the debounce filter values later to prevent automations and alerts from triggering.

PIR Motion sensor

Customizing presence detection

There are plenty of commercial motion sensor options that mostly integrate with smart lights or security systems. That also means one needs to carefully verify compatibility with existing smart home systems before buying one. The only problem with these widely available motion sensors is the lack of customization to suit your needs.

Meanwhile, the very affordable HC-SR501 ($7) is an excellent passive motion sensor with a sensing range of up to seven meters and a wide 120-degree field of view. Ideal for mid-sized rooms, and provides results with simple high and low output. You can further adjust the delay time to report the duration of the first motion detection. For humans, the mmWave C4001 is a better presence detection sensor, with a range of up to 25 meters, and it works even when someone is lying down or sleeping.

Ambient light sensor

Fixing smart lighting automations

Smart lighting is typically the first step toward a smart home, yet a simple ambient light sensor can make you think twice if you plan to pick one priced between $65 and $165. Also, these sensors range from basic dusk-to-dawn models to slightly more complex ones that include a motion sensor to adjust dimmable LED lights. These sensors are typically suitable for industrial setups due to their wide area coverage.

For basic needs, the LM393 sensor can get you started. Or you can pick up an OPT3001 ambient light sensor that delivers high-accuracy measurements of ambient luminance. The built-in lux meter delivers accurate readings and offers a dynamic range, freeing you from having to define low-light or bright-light settings. So it monitors room brightness and lets you create automations that gradually adjust the brightness of your smart lights.

👁 A person holding a Raspberry Pi and an ESP32
5 projects you can do for much cheaper with an ESP32 than a Raspberry Pi

Why spend extra on a Raspberry Pi when you can build these cool projects with an ESP32?

Customizing and gaining control of your smart home

While ESPHome helps you save bucks as you assemble your smart home, it also makes it easy to customize sensors with its YAML configuration. With ESP32 boards in the middle, there’s hardly any programming involved, except for minding the indentation.

After building multi-sensor ESP32-board units, appropriate enclosures are essential. It’s unlikely you’ll get ready-made ones. However, you can 3D print some yourself or ask a friend to design and print some for your smart home.