AN OLD CAPSULE COFFEE MACHINE MADE SMART WITH AN ESP32
An ESP32-C3 and a few optocouplers turn an old coffee machine into a Home Assistant device with timed pours and a child lock.
by Adrian Slabu
HomeAutomation
Built withESP32
- difficulty
- ●●●●○
- time
- a weekend
- license
- license not specified
- repo
- repo FINISHED0 stars
●●●●○ · a weekend · license not specified · 0 stars · repo FINISHED
WHAT YOU’LL NEED
Jump to section
COMPAREE VERDICT
Adrian Slabu wired an ESP32-C3 into his old capsule coffee machine: optocouplers press the power button and open the hot and cold valves, GPIO inputs read the lever and the machine's own blue, yellow and red buttons, and a TEMT6000 light sensor tells the ESP32 whether the machine is on. ESPHome brings it into Home Assistant, where each button has its own pour time in seconds that you can adjust, and there is a child lock. The gist gives you the working ESPHome YAML plus two Bubble Card dashboard files, and the 19-minute video walks through the disassembly, the optocoupler, the valves, the lever, the light sensor and powering the ESP32. What it cannot give you is your machine: if yours is laid out differently inside, you will trace it yourself and change the pin plan. If you have opened an appliance before and know how to work safely around its power board, this will save you writing the ESPHome side from scratch. The single biggest risk is working inside a mains-powered device: the creator warns not to touch the power board or exposed wiring while it is plugged in, so always unplug it before you touch anything.
IN THE REPO
GOOD TO KNOW
- —The gist contains the ESPHome YAML (1.smart-cafe.yaml) and two Home Assistant Bubble Card files.
- —No licence is stated in the gist.
- —No written wiring diagram or parts list in the gist; the video shows the build and links the parts.
- —The ESPHome config assigns the GPIO pins for the power button, two valves, three buttons, the lever and the TEMT6000 light sensor.
- —You need to disassemble your own machine and trace its button, valves and LED yourself — every capsule machine is different.
- —The gist is a config, the video is the walkthrough.
Parts to buy
5 itemsFrom our check of the build. Exact quantities and part numbers are in the creator’s BOM.
Can I build this?
This build involves mains voltage — for adults comfortable with electrical work only.
Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.
Videos
How an ESP32 Made My Coffee Machine Smart19:32
The creator's build walkthrough with chapters, from disassembly to Home Assistant control and the child lock, published 20 Jan 2026.
More builds like this
All projectsGallery
Start here
Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.
- 1.Watch the build video, then read the ESPHome YAML in the gist to see which GPIOs are used and which entities are created. (The video shows the teardown and wiring; the gist has the matching config.)
- 2.Unplug your machine and open it. Trace where the power button, the drink buttons, the hot and cold valves, the lever switch and the status light connect.(Every machine is different. Take photos as you go and keep it unplugged.)
- 3.Connect optocouplers across the power button and the valve controls, wire the lever and buttons to the ESP32 inputs to match the YAML, and mount the TEMT6000 where it can see the light.(Check every connection with the machine unplugged before you close it.)
- 4.Flash the ESPHome config to the ESP32 and add the machine to Home Assistant.(The gist includes the dashboard card YAML.)
Resources
Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.
KNOWN ISSUES
- The gist has no licence stated. Do not assume you may redistribute it or use it commercially; ask the creator.
- There is no written wiring diagram. The video shows the wiring, but if your machine is laid out differently the same GPIO plan may not work.
- The optocoupler module is linked in the video description but its model is not named, and the config does not say how many you need. Count one per button or valve you want to trigger.
- The TEMT6000 has to see the machine's light reliably; the config switches the state at fixed thresholds, so you may have to adjust them for your machine.
- Capsule machines differ inside. Button, valve and light wiring will not match across brands or models, so treat this as a pattern, not a drop-in.
- Mains voltage: never touch the power board or exposed wiring while the machine is plugged in. Unplug it before every wiring change, and close it up before you plug it back in.
Will this work with my machine?
The config is written for a machine with a power button, three drink buttons (blue, yellow and red) and a hot/cold lever that opens two valves, with machine state read from a light sensor. If your machine works the same way, you can adapt it; if it has a different control panel, you will have to rewrite the pin plan.
What optocouplers do I need?
The video uses a ready-made optocoupler module (linked in the video description, model not named). The optocouplers act as electronic button presses across the machine's switches, so measure what your switches carry with a multimeter before choosing.
Can I do this without soldering?
No. In the video the antenna pins are soldered and wires are soldered to the machine's boards before being moved to headers.
Is there a step-by-step guide?
The YouTube video is a 19-minute walkthrough with chapters: disassembly, the optocoupler, triggering the power button and valves, reading the lever, the TEMT6000 light sensor, powering the ESP32 and Home Assistant control. The gist holds the matching ESPHome and dashboard YAML. Your own machine will still need its own tracing.
What if my machine does not have a ready LED?
In this build the light sensor is what tells the ESP32 whether the machine is on; without it the buttons do nothing. If your machine has no light you can read, you will need another way to sense its state.
Community builds
No community builds yet — be the first, we feature the best ones.
Discussion1
FROM THE COMPAREE TEAM
A few small modules and the old machine shows up in Home Assistant with timed pours and a child lock. What would you automate next: the kettle, the toaster, or something else on the counter?
Adrian Slabu
Adrian Slabu automated his old capsule coffee machine so it would appear in Home Assistant without replacing it. He explains the build in a YouTube video and shares the ESPHome config and dashboard cards as a public gist.
DISCLAIMER
- Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
- Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
- Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.
CompareeTEAM3d ago
Practical notes from our verification: the gist holds the ESPHome YAML and two Bubble Card dashboard files, but no written steps or wiring diagram; the build itself is shown in the creator's 19-minute video with chapters. If you have done appliance retrofits before and know how to work safely around a power board, this config will save you the ESPHome side. If you have not, expect to spend time adapting it to your own machine, and the biggest unknown is whether your model is laid out the same way inside. No licence is stated, so assume personal use only.