I once put a zigbee motion sensor in my mailbox, and it worked, but the battery ran down really fast.
Now I just use the USPS informed delivery service. Every morning I get an email with images of that day’s mail, and then I get another email when the mail is delivered.
Hey @lighthouse, regarding the false positives, I recommend using a reed switch instead of a PIR motion sensor. PIRs are very sensitive to small vibrations, changes in brightness and even small insects, which often leads to unwanted triggers over time. It’s also important to fine tune the gap between the magnet and the reed switch, and to adjust the debounce period on the device. This helps avoid multiple signals when the mail carrier opens the flap.
In my project, I’m using the LoRaWAN protocol, which sits on top of the LoRa radio layer and provides secure communication and standardized message handling. The messages are forwarded by the gateway to a LoRaWAN Network Server (LNS), which then routes and decrypts the payload before publishing it to an MQTT broker, similar to what I implemented here: https://github.com/vhuynen/Kerlink-LoRaWAN-To-AWS-IoT-Core
I moved away from the Helium network and now use a personal Kerlink LoRaWAN gateway. For the moment, I’m relying on AWS IoT Core as my NLS, but I plan to switch to a local LNS using the open-source ChirpStack stack: https://www.chirpstack.io/
The final architecture will look like this:
Device → LoRaWAN Gateway → ChirpStack → MQTT → Node-Red → MQTT → Home Assistant
thanks a lot @vhuynen for your explanation. I got the Adeunis Dry Contact and am using the following config together with a Lorawan-Gateway and Chirpstack.
The TOR2 is working fine, I have configured it to edge high & low. When the door opens I get open via MQTT, and closed when its closed.
closed, keepAlive: false because the input event has triggered
TOR1 is configured with only high edge. The micro-switch is normally closed, meaning the lever pushes on the micro-switch. I would like that I get “open” when the lever does not push anymore on the micro-switch because a letter has been put into the box and the flap opens.
However I get either state open and keepAlive true (where I would expect keepAlive is false and state open). The next time I get keepAlive false and state “closed”.
question: What do I need to modify in order to get keepAlive false and state to open when the micro-switch is not being pushed down from the lever?
Whenever I release the the micro-switch I get Lora-frames
if i were to take a go at it id do contact sensor on mail box plus sign upf or USPS informed delivery which sends email if mail is even expected that day, imap cans scrape email for the usps informed delivery. So if mailbox is opened within a window of time when mail is expected it marks a sensor mail has been delivered. Also note someone linked the Mail&Packages Integration you need that it skips the hasle of creating imap scrape logic it also does other cool things like package tracking.
Truth is theres no one clear shot way but im willing to help you, your gonna have to leverage data from multiple places to get exactly what you want but so far it seems like your halfway there
I have to walk 247 feet to retrieve my email. I want to know if it has actually arrived yet. I finally got this working in the “bank vault” of a mailbox using a YoLink LoRa Smart Outdoor Contact Sensor & Hub Starter Kit.
if google still had massive free tier api the solution would be so simple, exacly this camera in mailbox and let ai determine if mail is in the box, the triger would be the cameras motion detection, and the action would be . I abused this setup when google let you call 100’s of ai api calls a day.
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.hallway_sensor_presence
from: null
to:
- "on"
conditions: []
actions:
- action: ai_task.generate_data
metadata: {}
data:
task_name: Check if mail in mailbox
instructions: >-
This is a mailbox camera, if you see mail inside return yes if not
reutrn no, do not append anything to beggining or end of your statement
entity_id: ai_task.google_ai_task_2
attachments:
media_content_id: >-
media-source://camera/camera.hallway_floor_2_camera_high_resolution_channel
media_content_type: application/vnd.apple.mpegurl
metadata:
title: Hallway Floor 2 Camera High resolution channel
thumbnail: >-
/api/camera_proxy/camera.hallway_floor_2_camera_high_resolution_channel
media_class: video
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://camera
response_variable: mail
- if:
- condition: template
value_template: (enter variable if repsonse = yes)
then:
- action: notify.notify
metadata: {}
data:
message: Mail has been delivered
title: Mail
thanks for the inputs. If anyone is planning to use the Adeunis Dry contact sensor as I do, you can download the codec under https://www.download.codec-adeunis.com/adeunis-codecs-libs-1.7.1.tgz and choose the Dry contact javascript file, paste it 1:1 into the codec and it just works fine.
Thanks a lot to @vhuynen who pointed me into the right direction