10000 GitHub - Combatchuck/Unifi_Access_Scripts
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Combatchuck/Unifi_Access_Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Created for use in managing the neighborhood gate system

https://store.ui.com/us/en/products/ua-sk-gate

API Access and Automations

Important:

  • Ensure all APIs listed in automations are protected with 10.0.0.0/8 access.
  • I removed the API token, but you will need to edit the
    • Host IP
    • Group ID
    • Site ID
    • anything else specfic to your enviroment

Generating a New API Token (Admin Permissions Required)

  1. Log in to Unifi Access.
  2. Navigate to General -> API Token.
  3. Create a new token and select all permissions.

User Automations

Located in the User Folder. Ensure necessary permissions are set.

Add PIN and Group to Existing User

./Add_PIN_and_Group_To_User.sh <email> <PIN>

Create User (New User from scratch)

./Create_User.sh <first_name> <last_name> <email> <new_pin>

Create Multiple Users from CSV (Multiple User Creation)

File Format

CSV File (First Name, Last Name, Email, PIN)

./Create_Users_From_CSV.sh <csv_file>

Visitor Automations

Located in the Visitor Folder. Ensure necessary permissions are set. Still requires QR Code to be enabled and linked to existing user

Multiple Visitors - Guests and not residents

File Format

.TXT File (First Name Last Name Email address) Space or Tab Delemited

./24-7-Multiple_Visitor_BasedOff_NON_Resident.sh <visitors_file.txt>

Multiple Visitors where it creates based off existing user

File Format

.TXT File (email, one per line and must exist as a existing user) Space or Tab Delemited

./24-7-Multiple_VisitorBasedOff_Resident.sh <visitors_file.txt>

Single User Based off non resident

./24-7-Single_VisitorBasedOff_NON_Resident.sh <First> <Last> <email>

Single User Based off existing resident - Creates visitor as First Name: <First_Last> Last Name:

./24-7-Single_VisitorBasedOff_Resident.sh <email>

Helpful Commands

Source Documentation

https://core-config-gfoz.uid.alpha.ui.com/configs/unifi-access/api_reference.pdf

List all Users

curl -s -k 'https://10.10.10.1:12445/api/v1/developer/users' -H 'Authorization: Bearer <token>' | \
jq '.data[]'

List all Doors

curl -s -k 'https://10.10.10.1:12445/api/v1/developer/doors' -H 'Authorization: Bearer <token>' | \
jq '.data[]'

List All Groups

curl -s -k 'https://10.10.10.1:12445/api/v1/developer/user_groups' -H 'Authorization: Bearer <token>' | \
jq '.data[]'

List All Sites

curl -X GET 'https://api.ui.com/ea/hosts?pageSize=10' \
-H 'Accept: application/json' \
-H 'X-API-KEY: <token>' | jq '.data[]'

List All Visitors

curl -s -k 'https://10.10.10.1:12445/api/v1/developer/visitors' -H 'Authorization: Bearer <token>' | \
jq '.data[]'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0