The Garage, Driveway, and Car Presence: Garage Door, Lighting, Sensors, and Plan B

Module 21 · Lesson 7

The Garage, Driveway, and Car Presence: Garage Door, Lighting, Sensors, and Plan B

The garage door is the third dry-contact zone in this module, but it adds a new wrinkle: car presence. A lot of "clever" garage automations fail precisely because they treat a car's presence as a certainty, when it's actually one of the least reliable signals in the whole system.

This lesson assumes Lesson 5
Dry contact, local pulse timing, a single reed sensor and its limits were all covered at the driveway gate. Here I'll focus on what's specific to the garage: the vertical travel of the door, the dead zone a motion sensor has near the floor, and "car presence" as a supporting signal, not a definitive one.

Budget around 80 minutes. Example entities: binary_sensor.garage_door_closed, switch.garage_door_pulse, device_tracker.car_owner_phone, binary_sensor.garage_motion.

A Problem from Real Life: "Car in the Garage" Lies More Than You'd Think

You want an automation: "if the car pulled into the garage, close the door after 2 minutes." How does HA actually know the car is in the garage? Tracking a phone inside a garage is unreliable: GPS loses signal under a concrete roof, and Bluetooth and Wi-Fi range extends well past the garage itself. A motion sensor detects movement, not stillness: once the car is parked and the engine's off, the sensor stops seeing anything after a moment. A reed sensor on the door only reports the door's position, not what's inside.

The most trustworthy signal: a magnetic or distance sensor at the parking spot itself
A floor sensor or a distance (ultrasonic) sensor aimed at a specific parking spot gives the clearest signal available: "something large is sitting here" or "the spot is empty." That's a separate, inexpensive sensor, not a phone feature.

Garage Architecture: Four Sensors

EntityWhat it measuresWhat it does NOT measure
binary_sensor.garage_door_closeddoor positionwhat's inside the garage
binary_sensor.parking_spot_occupiedvehicle presence at the spotwhich car it is
binary_sensor.garage_motionmovement in the roomstillness after parking
device_tracker.car_owner_phonean approximate phone locationwhether the car is in the garage or just outside it

Automation: Garage Lighting on Motion, with a Time-of-Day Condition

automation:
  - alias: "Garage: light on motion detected"
    id: garage_light_on_motion
    mode: restart
    triggers:
      - trigger: state
        entity_id: binary_sensor.garage_motion
        to: "on"
    conditions:
      - condition: state
        entity_id: input_boolean.outdoor_automation_enabled
        state: "on"
    actions:
      - action: light.turn_on
        target:
          entity_id: light.garage
      - wait_for_trigger:
          - trigger: state
            entity_id: binary_sensor.garage_motion
            to: "off"
            for:
              minutes: 5
      - action: light.turn_off
        target:
          entity_id: light.garage

mode: restart is essential here: every fresh burst of motion resets the countdown to shutoff, so the light won't cut out while someone's standing motionless at the workbench for slightly longer than a typical walk-through. Without this mode, a second trigger firing while the first run is still active would just be ignored.

Automation: An Evening Reminder for an Open Garage Door

automation:
  - alias: "Garage: reminder for an open door after dusk"
    id: garage_reminder_door_open_dusk
    mode: single
    triggers:
      - trigger: sun
        event: sunset
        offset: "+00:30:00"
    conditions:
      - condition: state
        entity_id: binary_sensor.garage_door_closed
        state: "off"
      - condition: state
        entity_id: input_boolean.outdoor_alerts_enabled
        state: "on"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Garage door open"
          message: "Dusk is falling and the garage door isn't closed."

  - alias: "Garage: door open overnight for more than an hour"
    id: garage_door_open_overnight_hour
    mode: single
    triggers:
      - trigger: state
        entity_id: binary_sensor.garage_door_closed
        to: "off"
        for:
          hours: 1
    conditions:
      - condition: time
        after: "22:00:00"
        before: "06:00:00"
      - condition: state
        entity_id: input_boolean.outdoor_alerts_enabled
        state: "on"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Garage door: overnight alert"
          message: "The garage door has been open for over an hour overnight."
          data:
            importance: high
            tag: "garage-door-night"

The second automation deliberately doesn't close the door on its own: it's only a reminder. Closing a garage door without checking whether something, or someone, is in its path is dangerous: we leave that decision to a person, exactly as with the driveway gate and the pedestrian gate.

