Specialty Outdoor Sensors: Mailbox, Packages, Bins, the Drainage Pit, Frost, and Technical Alerts

Module 21 · Lesson 10

Specialty Outdoor Sensors: Mailbox, Packages, Bins, the Drainage Pit, Frost, and Technical Alerts

This lesson covers sensors most guides forget, because they don't sound impressive: the mailbox, the trash bins, the drainage pit. Each one solves a specific, recurring everyday problem.

Budget around 70 minutes. Example entities: binary_sensor.mailbox_open, binary_sensor.drainage_pit_high_level, sensor.outdoor_temperature, input_boolean.trash_bin_reminder.

The Mailbox: A Reed Sensor Plus One Automation

An ordinary reed sensor on the mailbox flap, wired through Zigbee or a small battery-powered ESPHome module, detects when it's opened. The bare fact of it opening doesn't tell you whether mail was dropped in or taken out, but in practice a single daily notification about the first open after the mail carrier's usual delivery window is enough.

automation:
  - alias: "Mailbox: notification on first open in delivery window"
    id: mailbox_first_open_delivery_window
    mode: single
    triggers:
      - trigger: state
        entity_id: binary_sensor.mailbox_open
        to: "on"
    conditions:
      - condition: time
        after: "10:00:00"
        before: "16:00:00"
      - condition: template
        value_template: >
          {{ (now() - states.binary_sensor.mailbox_open.last_changed).total_seconds() > 43200 }}
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Mailbox"
          message: "Someone opened the mailbox. Mail was likely delivered."

The template condition limits notifications to the first open after a longer gap: without it, every subsequent open that same day (you checking the mail again, say) would fire another notification.

Trash Bins: A Recurring Reminder, Not a Sensor

There's no sensible, cheap sensor for "is the bin sitting out at the curb": that's a job for a schedule, not a sensor. Your municipality's collection schedule changes periodically: instead of a fixed date in an automation, use a helper with a list of dates, or a calendar integration (a local iCal file exported from your municipality's system, if one exists), so you're not editing YAML every quarter.

automation:
  - alias: "Trash bins: evening reminder before collection"
    id: trash_bins_evening_reminder_before_collection
    mode: single
    triggers:
      - trigger: calendar
        event: start
        entity_id: calendar.trash_collection
        offset: "-1 day"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Trash bins"
          message: "Collection tomorrow: {{ trigger.calendar_event.summary }}. Put the bin out this evening."

The Drainage Pit: A High-Level Alert

A drainage pit means gases and moisture: match the sensor to the environment
Standard electronics corrode fast in a drainage pit. Check the protection rating (IP68 or higher for submersion) and the enclosure's chemical resistance before mounting. An alternative: a sensor mounted above the actual pit, measuring level without contact (ultrasonic), away from direct contact with the liquid.

automation:
  - alias: "Drainage pit: high-level alert"
    id: drainage_pit_high_level_alert
    mode: single
    triggers:
      - trigger: state
        entity_id: binary_sensor.drainage_pit_high_level
        to: "on"
        for:
          minutes: 2
    conditions:
      - condition: state
        entity_id: input_boolean.outdoor_alerts_enabled
        state: "on"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Drainage pit: high level"
          message: "Water level in the drainage pit has crossed the warning threshold."
          data:
            importance: high
            tag: "drainage-pit-level"

for: minutes: 2 filters out brief false alarms (a momentary surge after a downpour, for instance), while still warning fast enough about a real risk of backup.

Frost: Protecting Outdoor Faucets and Pipes

automation:
  - alias: "Frost: reminder to shut off the outdoor faucet"
    id: frost_reminder_shut_off_outdoor_faucet
    mode: single
    triggers:
      - trigger: numeric_state
        entity_id: sensor.outdoor_temperature
        below: 36
        for:
          hours: 1
    conditions:
      - condition: time
        after: "20:00:00"
        before: "23:00:00"
      - condition: state
        entity_id: input_select.garden_mode
        state:
          - "Summer"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Frost is coming"
          message: "Temperature has dropped below 36°F. Shut off and drain the garden faucet, and disconnect hoses."

