Home Assistant: You have got mail

How does it work?

The hard(ware) part

  • 2 ZigBee contact sensors (e.g. Xiaomi…)
  • ZigBee network (for example via Deconz)
  • Home Assistant
  • Duck tape, hot glue, etc. to fix the sensors

The fun part

  1. set the mailbox state if the mail was inserted
  2. Reset the mailbox state once we have cleared the mailbox
  3. Reminder in case we forgot to empty the mailbox in the evening
---
alias: "[Mailbox] Mail detection"
trigger:
- platform: state
entity_id: binary_sensor.garden_mailbox_flap
from: "off"
to: "on"
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.garden_mailbox
- condition: state
entity_id: input_boolean.garden_mailbox_notification
state: "on"
- service: notify.mobile_app_xyz
data:
title: JaMa Villa - 📬
message: Trari, trara, die Post ✉️ ist da!
data:
push:
thread-id: "ha-mailbox-notification-group"
---
alias: "[Mailbox] Reset"
trigger:
- platform: state
entity_id: binary_sensor.garden_mailbox_door
from: "off"
to: "on"
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.garden_mailbox
---
alias: "[Mailbox] Notification"
trigger:
- platform: time
at:
- "18:00:00"
- "20:00:00"
condition:
- condition: state
entity_id: input_boolean.garden_mailbox_notification
state: "on"
- condition: state
entity_id: input_boolean.garden_mailbox
state: "on"
action:
- service: notify.mobile_app_xzy
data:
title: JaMa Villa - 📬
message: Der Briefkasten wurde noch nicht geleert, da ist noch ✉️ drin.
data:
push:
thread-id: "ha-mailbox-notification-group"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Markus Haack

Markus Haack

I'm a software engineer, passionate about Home Assistant and automating our house. In my professional life I’m working on commerce and content topics at Adobe.