Plan B: The Garage Door with No Power and No HA

Every garage door opener has a mechanical emergency release (a cord with a handle near the rail). Find its location and test it once, deliberately, before you ever need it during an actual failure. Also keep the manufacturer's physical remote in the car: it's an independent control channel for when HA, Wi-Fi, and power all fail at once.

Shelly Uni in the Garage: Why It's a Popular Choice

The Shelly Uni stands out from other Shelly modules with its 12-36V DC power input (some garage door openers have a low-voltage control output) and two additional analog/digital inputs, handy for wiring in extra garage-door limit sensors, independent of the basic open/close signal. That lets you build an architecture with several independent sources of signal, instead of relying on a single reed sensor, which cuts down on the risk of a bad state described in this lesson.

Car Presence Sensors: Alternatives to a Reed Sensor

A reed sensor on the garage door: simplest and cheapest, but it only reports the door's state, not whether a car is actually inside

An ultrasonic parking sensor: measures distance to an obstacle, can detect a car's presence independent of door state

A PIR motion sensor in the garage: catches motion on the way in or out, but doesn't distinguish a car from a person walking through

A camera with object detection (Frigate): the most precise method, distinguishes a car from a person, but needs a camera aimed at the parking spot

Child and Pet Safety Around an Automatic Garage Door

An automatic garage door and kids are a combination that demands extra caution
A garage door moved automatically based on presence sensors can pose a hazard to children or pets playing in or near the garage. Always use a door with certified safety sensors (photo-eyes, an edge pressure sensor), and treat the automations controlling the door in this lesson as a convenience, never a substitute for those safeguards. Consider adding a short warning chime or a flashing light before the door starts moving.

Air Quality Sensors in the Garage: Exhaust and Ventilation

A garage where a car engine runs even briefly while warming up builds up carbon monoxide far faster than a ventilated outdoor space. A dedicated CO sensor in the garage, integrated the same way as the smoke detectors from Module 18, can automatically trigger an exhaust fan (if the garage has one) or at least send an alert before concentration reaches a dangerous level, which matters especially for garages directly connected to the living space.

EV Chargers in the Garage and Home Assistant Integration

More and more home garages have an EV charger installed, and many popular models (Wallbox, Zaptec, some open-source chargers like OpenEVSE) offer Home Assistant integration, letting you control charging power based on your electricity rate plan or your own solar production, tying directly back into the energy-management knowledge from Module 17. That's a natural extension of the garage automation from this lesson for anyone with an electric vehicle.

Multi-Bay Garages and Shared Parking Lots

For homes with a multi-bay garage or a shared community parking area, the logic in this lesson needs to expand to distinguish individual parking spots, each with its own presence sensor. Instead of a single "car in the garage" entity, a state table per spot makes more sense, with a dashboard showing an aggregate occupancy view, particularly useful for households with more than one vehicle.

Emergency Garage Lighting During a Power Outage

Unlike the inside of a house, a garage often has no natural light, so a power outage means total darkness in a space that may hold dangerous tools or chemicals. A simple battery-powered emergency light, with a power-loss sensor (similar to the UPS approach from the maintenance module), that automatically switches on when power drops, is a cheap, practical complement to the garage automation described in this lesson.

How to Test This Lesson

1. Stand still in the garage for a moment and check how long it takes the mode: restart light to turn off.

2. Leave the door open after dark and confirm the reminder arrives.

3. Find and manually test the operator's mechanical release.

Common Mistakes

Automatic closing after "detecting" a car: risk of closing on something or someone in the door's path.

A phone's device_tracker as the only car-presence signal: a phone and a car are not the same thing.

No restart mode on motion-controlled lighting: the light cuts out mid-task while someone's still in the garage.

Practical Task

☐ Set up the garage lighting automation with restart mode.

☐ Add a reminder for an open door after dark.

☐ Locate and test the operator's mechanical emergency release.

Key Takeaways

"Car presence" is an unreliable signal: use a dedicated spot sensor, not a phone.

Closing the door always requires a deliberate human decision.

Test the operator's mechanical release now, not during an actual failure.

What's Next

Next lesson: Garden Irrigation: Solenoid Valves, Zones, Schedules, Rain, and Manual Override. We close out the high-risk zones and move on to garden automation.

Finished this lesson?