IOT in Cars (and Vans): Home Automation on the Road

IOT in Cars (and Vans): Home Automation on the Road

home assistant running in a van
The OBD data reported to Home Assistant (when offline)

“Home Automation” sounds like something that belongs, well… in the home. But since we sometimes live in a van, I could not help but wonder: is there anything the Internet of Things could make easier?

I already had a Raspberry Pi creating a Wifi network in the van (another one of my Magic Spellbooks: inconspicuous Home-Assistant touchscreen kiosks living in a stylish book). Curious what else I might do with it, I began searching around and found the AutoPi project: an IoT platform built on Raspberry Pis and some custom hardware. I appreciate how they’ve built with open-source and open-hardware to create a complete solution for car owners.

I chose instead to work with the Home-Assistant platform. The AutoPi platform does have some nice consumer uses, but is geared more at fleet vehicles and commercial applications. On the other hand, I was already familiar with Home-Assistant and it seemed better suited for my needs.

My entire Van Home Assistant configuration is available open-source on Github.

home assistant UI lovelace for living room
For even more open-source, check out my detailed blog post on my favorite uses of Home Assistant.

Security & Dashcams

Having things stolen from the van could be devastating. When we travel and work from the road, we’re carrying our entire lives with us. Not to mention, it’s nice to have a dashcam recording in case of any accident or police interaction.

I started with a Raspberry Pi night vision camera (or this one for a Zero W). The easiest approach is to use Home Assistant’s built-in support for the Raspberry Pi camera. However, this only creates still images. This is good enough for checking in on the van via the Home Assistant UI, but doesn’t do much to prevent theft.

A better security solution is the popular motion open-source project, which can save all video or just detect periods of motion. The various options are quite exhaustive. Most importantly, it can run a script when motion is detected.

When we’re not around, the security camera motion detection becomes “active” and triggers a notification to my phone.

In my post about the best uses Home Assistant, I described how we detect when we are at home or not.

Speed, Fuel Usage, and More

I’m a data nerd. I love seeing stats about our trip — all the better if they can be collected automatically.

An OBD (OnBoard Diagnostic) reader like the one I used can plug in to just about any car and transmit via Bluetooth (or in some cases, USB).

The OBD II port is standard diagnostic on pretty much every vehicle created in the last decade. A simple bluetooth ELM327 dongle can plug into the port to read everything the vehicle has to offer.

My open-source OBD monitor project reports all stats to Prometheus, which can also be bridged into Home-Assistant via node-red (or similar).

The Home Assistant UI can show graphs including:

  • Fuel levels
  • Speed & engine RPMs
  • Outside temperature & barometric pressure
  • … and a lot more.

Plus, a simple USB GPS device is enough to track where the car is at all times.

Instead of tracking where a person is, Home-Assistant is repurposed to track the van itself.

Protecting Pets

In my post about living the vanlife with a dog, I shared a scary story about police nearly breaking in to our van to “save” our dog. We started using the relatively low-tech solution of taping a note to the window explaining that Azuli is fine and has her own fan and amenities.

Australian shepherd in a vanlife van passenger seat
Azuli sits patiently in the passenger seat, waiting to get to the next campground.

But for our own peace of mind, we wanted to know when the van might become uncomfortable for her. A simple temperature sensor is enough to trigger a notification when it gets too hot (or cold) for her to be in the car. This particular sensor also detects light, air pressure, humidity, and motion — making it a pretty full-featured addition to the Home Assistant configuration.

Tracking Cellular Data Usage

Finally, perhaps one of the most useful features.

Our solution to having internet involved bonding multiple internet connections together. This meant that we could use our cell phones, a Mifi, or connect to local Wifi networks — or use all of them at once. This is great for getting work done on the road, but we have to keep an eye on data usage.

home assistant speedify verizon wifi internet bonding connection status

The Verizon Jetpack, like many Mifi providers, can be queried to determine the current data plan usage. I wired up some quick scripts that parsed this information so that they each showed as sensors in Home Assistant. Putting it all together, we get a nice readout on the Home Assistant UI (above) that shows:

  • Connectivity (the bars to the left of the Verizon name)
  • Data usage so far (and how many days remain)
  • Wifi connectivity status

It would be possible to extend this even further. The Speedify CLI (the software I used for internet bonding) can output specific information about how much data is being used by each of the different connections, apply throttling/caps, etc.

Read the Diff

The Diff is a weekly email with step-by-step instructions, project ideas, and links. Drop your email in the form below, and I'll send you some of my favorite resources. The links cover everything from off-grid/vanlife construction to home automation and Raspberry Pis.

... but this site has no paywalls. If you do choose to sign up for this mailing list I promise I'll keep the content worth your time.

Written by
(zane) / Technically Wizardry
Join the discussion

2 comments
  • This is great. I’ve forked your HASS config, cloned your OBD docker, and got it all running…. but then I know nothing of prometheus. I’ve set up a basic ARM7 prometheus docker but I can’t see any OBD info.

    I can’t access the OBD stuff via port 8000 and I can get into prometheus but not see anything other than the standard metrics the docker image comes with.

    Any guidance?

    • Thanks, Glenn!

      You say you *can’t* access the OBD stuff on port 8000? Are you sure the container is up and running? It should at least be serving a HTTP interface for Prometheus to consume from that URL. Prometheus works by polling (scraping) a URL periodically, so until that page can be accessed there’s nothing for Prometheus to consume. Have you tried looking at the logs from the container?

      If you want to reach out via the contact form, I’d be happy to chat over email directly — include your docker logs and I’ll try to debug: https://technicallywizardry.com/contact/

      – Z

Menu

Around the Web