It was late at night and I had a question I couldn't let go of: could the Raspberry Pi running Home Assistant in the RV talk to the generator's auto-start module? Our coach has an AGS (auto generator start) module, the little box that starts the generator when the house batteries get low or the temperature climbs. The only way to talk to it is the manufacturer's phone app over Bluetooth. No integration, no API, nothing in Home Assistant Marketplace, and I later find out why.
So I asked Claude (Claude Code, running on my Mac with SSH access to the RV's Home Assistant box) to go look for it. A few hours later I had live generator status on my dashboards, a decoded protocol, and a pretty clear picture of who did what. This post is that picture. I want to be upfront about which parts were me and which parts were the AI, because I think that split is the interesting part.
Step one: is it even there?
My ask was basically "use Bluetooth on the Home Assistant and see if you can find the AGS." Claude SSHed into the Pi, ran a 20-second scan, and there it was, advertising with a strong signal from inside the coach. It also spotted the OBD dongle and one of my temperature sensors, which was a nice sanity check that the scan was real.
Then it stopped and asked before connecting. Its reasoning was that the module might only allow one connection at a time (which would lock out the phone app), and that this is a generator controller, so it wanted my OK before talking to it at all. I said yes. It connected, listed the Bluetooth services, and read the labels on them: a device name, a command channel, firmware updates and pairing. Nothing was written.
Taking the app apart
This is where I nudged things. I pointed Claude at the Android app on the Play Store and said it could decompile it if it wanted to know what we could control. Then, while it was working, I sent over the manufacturer's manuals and firmware page too.
Claude downloaded the APK from a mirror, decompiled it with jadx, and found out a few things fast:
- It's a Flutter app. The real logic is compiled Dart, with a thin Java layer that hands Bluetooth calls to a native library.
- It's built on Telink's light-mesh SDK. Yes, the same Bluetooth mesh stack used in cheap smart bulbs. The generator controller is basically a very angry light bulb.
- The login is the same for every unit. The mesh name and password are hardcoded in the app. The six-digit passcode you type in the app is only checked inside the app, not by the module. More on that below.
- The status layout was right there. The Java code that unpacks the status message spelled out every field: battery voltage, temperature, generator running, fault, start failed, manual mode, ignition and retry count.
The firmware page turned out to be a dead end for this project (it's all head-unit firmware, the AGS updates itself through the app), but the AGS manuals were useful context.
A small add-on
Claude gave me three options for where the listener should live: an ESP32 running ESPHome near the module, a small Home Assistant add-on, or a script on my Mac. I picked the add-on.
Before building anything, it ported the Telink login and encryption from the decompiled Java to Python, line by line, and ran a read-only test from the SSH add-on. It logged in on the first try and status packets started rolling in about once a second: 12.88 volts, manual mode, generator off. Temperature reads zero, which I think means there's no probe connected.
Then it packaged it up. The add-on is a couple hundred lines of Python using bleak for Bluetooth and MQTT discovery through the Mosquitto broker I already had, so the entities show up as a proper device in Home Assistant. One detail I liked: it doesn't hold the Bluetooth connection open. It connects once a minute, listens for 10 seconds, and lets go, so the official app on my phone can still connect. The tradeoff is up to a minute of lag, and that's fine for a generator.
The first build failed because this version of the Supervisor no longer passes a base image into local add-on builds. Claude read the Supervisor log, switched to a pinned Python base image, and the second build worked. That's the kind of thing that would have cost me 30 minutes of googling.
Dashboards
With the entities in place, I asked for everything on the RV Home dashboard plus a new RV Generator dashboard. Claude backed up every dashboard file first, then added a Generator section to RV Home, built the new dashboard (status tiles, a battery gauge with 24-hour and 7-day history, and a 7-day run timeline), and added a Generator button to the navbar on every RV dashboard. It restarted Home Assistant core to load them and checked that the entities came back. There are no buttons on any of it. Read-only, on purpose.
The guardrails
The status message only gets you so far. The AGS settings (start and stop voltage, quiet hours, run time limits) and the run-hours counter only show up when the app asks for them, and the bytes for asking live in the compiled Dart code. Getting those out meant running a Flutter decompiler called blutter.
Here's the funny part. The first time Claude tried to build blutter, Claude Code's own safety check blocked it. Claude didn't try to sneak around it. It stopped, finished the dashboards, and told me what it couldn't do and why. When I came back to it and said go ahead, it ran.
I was pretty nervous about this stage, and I told Claude so more than once: don't start the generator, don't change any settings. It took that seriously:
- It mapped every command first. Every command the app can send, sorted into reads and controls. Start, stop, reset, factory reset, settings changes, door lock, key fob pairing and set clock all landed in the do-not-touch pile.
- It proved the two reads were safe. Both are sent automatically by the app when a screen opens. An app doesn't change your generator just because you looked at it.
- It wrote a hard allowlist. The code that builds commands refuses anything except those two exact requests, and Claude tested that locally (start, stop and the rest all got rejected) before anything went over the air.
Even then, the first two attempts got no answer. Claude worked out why: the module's mesh address was hiding in a second block of the Bluetooth advertisement, and the decompiled Java was building one part of the encryption a little differently from what the firmware actually expects. When it switched to the way the open-source Telink libraries do it, the module answered both requests. AGS disabled, quiet hours 10:20 PM to 8 AM, and 5 minutes on the run-hours counter.
And that's where I called it. It was late, and I'd rather finish this in daylight when I can hear the generator if something goes sideways.
Turns out burning the midnight oil is risky business too. I didn't want to wake anyone up by cranking the generator at 11:45 PM, and I really didn't want to explain to my wife, "Sorry babe, I was vibe coding a generator controller because I'd already run out of stock hardware to hack on the house side of the RV."
Let's be honest about who did what
I keep getting asked how much of these projects are me and how much is the AI, so here's the honest version.
What I did:
- Picked the problem. I wanted generator status in Home Assistant, and I knew the module was Bluetooth. I also knew the app existed and had played with it. Of course I'd already scanned for Bluetooth devices in the rig looking for things to control, and this was one of them.
- Pointed at the right sources. The Android app and the manufacturer's manuals and firmware page were my idea. Claude hadn't gone looking for them yet. I run iOS, but I know Android apps are easy to pick apart, so let's have a little fun.
- Made the calls. Yes to connecting, add-on over ESP32, which dashboards, and when to stop for the night.
- Set the rules. No starting the generator, no settings changes, no testing for real. I said it three times, and I'd say it again.
- Approved the scary stuff. Connecting to the module, running the decompiler, and sending the two read requests each waited for a yes from me.
What Claude did:
- All of the hands-on work. Scanning, connecting, reading services, downloading and decompiling the app, and reading the Java and Dart. I kept asking what it was looking at, and used /btw for side chats while it decompiled.
- All of the code. The Python port of the Telink protocol, the add-on, the Dockerfile, the MQTT discovery config and the command allowlist. I know how MQTT and Docker work, but every step of this was virtual hands doing the work for me.
- The debugging. The add-on build failure, the missing mesh address and the encryption difference, each from logs and decompiled code. Oh man, this was the tricky bit, and I'm glad Claude Code handled it.
- The Home Assistant plumbing. Dashboard JSON, navbar edits on five dashboards, backups and the core restart. Once it had built the sensors, I let Claude Code handle all of this.
- Knowing when to stop. It asked before connecting, stopped when the safety check said no, and kept the generator out of reach the whole time.
If I'm honest, I couldn't have written the encryption port myself. That's not my skill set. But Claude also wouldn't have gone looking at the manufacturer's app without the nudge, and it definitely wasn't going to decide on its own how much risk I was willing to take with a generator.
When we bought this RV, I pulled out the manuals for every product in the shell, everything that makes it tick. With Claude's help I scanned all the PDFs and built an owner's manual of manuals: exactly what we have, how it's set up and which model of each thing is installed. At that point we both knew what was in there, so let's start digging.
The part that worries me
Every module running this app appears to use the same Bluetooth login, and the app's passcode isn't enforced by the module. That means anyone within Bluetooth range of an RV with one of these could probably talk to it, and possibly start the generator. A generator starting on its own next to a parked RV is a carbon monoxide problem, not just an annoyance.
So I'm not naming the brand or the model, and I'm not publishing the login or the command bytes for start and stop. I'm reaching out to the manufacturer first. If your rig has a Bluetooth generator auto-start, keep your CO detectors working (you should anyway). I'd even go so far as to add a second, smart detector and monitor it in Home Assistant and notify you on your phone.
What's next
In daylight, with the generator locked out so it physically can't start, I'll compare the values Claude read against the app to figure out the units, then roll the two read requests into the add-on so settings and run hours show up as sensors. After that come alerts for low battery, faults and failed starts. Start and stop buttons in Home Assistant might come later, with a confirmation step, or might not. I haven't decided.
Have you wired an RV system into Home Assistant that was never meant to be? And how much do you let AI tools touch hardware that can actually hurt you? Let me know, I'm curious. More on this soon.
One last thing. This post isn't really about finishing the project. It's about how I did it, and how you could too. Pick the problem, point at the right sources with what you already know, make the calls, ask lots of questions, switch to plan mode and ask more, and set the rules so the generator doesn't start at 11:45 PM on a Tuesday in your dead-quiet neighborhood. Then ship it to an audience of one. Not everything I build needs a GitHub repo, an issue tracker and strangers asking for features. This one just has to work in my rig.
Comments