Go to file
Cole Nicholas e080aba000 Add Docker containerization and Raspberry Pi support
- Add Dockerfile with multi-architecture support (AMD64/ARM64/ARMv7)
- Add docker-compose.yml with continuous and manual run options
- Add comprehensive Docker documentation (README-DOCKER.md)
- Add CLAUDE.md for future development guidance
- Update README.md with Docker deployment and UniFi Protect future goals
- Configure individual door device support (vs door groups)
- Add Raspberry Pi compatibility and deployment instructions
- Include memory limits for Pi optimization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 10:48:55 -06:00
.claude Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
.dockerignore Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
.gitignore Initial commit 2024-08-22 20:25:32 -07:00
CHANGELOG.md Refactor visitor creation and improve error handling 2024-09-11 19:59:20 -07:00
CLAUDE.md Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
Dockerfile Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
LICENSE Initial commit 2024-08-22 20:19:05 -07:00
README-DOCKER.md Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
README.md Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
config.py Refactor visitor creation and improve error handling 2024-09-11 19:59:20 -07:00
docker-compose.yml Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
hostex_api.py Update hostex_api.py 2024-12-11 11:49:57 -08:00
ics_parser.py Update ics_parser.py 2024-12-11 12:16:17 -08:00
main.py xref ICS, enhanced logging+summary 2024-12-11 12:15:31 -08:00
notification.py Initial commit 2024-08-22 20:25:32 -07:00
requirements.txt Initial commit 2024-08-22 20:25:32 -07:00
unifi.conf.example Initial commit 2024-08-22 20:25:32 -07:00
unifi_access.py Add Docker containerization and Raspberry Pi support 2025-11-27 10:48:55 -06:00
utils.py Initial commit 2024-08-22 20:25:32 -07:00

README.md

This project integrates UniFi Access with Airbnb reservations, automating the process of creating and managing visitor access for your Airbnb guests.

Features

  • Fetch reservations from Hostex API or Airbnb ICS feed
  • Create UniFi Access visitor accounts for upcoming guests
  • Assign PIN codes to visitors based on their phone number
  • Automatically delete past or completed visitor accounts
  • Send notifications via Simplepush for updates and failures
  • Cross-verify reservations between Hostex and ICS calendar
  • Monitor and report discrepancies in booking data
  • Detailed logging of all visitor management operations

Prerequisites

  • Python 3.7+
  • UniFi Access system
  • Airbnb account with ICS feed URL or Hostex API access
  • [Optional] Simplepush account for notifications

Installation

  1. Clone the repository:

git clone https://github.com/keithah/unifi-access-airbnb.git

cd unifi-access-airbnb

  1. Install the required packages:

pip install -r requirements.txt

  1. Copy the example configuration file and edit it with your settings:

cp unifi.conf.example unifi.conf

nano unifi.conf

Usage

Run the script using:

python3 main.py

Optional arguments:

  • -v or --verbose: Increase output verbosity
  • -l [LOG_FILE] or --log [LOG_FILE]: Specify a log file (default: unifi_access.log)
  • --list-door-groups: List available door groups

Configuration

Edit the unifi.conf file with your specific settings. Key sections include:

  • [UniFi]: UniFi Access API settings
  • api_host: UniFi Access controller URL
  • api_token: Authentication token
  • [Hostex]: Hostex API settings (if used)
  • api_url: Hostex API endpoint
  • api_key: Authentication key
  • [Airbnb]: Airbnb ICS feed URL (if used)
  • ics_url: Calendar feed URL
  • [Door]: Door access settings
  • default_group_id: Default door group ID for visitor access
  • [Visitor]: Visit timing settings
  • check_in_time: Default check-in time (e.g., "14:30")
  • check_out_time: Default check-out time (e.g., "11:30")
  • [General]: General settings
  • log_file: Path to log file
  • pin_code_digits: Number of digits for PIN codes
  • [Simplepush]: Notification settings
  • enabled: Enable/disable notifications
  • key: Simplepush key
  • url: Simplepush API URL

Logging and Monitoring

The script provides detailed logging of all operations:

  • Reservation processing from Hostex and ICS
  • Visitor creation and deletion in UniFi Access
  • PIN code assignments and updates
  • Cross-system verification results
  • Errors and warnings

Logs can be viewed in real-time using the -v flag or reviewed in the log file.

System Verification

The script performs several verification checks:

  • Matches Hostex reservations with ICS calendar entries
  • Verifies phone numbers and PIN codes across systems
  • Reports discrepancies in dates or guest information
  • Monitors UniFi Access visitor status

Docker Deployment

For easy deployment and automation, this project includes Docker support:

Quick Start with Docker

# Build and run continuously (checks every 6 hours)
docker-compose up -d

# Run once manually
docker-compose --profile manual up unifi-access-airbnb-once

# View logs
docker-compose logs -f

See README-DOCKER.md for complete Docker setup instructions.

Raspberry Pi Support

The Docker container runs perfectly on Raspberry Pi (ARM64/ARM32). Simply:

# On Raspberry Pi
docker-compose up -d

Docker automatically pulls the correct architecture. See README-DOCKER.md for Pi-specific notes.

Future Goals

UniFi Protect Integration

Plans to extend this project with UniFi Protect video recording capabilities:

Required Hardware:

  • UniFi Gateway Max (UDM-Pro Max) with built-in NVR
  • OR UniFi Cloud Key Gen2+ with Protect

Planned Features:

  • Guest Check-in Recording: Automatically start recording when guests arrive
  • Stay Duration Recording: Record during entire guest stay period
  • Checkout Verification: Capture departure recordings
  • Incident Documentation: Archive recordings for property protection
  • Guest Privacy: Automatic recording pause/resume based on occupancy

Implementation Ideas:

  • Integrate with UniFi Protect API for camera control
  • Coordinate recording schedules with visitor access periods
  • Provide guest notification of recording periods (legal compliance)
  • Archive system for easy retrieval of guest-specific recordings

Benefits:

  • Property protection during guest stays
  • Incident documentation and liability protection
  • Automated recording management tied to booking system
  • Enhanced security without manual camera management

This would create a complete property automation ecosystem: Access Control + Video Security synchronized with your Airbnb bookings.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions:

  1. Check the logs using verbose mode
  2. Review your configuration file
  3. Open an issue on GitHub with relevant logs and details