How I Set Up My RV for HA

Sorry to aak this maybe simple question.
I want to get HA rinning in my rv as well.
Ive connected my pi4 to the 12v of the camper and it is running.
When at home the pi connects to my home WiFi.
I can connect to HA easily.

But on our travels I have a Nighthawk M6 in the camper to create a rv WiFi network.
The WiFi is perfect running.

Can I connect the pi to the M6 automatically when that WiFi network is up. And if the home WiFi is detected it will connect to my home network.
So I can access the HA with my tablet who is connected to the same WiFi network.

Can HA switch over to a known WiFi network when detected? Just like a phone does?

I don’t think you’re going to get your pi to switch networks. I use essentially the same setup (although I just removed my Pi for a Intel Nuc running Proxmox), and I simply have a dedicated wifi network in my RV so it always connects there. When I’m home, it’s the access point that connects to my home network. The relaying does reduce speed a bit but it’s worth it for the convenience of not having to change wifi networks all the time.

1 Like

I saw some instructions to add secondary wifi network to a file inside /etc and prioritse them.
But that file does not exist in my HA installation. And I am totaly new to HA and to editing in terminal.
But I am reading posts of people having setup pi4 with HA and switching between wifi networks.
They tell only a small bit how to do it. But I am afraid to skrew up the installation.

There’s not a good way to auto switch. I don’t even know if you can do it with actions or not, but I don’t think so - otherwise you could fool with that as a method. The other option would be to make your nighthawk the exact same SSID as your home so it’s an easy transition.

For me, having my RV network as it’s own independent network helps not only for HA (which I always run hard wired instead of wifi anyway) but also for my Pi-Hole and all the various wifi automation devices I run in there. I’ve tried to do it without and found it a pain to manage honestly.

1 Like

This SHOULD work. I have a trailer and when we’re on an actual trip (month+) it’s connected to my router via Ethernet, but when it’s just at home it connects to my home WiFi. When we head to my wife’s parents it connects to their WiFi automatically. Unfortunately you can’t set priorities or anything in HA, but in my experience it seems to just connect to anything you’ve previously connected to and in the order of when you last did so.

1 Like

Sounds great! But sadly it won’t work for me.
I’ve setup two networks and connected to both of the via WiFi. It works manual.
But when I connect to one WiFi network, and the disable that WiFi accesspoint, it won’t connect to the other available, and recent connected, WiFi network.

Bummer.

Weird, because I’ve definitely had this work for me without any interaction on my part. I wonder if it takes a while for it to switch to a different network? It’s a 3 hour drive when I go between networks…

1 Like

This is the difference, you connect wired in the trailer and wifi when you are home, so HA has two network connections and wifi is the second fall-back, meaning if ethernet is disconnected it will attempt wifi to the SSID you provided in the config.

That could still be useful as @Dennis-en-Nancy might be able to set up something similar to resolve his issue, but that explains why it works for you and not him. It’s not remembering all your various networks (like your computer or phone would), I’m pretty sure that HA can only have on SSID and doesn’t rotate like those devices do.

1 Like

While this is true on long trips where I setup my own router/internet in the trailer, what I’m referring to are short trips between my house (using my home WiFi) and my wife’s parents (using their WiFi). As I mentioned, it’s a 3 hour trip, but when I get there my HA automatically connects to their network after previously being connected to mine without any intervention on my part.

1 Like

New addition to my RV setup: we’re currently at elevation in CO, and so it gets cold at night. We’ve been running the fireplace (fancy space heater) in the living room and small ceramic space heaters in the master and toy hauler garage (rear sleeping area.) They have a crude analog dial-type “thermostat” which doesn’t have temperature control in degrees; just “more warm” or “less warm” so we were regularly waking up in the night either freezing or sweating.

Ok, enough buildup. I have a few sonoff S31 relay plug that I wasn’t using yet, so I flashed them with ESPHome and called them “{room} space heater” respectively. I also picked up a couple of Govee H5100 Hygrometers, which are seamlessly picked up by my already-running bluetooth relay (I have a few on ESP32s that do other stuff, so I can “mesh” BT-enabled things like this into HA.) I put one of those in each room so I can read the temp.

Since I now have access to the temperature and the ability to turn on and off the space heaters (since they are fully analog, I just turned the “thermostat” value on each all the way up,) I can let HA decide when to turn them on and off at the wall based on the temp. This was as simple as adding a couple of generic_thermostats like so:

  - platform: generic_thermostat
    name: Master Bedroom Heater Thermostat
    heater: switch.master_bedroom_space_heater_relay
    target_sensor: sensor.master_bedroom_thermometer_temperature
    min_temp: 62
    max_temp: 78
    ac_mode: false
    target_temp: 68
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    # keep_alive:
    #   minutes: 3
    initial_hvac_mode: "heat"
    away_temp: 66
    sleep_temp: 67
    home_temp: 70
    precision: 0.1

Outcome:
image

And here’s the temp data for the first night using it:
image

All told, since I already had the BT relay running and easy access to flash the sonoff S31s, it only took about 15 minutes to configure. HA really is a beautiful thing, once you start to get big building blocks in place :slight_smile:

1 Like

Update on this: I helped to port the renogy-bt project to run natively on ESPHome instead of requiring something like a pi’s cron to run the python that it originally was: GitHub - mavenius/renogy-bt-esphome: ESPHome implementation to pull data from BT-enabled Renogy devices

Hope this helps someone :slight_smile:

I do the same thing on my space heater. This time of year in Colorado sort of demands you have one!

1 Like