Simple DIY RV Storage Door Alerts: Smart ESP32 Security

Storage doors are an easy target, and it’s impossible to keep an eye on them when you’re miles away from the campsite. Whether we’re out exploring for the day or just heading into town for a few hours, the camper spends a lot of time sitting unattended. We wanted storage door alerts when a storage bay gets opened the moment it happens, rather than coming back later and realizing something is missing.

Camper parked alone at a quiet campsite where our remote storage door alerts come in handy
When the campsite goes quiet and the camper stays behind.

The Brains of Our Storage Door Alerts: ESP32 and Home Assistant

We use Home Assistant as the smart hub for our camper with ESPresense installed on an ESP32 development board handling the heavy lifting for presence detection. So, to keep this project simple, I used that same ESP32 to pull double duty. Since it was already running ESPresense to monitor whether we were at camp or not (and publishing it to an MQTT broker), I also set it up to monitor our storage bay doors. We supplement our presence detection using the wireless client list from our Mikrotik LTE router, but that’s for another post.

On the ESP32, I configured pins 12 and 13 to be Button 1 and 2 in the ESPresence web interface with internal pull-ups. A tiny magnetic reed switch was installed on each storage door and wired to their respective pin on the ESP32. When a door opens and the magnetic circuit breaks, the ESP32 registers the change and publishes it to MQTT.

ESPresence web interface showing button configuration for reed switches
Configuring the ESP32 pins to monitor the magnetic reed switches.

Configuration page for ESPresense button settings with timeout and trigger options visible
This screen is found by clicking “Click here to edit other settings!” at the bottom of the main menu

One big “real world” benefit of using ESPresense here is the built-in “debounce” timeout, which defaults to 0.5 seconds. If we’re driving down a bumpy road or a door jiggles in the wind, it won’t trigger a false alarm. The sensor only fires if the door is actually opened and stays open for a moment.

Converting Raw Data to Proper Sensors

To make these behave like actual doors in Home Assistant, rather than just generic buttons, I used template sensors in Home Assistant to wrap them into binary_sensor entities:

# storage_doors.yaml
# Converts ESPresense sensors (on/off) into door-type binary sensors

template:
  - binary_sensor:
      - name: "Storage Door Rear"
        unique_id: storage_door_rear
        device_class: door
        state: >
          {{ is_state('sensor.espresense_camper_button_1', 'ON') }}

      - name: "Storage Door Side"
        unique_id: storage_door_side
        device_class: door
        state: >
          {{ is_state('sensor.espresense_camper_button_2', 'ON') }}

Using the reed switches makes the hardware side as simple as it gets. There are no batteries to change and no complex wiring. It is just a closed circuit that breaks when the door opens.

The Automation: Only Alerting When it Matters


The goal was to avoid notification fatigue. We don’t need an alert when we are the ones opening the doors to grab gear. The automation only triggers if the door opens AND both of our person entity locations are set to not_home:

alias: Alert Rear Door
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.storage_door_rear
    from:
      - "off"
    to:
      - "on"
conditions:
  - condition: state
    entity_id: person.cerinia
    state:
      - not_home
  - condition: state
    entity_id: person.tommy
    state:
      - not_home
actions:
  - action: notify.family_phones
    metadata: {}
    data:
      message: Rear storage door was opened and no one is at the camper.
      title: Rear Storage Door Alert
mode: single

The automation for the side door is essentially identical, just swapping the sensor, the message, and the title. The beauty of this setup is that it only reacts in the one situation we actually care about: someone opening a door while the camper is unattended. All the other times, opening doors while we’re around, moving gear, or just checking on things, it stays silent.

iPhone notification showing the Home Assistant storage door alert
Home Assistant push notification on a phone showing a rear storage door alert while no one is at the camper.

Why We Like It

The best part of this project was how much we get out of a single piece of hardware. Since the ESP32 was already sitting there handling presence detection, it was easy to just wire in a couple of reed switches and let the board handle the extra workload. It saved us from adding more “smart” clutter to the rig or having to keep track of a bunch of separate battery-powered sensors that eventually die.

It’s exactly the kind of setup we prefer: simple, hardwired, and out of sight. Having that extra layer of security integrated directly into what we already built takes a huge weight off our shoulders. It lets us actually head out and enjoy wherever we’ve traveled to, knowing that if something does happen back at the site, we’ll be the first to hear about it.

What do you think?


We’d love to hear your thoughts, questions, or your own spin on this! Join the conversation over on our Facebook page.

While You’re Here…


Take a look around and check out some other neat stories:

Share Our Stories

Leave a Reply

Your email address will not be published. Required fields are marked *