An automated system that listens for intercom sounds and provides remote door unlocking capabilities via LINE or email notifications.
When someone rings your intercom:
- The system detects the intercom sound automatically
- Sends you a LINE notification with an unlock link
- You can click the link to remotely unlock the door via Raspberry Pi
- Raspberry Pi with audio input (microphone)
- LINE messaging account (or Resend account for email notifications)
- Internet connection
- Install dependencies:
uv sync- Configure environment variables:
For LINE notifications (default):
export CHANNEL_ACCESS_TOKEN="your-line-channel-access-token"
export BASE_URL="http://your-raspberry-pi-ip:5000"For email notifications (alternative):
export RESEND_API_KEY="your-resend-api-key"
export FROM_EMAIL="sender@yourdomain.com"
export TO_EMAILS="recipient1@example.com,recipient2@example.com"
export BASE_URL="http://your-raspberry-pi-ip:5000"uv run app.pyThe system will:
- Begin monitoring for intercom sounds
- Run in the background continuously
- Send LINE notifications when intercom is detected
When intercom sound is detected, you'll receive a LINE/email message with:
- Alert that someone is at the door
- One-click unlock link
The unlock mechanism works through:
- Secure web endpoint on your Raspberry Pi
- One-time use unlock links for security
- Integration with door lock hardware
- Unlock links expire after use for security
- Ensure your Raspberry Pi is on a secure network
Test the complete workflow:
# Test sound detection
uv run python test_sound_detector.py
# Test email service
uv run python test_email_service.pyThe system includes a time-based pause feature that automatically disables sound detection during specified hours (e.g., nighttime). This prevents unwanted notifications during sleep hours.
By default, the pause feature is enabled with these settings:
- Pause period: 10:00 PM to 8:00 AM
- Status: Enabled
During the pause window, the system will not trigger any notifications
You can customize the pause behavior when initializing the SoundDetector in app.py:
To switch from LINE to email notifications:
- Comment out LINE service imports in
app.py - Uncomment email service imports in
app.py - Update the service initialization in the
initialize_services()function - Set the appropriate environment variables