The Eye of the Home

Ivan Lesar
3 min readApr 13, 2021

--

❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️

💚 I’ve moved away from Medium. You can find the latest version of this post on my personal website lesar.me.

❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️❗️️️️️️️️️️️️️

We’ve got a small-but-worthy project on our hands.

We’re going to build a home camera for less than 10$ and integrate it with HomeAssistant.

The Parts

The first part we need is the brain. The ESP32-CAM board can be bought separately and interfaced with through the pins. But its evolution, the ESP-CAM-MB, includes an additional board which provides us with a micro-USB interface. The linked version provides you with a VGA resolution, but you can order other lenses.

ESP32-CAM-MB

We need 2 IKEA Coasters. I’have also used them in the lamp project.

Coasters

Any old Micro-USB cable will do.

Micro-USB cable

Build

Carve a small hole, a bit larger than the camera lens. Also, carve a hole for the Micro-USB cable. Plug the cable into the board, stick everything together with a dab of instant glue, and voila…

Camera enclosure

We’ve got ourselves a decent looking camera.

Dock

If you’re feeling fancy, buy a small wooden desk in a hobby shop, turn it upside down and you have yourself a docking station with easy mounting.

Dock for camera

HomeAssistant Integration

To create a HomeAssistant entity, we have to add a new ESPHome device with this configuration, and upload the firmware to the board. The first firmware upload will have to go through a USB cable, but from then on, the over-the-air update will be available.

ESPHome device configuration

After uploading the firmware to the board via ESPHome, go to the HomeAssistant configuration page, and click Integrations. Configure the new entity which should appear when the ESP device connects to the Wi-Fi.

After adding the new integration, we can go ahead and create a new Lovelace card with the next configuration.

Lovelace card configuration

That’s it! Our camera stream is now shown in the Lovelace UI panel.

Lovelace UI card in the web interface

I mounted the camera at a fixed spot pointed at my balcony, created a NodeRED flow to take a photo every day at noon and upload it to an external storage drive. The idea is to create a time-lapse after a couple of months.

NodeRED Flow

What do you use your hobby cameras for? Feel free to share your projects in the comments. 🍻

--

--

Ivan Lesar

Automation, psychology, mathematics — Senior Backend Engineer @ Superology