This is a reminder, not an automatic valve shutoff: closing the main water valve with no household member's knowledge could surprise someone mid-shower. If you want full automation of a seasonal valve shutoff, consider a separate, clearly labeled button, "Winter: secure outdoor plumbing," triggered deliberately once a season, rather than an automation reacting to a single temperature reading.

Why Some "Sensors" Are Better Replaced by a Simple Reminder

Not every recurring problem needs a dedicated sensor. Trash bins are a good example: in theory you could mount a weight sensor or a lid-open sensor, but in practice a recurring, schedule-based reminder (every other Tuesday evening, say) is simpler and cheaper, with no extra hardware to buy, mount, and maintain. The rule of choosing the simplest sufficient solution, not the most technically impressive one, applies across this entire module.

Smoke and Gas Sensors Outdoors: The Grill, the Garage, the Shed

Beyond the typical indoor sensors from Module 18, it's worth considering a dedicated CO or smoke sensor in the garage (especially if you store fuel there or run an engine) and near a fixed outdoor grill or a garden stove. These sensors integrate the same way as their indoor counterparts, but need an enclosure rated for outdoor exposure and, in the garage's case, placement well away from direct exhaust, to avoid false alarms every time an engine starts.

Integrating with External Alarm Systems

Some properties already have a traditional alarm system installed, with sensors on the fence or the gate, running independently of Home Assistant. Rather than duplicating those sensors, it's often worth integrating the existing alarm system through a gateway module (the alarm panel's relay output wired into an ESPHome GPIO input from Module 10, for example), which lets Home Assistant react to events from the professional alarm system without investing in a duplicate set of outdoor sensors.

Roof Snow-Load Sensors: Preventing Overload

In regions with heavy snowfall, accumulation on a flat or lightly pitched roof can exceed the structure's rated load. A simple ultrasonic sensor aimed at a section of the roof, similar in principle to the tank level sensor from Lesson 9, can monitor snow depth and send an alert once it crosses a set, safe threshold, giving you time to plan snow removal before it becomes a sudden emergency.

Monitoring Solar Panels in the Garden and on Outbuildings

Beyond the main rooftop solar installation (covered in Module 17), smaller solar panels powering garden lighting or a pond pump can also be monitored if they have the right electronics: a voltage and charging-current sensor, integrated through ESPHome, lets you catch a drop in panel output (from dirt buildup, or shade from a growing tree, say) before the device powered by that panel stops working from a drained battery.

Tying Specialty Sensors to Seasonal Notifications

The sensors covered in this lesson (mailbox, trash bins, frost) gain value when their notifications are seasonally aware: the bin reminder makes sense year-round, but a frost alert only matters in the colder months, and should stay quiet outside the heating season so it doesn't generate needless notifications. A simple condition checking the time of year (based on date or outdoor temperature) in each of these automations keeps the system relevant all year long.

Integrating with Your Municipality's Local Trash Collection Schedule

For the trash bin reminder in this lesson, it's worth checking whether your municipality publishes its collection schedule in a format you can import into a Google Calendar, integrated with Home Assistant through a calendar entity. Instead of manually setting a recurring every-other-week reminder, an automation built on the municipality's actual schedule automatically accounts for shifted dates around holidays or periodic schedule adjustments.

How to Test This Lesson

1. Open the mailbox within the 10am-4pm window and confirm the notification.

2. Check the trash collection calendar: does it update automatically when your municipality's schedule changes?

3. Verify the sensor's IP rating before mounting it in the drainage pit.

Common Mistakes

A fixed trash-collection date in YAML: stops working the first time the municipality's schedule shifts.

A sensor with no IP68 rating in the drainage pit: corrosion and failure within months.

Automatically shutting the main water valve: can catch a household member off guard mid-shower.

Practical Task

☐ Mount a reed sensor on the mailbox and set up the time-filtered notification.

☐ Connect the trash collection calendar instead of a fixed date.

☐ Add the frost reminder for outdoor faucets.

Key Takeaways

Bins call for a calendar, not a sensor: the municipality's schedule changes.

A drainage pit needs a sensor rated for moisture and gases, IP68 minimum.

Frost protection as a reminder, not an automatic action on the water system.

What's Next

Next lesson: Weather Sensors: Rain, Wind, Temperature, Soil Moisture, and Sunlight. We build our own weather station instead of relying solely on an internet forecast.

Finished this lesson?