rubillos / RV-Bridge

Homekit to RV-C bridge - Allows control of RV lights, fans, and thermostats via HomeKit.
73 stars 11 forks source link
arduino arduino-sketch can-bus esp32 esp32-arduino homekit homespan rv-automation rv-c wifi

RV-Bridge: HomeKit to RV-C Adapter

RV-Bridge


  1. Features
  2. Background
  3. Current Project State
  4. To-Do
  5. Hardware
  6. Wiring
  7. Firmware Setup
  8. Finding Output Numbers
  9. Supported RVs
  10. 3D Printing
  11. Notes and Tips
  12. Links

Features


Background

At the start of the pandemic we realized that international travel was going to be off the table for a significant duration. We decided it was time to see more of the Western US so we bought a class-A motorhome which we call The Penguin Express. We've put almost 30k miles on it so far.

Penguin Express

In addition to a bunch of 3D printed upgrades (we travel with a Prusa MK3S on board), I've done some arduino powered electronics work: a water valve for a reverse osmosis water filter with an LCD control panel, a GPS based clock for the bedroom that knows the exact timezone boundaries so it never needs to be set, and a GPS based altimeter and tire pressure monitor with a 7" color touchscreen for the dash.

The RV's lights, fans, and climate are all controlled through a Firefly Integrations Vegatouch Spectrum multiplex system. A 7" LCD panel is used to control everything, in addition to wireless keypads around the RV. There is also a bluetooth module that connects to an iOS app for controlling via an iPhone.

Firefly Main Firefly Lights
Firefly Climate Firefly Fans

It's a great system and works really well for control of the RV devices, but the iOS app is a bit slow to load/connect and can only be used in proximity to the RV. Since we already have an Apple TV onboard driving our TVs which could double as a hub, I've always wondered if there was a way to control it all via HomeKit and the Home app.

Recently I came across some documentation for the bus protocol that's used by the Spectrum system, RV-C, a subset of CAN-Bus, as well as the open source project CoachProxyOS that documents getting a Raspberry Pi set up to host a web page for controlling an RV's network using RV-C.

I also recently started playing with HomeSpan, a library for implementing HomeKit accessories on an ESP32 microcontroller, for a HomeKit doorbell project.

RV-Bridge is the result of putting these pieces together.


Current Project State

v1.0.9 - In progress

v1.0.0


To-Do


Hardware

Uses an ESP32 with a CAN-Bus interface, either as separate components, or more easily, this board I found from skpang.co.uk:

ESP32 Module

In the U.S. it's available on the CopperHillTech Website:
ESP32 with WiFi, Bluetooth Classic, BLE, CAN Bus Module

This board has everything needed, including a regulator for powering the device off of the 12V provided by the RV-C connector.


Wiring

The connector used by the Firefly system is a 3M 37104-A165-00E MB which can be sourced from Digikey

Insert four 24AWG wires into the Can-Bus connector (I used silicone covered wire as they are much more flexible) and compress to make the connections. Twist the data and power pairs together and screw them into the terminal block on the CAN-Bus interface on the ESP32.

The CAN-Bus connector plugs into one of the available sockets inside the system wiring panel.


Cable Wiring
Can-Bus Connector Wiring
G7 Panel Home App

Firmware Setup


Finding Output Numbers

The whole multiplex system connects back to a panel with outputs for all of the lights and fans. Each of these outputs has a unique number which may be printed on the panel's cover, and should also be found on a Network Diagnostic screen on the main LCD control screen.

G7 Outputs

USE EXTREME CAUTION WHEN ENTERING OUTPUT NUMBERS. THERE ARE OUTPUTS FOR THE RV SLIDES AND THINGS LIKE MOVEABLE BUNKS. YOU DO NOT WANT TO MISTAKENLY PICK ONE OF THOSE OUTPUTS FOR A LIGHT OR FAN!


Supported RV's

Currently the project includes definition files for these RVs in the RV folder:

Miramar_2020_3202.h - 2020 Thor Miramar 32.2
Aria_2019_3901.h - 2019 Thor Aria 39.1
Tiffin_2019_34PA.h - 2019 Tiffin Open Road 34PA
Jayco_2023_Terrain.h - 2023 Jayco Terrain 19Y

(Additional definition files are welcome!)


3D Printing


Notes and Tips


Links:


Copyright © 2023-2024 Randy Ubillos