Skip to main content
  1. Posts/

Adventures in Vibe Coding: Building a BLE-MQTT Gateway with GitHub Copilot Agent

·6 mins· loading ·
Home Automation Github Copilot Node Vibe-Coding Ai Iot Mqtt Ble
Ever wanted to be Batman arriving at the Batcave, with garage doors magically opening as you approach? That's been my reality for a while using BLE beacons in my home automation setup. But I wanted to upgrade the system while also testing just how far GitHub Copilot Agent could go in building a complete application. The result? A fully functional BLE-MQTT gateway built almost entirely by AI in around 5 hours.

Overview
#

I've been playing with AI for development for a while, but with recent advances with models, I wanted to challenge myself: could GitHub Copilot Agent build a complete, working application with minimal human intervention?

My home automation setup relies on Bluetooth Low Energy (BLE) beacons to track when our cars or bikes are home, away, or returning. This powers one of my favourite automations - opening the garage door automatically when I arrive home. It's that Batman-entering-the-Batcave feeling that even my wife appreciates (when it works reliably, that is).

The existing system needed upgrading, so this was the perfect opportunity to put GitHub Copilot Agent through its paces. Could it build a Node.js Express app that would receive data from an April Brother BLE Gateway, process it, and republish it to MQTT for my OpenHAB system to consume?

Spoiler alert: It absolutely could, and with impressive results.

The AI-Driven Development Approach
#

Rather than starting with a prompt asking for code directly, I took the approach that's gaining traction in the AI development community - start by thoroughly documenting what you want to build.

Step 1: Brain Dump to Documentation
#

I began with a casual conversation with Claude, explaining what I was trying to build and sharing some specifications from the April Brother website about their BLE Gateway MessagePack format.

This unstructured brain dump was transformed into a more coherent markdown document which I only lightly edited. With this foundation, I asked the AI to create a proper technical specification.

The results were these two documents:

Step 2: Creating an Engineering Task List
#

With the specs in place, I asked the AI to break down the project into discrete engineering tasks - essentially creating a development roadmap:

You can see the full task list here: Engineering Tasks

In a larger team, these could easily become JIRA tickets (and with tools like Atlassian's MCP, that process could even be executed from within the chat environment).

Step 3: Let the AI Write the Code
#

With my three documents ready - functional spec, technical spec, and task list - it was time to start coding. I fired up GitHub Copilot Agent in VS Code, pointed it to the documentation, and we were off to the races.

Over about 5 hours spread across several evenings, Copilot Agent wrote:

  • A complete Node.js/Express application
  • HTTP endpoints to receive data from the BLE Gateway
  • Logic to process and transform the data
  • MQTT publishing functionality
  • Docker container configuration
  • Over 200 unit and integration tests

I occasionally steered the process when necessary, but the vast majority of the code came directly from the AI with minimal adjustments from me. Yes, it sometimes went off track and needed to be reigned in, but in the main, it nailed it - almost always on the first try.

Iterating and Extending
#

Building a green field project is all well and good, but how would it go on an existing repository?

A few days after completing the initial version, I realised I should really be using the Home Assistant MQTT structure for better integration and auto-discovery. Once again, I turned to AI:

  1. First, I had the AI write documentation about what needed to change: Home Assistant Tech Spec & Tasks
  2. Then I asked it to update the tests to reflect the new structure
  3. Finally, it updated the actual code to implement the changes

The final step was getting the Docker container to automatically build and publish to GitHub Container Registry - something I'd never done before. Again, Copilot Agent handled this with ease, creating the necessary GitHub Actions workflow.

Key Takeaways
#

This project has given me some profound insights into the current state of AI coding assistants:

  1. Documentation First: Starting with clear documentation rather than jumping straight to code made an enormous difference in the quality of AI output.

  2. Breaking Down Tasks: Providing a clear task list helped keep the AI focused and prevented it from going off in random directions (the AI equivalent of ADHD).

  3. Iterative Refinement: Moving through the project in logical steps - specs → tasks → code → tests → deployment - created a smooth development flow.

  4. Productivity Explosion: What would have taken days of work was completed in hours, with code quality that surpassed anything I would have written for this side project. At times, it was a little too eager to write code almost being too helpful (I mean - did this project really need 200+ automated tests? Probably not.)

  5. It's not perfect: My day job as a technology leader mostly has me in spreadsheets and slides these days, but I can still understand code. I knew when to backup and try a different path. While these tools are amazing, you still need engineering capability to get to most out of them.

  6. Scale of Thinking: Knowing I can build things this quickly has me thinking bigger about what's possible as a solo developer or small team.

The Technical Details
#

For those interested in the technical side, here's what the project actually does:

  • Receives HTTP posts from an April Brother BLE Gateway containing MessagePack-encoded BLE beacon data
  • Decodes and processes the data, extracting device information and signal strength
  • Publishes the processed data to MQTT topics following Home Assistant conventions
  • Runs in a Docker container for easy deployment
  • Includes comprehensive test coverage and CI/CD through GitHub Actions

Where to Get It
#

All the code is available on GitHub, including the documentation that started it all:

Conclusion
#

This experiment has convinced me that AI coding tools like GitHub Copilot Agent have reached an inflection point in their capabilities. While they're not yet replacing developers, they're dramatically amplifying what developers can accomplish.

The key is finding the right balance - providing enough structure to keep the AI on track while leveraging its ability to handle implementation details at incredible speed.

For straightforward APIs, services, and CRUD applications, the productivity gains are enormous. And as these tools continue to improve, the range of what they can accomplish will only expand.

As for my home automation system? It's working better than ever, and the garage door opens reliably when I arrive home. Batman would be proud.