I Automated My Morning Coffee and Now Im an Engineer of Leisure

September 12, 2024

I automated my coffee maker. Not because I’m lazy (I am), but because I wanted to see if I could trigger a coffee brew via an MQTT message. The answer is yes. The follow-up question is “should you?” and the answer is also yes, but with more caveats.

The Integration

My coffee maker is not smart. It has a button. One button. You press it and coffee happens. It’s simple. It’s reliable. It’s everything I aspire to be.

I wired a Sonoff relay into it.

The relay connects to Home Assistant via ESPHome. Home Assistant talks to Node-RED. Node-RED listens for an MQTT topic called kitchen/coffee/brew. When I publish {"command": "brew"} to that topic, a sequence of events unfolds:

  1. The relay closes
  2. The coffee maker turns on
  3. Coffee happens
  4. A push notification is sent to my phone: “☕ Coffee is ready, you beautiful disaster”

The Feature Creep

What started as a simple relay has spiraled into a full coffee observability stack:

  • Brew counter: Grafana dashboard tracking how many cups I’ve made this week (it’s a lot)
  • Timed brewing: Automatic brew at 7:00 AM. I call it “the caffeine cron job.”
  • Supply tracking: A weight sensor under the coffee bag that alerts me when I’m running low
  • Consumption analytics: A camera pointed at my mug that counts sips. I don’t know why. It felt right.

My coffee setup now has more monitoring than most production environments I’ve managed. I get alerts when the water reservoir is low. I get alerts when I haven’t made coffee by 8 AM (“Jeremy, what’s wrong?”). I get alerts if the brew temperature deviates by more than 2 degrees.

The Cost

The relay was $8. The total investment in coffee automation infrastructure is approximately $400 when you factor in the Raspberry Pi, the sensors, and the therapy.

But you know what? Every morning when I get that push notification, I feel a brief moment of pure, unadulterated power. I built this. This stupid, over-engineered, completely unnecessary system. And it works.

Now if you’ll excuse me, I need to go calibrate the sip counter. It’s been reading low and I think the camera might need cleaning.

Moral of the story: Just because you can doesn’t mean you shouldn’t. Actually it usually means you shouldn’t. Do it anyway.