This project integrates UniFi Access with Airbnb reservations, automating the process of creating and managing visitor access for your Airbnb guests.
- 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
- Python 3.7+
- UniFi Access system
- Airbnb account with ICS feed URL or Hostex API access
- [Optional] Simplepush account for notifications
- Clone the repository:
git clone https://github.com/keithah/unifi-access-airbnb.git
cd unifi-access-airbnb
- Install the required packages:
pip install -r requirements.txt
- Copy the example configuration file and edit it with your settings:
cp unifi.conf.example unifi.conf
nano unifi.conf
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
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
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.
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
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the logs using verbose mode
- Review your configuration file
- Open an issue on GitHub with relevant logs and details```