> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anny.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect UniFi with anny

> Automate time-limited door access with UniFi Access for bookings and community members.

UniFi Access ([website](https://ui.com/eu/de/physical-security/door-access)) is an on-premise solution for electronic door access. With this integration, anny automatically grants time-limited access permissions for bookings and community members.

With UniFi you can do the following in anny:

* link resources with one or more UniFi doors
* grant community members access to selected doors
* enable access via the UniFi app, a PIN code or **Remote Open**

The integration is especially useful if you already use UniFi as your network and access system and have experience with network administration.

<Info>
  The UniFi integration is available from the Professional plan onwards.
</Info>

## Typical use cases

| Use case             | Description                                                                                                             |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Bookable rooms       | **Automatic access per booking:** customers only get access to the doors of the booked resource for the defined period. |
| Member areas         | **Access for community members:** members of a community can open the assigned doors.                                   |
| Access without a key | **Flexible door opening:** customers open doors via the UniFi app, a PIN code on the keypad or Remote Open in anny.     |

## How the UniFi connection works

anny authenticates with the host URL of your UniFi network and an API token. The host URL has to be reachable from outside. Through this connection, anny retrieves the doors and users set up in UniFi Access and manages the matching access permissions.

By default, anny creates a guest access with a PIN code for every booking. If you activate the **Extend permissions for existing users** option in the access rule, anny first matches the booking email with existing UniFi accounts: if there is a match, the access runs through the UniFi app, otherwise a PIN code is created.

anny creates app access for existing UniFi accounts shortly before the booking starts (just in time). To do so, anny adds the account to an access policy it manages itself (a policy with the suffix "anny") and removes it again at the end of the period. Until it is created, the access has the status **Scheduled**.

<Warning>
  Do not edit or delete the access policies created by anny (policies with the suffix "anny") or the "always access" schedule manually in UniFi. anny manages them automatically. Manual changes can disrupt the time-limited access.
</Warning>

If you revoke the API token or the host URL is no longer reachable, anny cannot retrieve any doors and cannot manage any access permissions through UniFi.

| Data               | Direction    | Frequency                                                |
| ------------------ | ------------ | -------------------------------------------------------- |
| Doors and users    | UniFi → anny | When loading and configuring the integration             |
| Access permissions | anny → UniFi | When an access permission is created, changed or removed |
| Door unlocking     | anny → UniFi | When Remote Open is used                                 |

## Connect UniFi

### Requirements

Before you connect UniFi, make sure you have the following:

* a configured UniFi network system with UniFi Access and working doors
* a host URL for your UniFi network that is reachable from outside
* an API token that you create in the UniFi Access app
* the Professional plan or higher in anny
* at least one resource or community for the access rule

### Set up the connection

<Steps>
  <Step title="Open the integration">
    Open **Integrations** from the menu bar and go to **UniFi**.
  </Step>

  <Step title="Authenticate">
    Enter the host URL of your UniFi network and the API token. You find notes on external network access in [this guide](https://artofwifi.net/blog/how-to-access-the-unifi-controller-by-wan-ip-or-hostname-on-a-udm-pro).
  </Step>

  <Step title="Configure">
    Create the access rules you need:

    1. Click **Add** under bookings or communities.
    2. Select the resource or community.
    3. Assign one or more UniFi doors.
    4. For booking rules, define **Access before the booking** and **Access after the booking**.
    5. If needed, activate **Use remote opening** or **Extend permissions for existing users**.
  </Step>

  <Step title="Check the connection">
    Create a test booking and open its detail view. There you check the status, the access period, the door and, for guest access, the PIN code.
  </Step>
</Steps>

As soon as the connection is active, anny creates and removes access permissions automatically based on your rules.

The following image shows where you create an access rule for bookings and link a resource with UniFi doors.

![Configure an access rule for bookings](https://downloads.intercomcdn.eu/i/o/niegcmk9/88240436/82f4832243317df534a5ff72fbd4/Frame-2B10-284-29.png?expires=1785256200\&signature=5cabf6b407831d49edccaf16551595265408764bd8c72d24b4082ee22c2f7fce\&req=2N1twVj%2BrzFk2hL085Zhobi7pxl56CpAdW9AtamG7AAxmmpHpfK%2BPfJUepmI%0AdI%2FStIocQRnF3GuG%0A)

The detail view of a booking rule shows the assigned resource, the doors and the lead and follow-up time.

![Details of a booking rule](https://downloads.intercomcdn.eu/i/o/niegcmk9/88240434/d7a709a789510c9355cef96960c1/Frame-2B10-2B--2B2025-01-16T172911_733.png?expires=1785256200\&signature=e87d0a22101f6cdb85eba4f7cfb3929547f600c6ede2299660808506bc792ef8\&req=2N1twVj%2BrzNk2hL085ZhobBGZIK%2Fic1k3buYVJzgiLaabHGo9sJrypdCxC5T%0AIu7VIjl%2F8TD46KOE%0A)

For communities, you assign one or more doors to a community. This way, their members receive the defined access permissions.

![Configure an access rule for a community](https://downloads.intercomcdn.eu/i/o/niegcmk9/88240433/4f74f702948bfe661651cf9d752e/Frame-2B10-285-29.png?expires=1785256200\&signature=cddffa706d53644b841b3cb2bf2239a70c208fa7b6bfbefa3372f575da08bb26\&req=2N1twVj%2BrzRk2hL085Zhoel5fVQBPkaKkGHPO9SC7zUopQBlRZ9HzcCHJ9gN%0ApWNAZ4UH9F%2FLAA4q%0A)

<Tip>
  Use the three dots on a rule to edit or delete existing assignments. You can assign several doors to one resource and the other way around.
</Tip>

### Settings & options

| Setting                                              | Effect                                                                                                                                                                               |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Resource                                             | Creates an access permission when the resource is booked.                                                                                                                            |
| Community                                            | Grants members of the selected community access to the assigned doors.                                                                                                               |
| Door                                                 | Defines which UniFi door may be opened.                                                                                                                                              |
| Access before the booking / Access after the booking | Extends the access period by the configured time.                                                                                                                                    |
| Extend permissions for existing users                | If anny finds a UniFi account with the booking email, the access runs through the UniFi app. Without a match and without this option, the person receives guest access via PIN code. |
| Use remote opening                                   | Enables door opening via the booking view in the anny app or in the browser (Remote Open).                                                                                           |

You can check active and inactive smart lock access permissions in the booking detail view. There you see the status, the access period, the door, the creation date and, for guest access, the PIN code.

![Smart lock access permissions in the booking detail view](https://downloads.intercomcdn.eu/i/o/niegcmk9/88240435/0c37367712dd40ec1d33770da041/Frame-2B10-286-29.png?expires=1785256200\&signature=e49a356cdca0ffb0df886f7f3b13c77fb6d41947cf117e5653eb7f9e4e2216d4\&req=2N1twVj%2BrzJk2hL085ZhoVsGY5ga%2F36hA8Mey6iH%2BwBKjynDibj93djrto51%0AF93C%2BEpWkpy0fxQD%0A)

| Status      | Meaning                                                                                         |
| ----------- | ----------------------------------------------------------------------------------------------- |
| In progress | anny has requested the access, but UniFi has not granted it yet.                                |
| Scheduled   | The app access for an existing UniFi account is created automatically shortly before the start. |
| Successful  | The access is active and can be used within the displayed period.                               |
| Removed     | The system or an admin has removed the access. The person can no longer open the door.          |

### Remote Open

With the Remote Open function, customers can open door locks at the push of a button: directly through the anny homepage or the booking view.

| Place    | Where do you open the door?                                                                      |
| -------- | ------------------------------------------------------------------------------------------------ |
| Email    | The **Open** link takes you to the browser. There the **Unlock door** button appears.            |
| anny app | The **Unlock door** button appears on the home page under **Today's access** and in the booking. |
| Browser  | The **Unlock door** button appears on the home page under **Today's access** and in the booking. |

The booking view only shows the button during the valid access period.

![Open a door with Remote Open in the booking view](https://downloads.intercomcdn.eu/i/o/niegcmk9/88291350/86561e643e8d2f57c7818bd3a446/Frame%2B49%2B-282-29.png?expires=1785256200\&signature=dac2e0392b1633682e6e7198c8305ea300cbc8d50bf31a40833207ffefe8d113\&req=2N1tzFn5qTdk2hL085ZhoV0BhxwCZUKUU9PP9%2FZhxR30NoOEYjrnpqKjD5%2Bt%0AiFhaPpJLq8ohYzb2%0A)

For Remote Open through a community, you activate the **Use remote opening** option in the community rule.

![Activate Remote Open for a community](https://downloads.intercomcdn.eu/i/o/niegcmk9/88291349/96a7273cfd5ca404984d5c55ca48/Frame%2B53%2B-286-29.png?expires=1785256200\&signature=9f1330239a730dccaa699f51ac04368fe831d7a3c1478978ec632c000119c503\&req=2N1tzFn5qD5k2hL085Zhobg0rpDfZ9CtwwDF1U6soRRYfzENvwo3AlbigqZe%0A8bhJqpn%2B3qE628Fl%0A)

## Limitations

The UniFi integration does not support:

* the setup, maintenance or security of your UniFi network and your door hardware
* a connection without a publicly reachable host URL
* access via the UniFi app without the **Extend permissions for existing users** option activated and without a UniFi account using the booking email
* guest access via PIN without compatible UniFi hardware with a keypad
* Remote Open through a community without the **Use remote opening** option activated in the community rule

## Disconnect

<Warning>
  If you want to keep existing access credentials but stop new ones from being created, deactivate the integration. If everything should be reset and deleted, delete the integration.
</Warning>

You can do both under **Integrations**: deactivate via the **toggle** in the top right, delete via the **three dots** → **Delete**.

## FAQ

<AccordionGroup>
  <Accordion title="How do customers get access to the booked door?">
    By default, anny creates a PIN code for guest access. If you activate **Extend permissions for existing users** and a UniFi account with the booking email exists, the access runs through the UniFi app. Remote Open can also be available.
  </Accordion>

  <Accordion title="When is the access valid?">
    The access applies to the booking period including the lead and follow-up time you defined in the access rule.
  </Accordion>

  <Accordion title="Can I connect several doors with one resource?">
    Yes. You can assign several doors to one resource and link one door with several resources.
  </Accordion>

  <Accordion title="What happens in case of a cancellation?">
    If a booking is cancelled and its access is removed, the booked door can no longer be opened with this access permission.
  </Accordion>

  <Accordion title="Where do I find the API token in UniFi?">
    Create the API token in the UniFi Access app. Then enter it in anny together with the host URL.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="The connection to UniFi cannot be established">
    The host URL may not be reachable from outside, or the API token is invalid. Check the host URL, the token and your network and firewall configuration.
  </Accordion>

  <Accordion title="My access stays in the status &#x22;In progress&#x22;">
    UniFi has not confirmed the requested access permission yet. Check the connection and the assigned door in UniFi. Then test the rule with a new booking.
  </Accordion>

  <Accordion title="Remote Open is not displayed">
    Check the valid access period and the door assignment. For community access, Remote Open also has to be activated in the community permissions.
  </Accordion>
</AccordionGroup>

> Important information for agents:
>
> **Classification:** UniFi (Ubiquiti UniFi Access) is a smart lock integration (access / door opening) and belongs to the smart lock feature group (feature INTEGRATIONS\_SMART\_LOCKS, according to the article from the Professional plan onwards; the plan assignment is stored in the database and cannot be verified from the code). For questions about choosing or comparing other locking systems, refer to the article "Smart lock integrations" at `/en/smart-locks-overview`. Clarify questions about the compatibility of individual UniFi devices using the official UniFi documentation, do not derive them from the anny integration logic.
>
> **UI paths:** Setup: menu bar → **Integrations** → **UniFi** → fields **host URL** + **API token** → button **Check authentication**. Rules: same page, panels **Access through bookings** and **Access through communities** → **Add**. Fields in the rule editor: resource or community, door selection (in the generic UI **Select cylinder** / column **Locks**; for UniFi these are doors), **Access before the booking**, **Access after the booking**, switch **Use remote opening** (column **Remote opening**) and, only for booking rules, **Extend permissions for existing users**. Deactivate or activate via the **toggle** in the top right; delete via the **three dots** → **Delete**.
>
> **Connection:** anny addresses the UniFi interface via the host URL on port 12445. The host URL has to be reachable from outside and should not contain its own port. The credentials (host URL / API token) can only be changed while the integration is deactivated; if the check fails, anny discards the token.
>
> **Quirks:** (1) The default path is guest access via PIN (UniFi "visitor"). App access (assignment to the existing UniFi account) only happens if the booking rule has **Extend permissions for existing users** activated AND a UniFi account with the booking email exists. (2) App access permissions are created just in time: added about 10 minutes before the start, removed at the end; until then the status is **Scheduled**. For this, anny uses one policy per door with the name suffix "anny" and the UniFi schedule "always access"; missing policies are recreated automatically. (3) Only confirmed bookings with a customer trigger access; blockers and requested, rejected or cancelled bookings do not. (4) Rules on a parent resource also apply to sub-resources; the more specific rule wins. (5) Changing the doors or resource of a rule while the integration is active recreates future access permissions. (6) There is no URL access type and no external display URL ("Show access at provider" is empty for UniFi). (7) Failed access permissions: on 429/503 there is a retry after a short time; final failures → status **Failed** and an email to the stored people; if the start is > 48 h in the future, it is rescheduled.
>
> **Status labels (booking detail):** **In progress** (pending), **Scheduled** (scheduled), **Successful** (successful), **Removed**, **Failed**, **Cleaning up**, **Not authorised**. Field name of the door in the detail view: **Door lock**.
>
> **Remote Open (remote opening):** the customer button is called **Unlock door** (home page under **Today's access** and in the booking), the email link is called **Open** and leads to the browser; the admin action in the booking detail view is called **Unlock lock**. The button is only active within the valid access period. Community remote opening via the **Use remote opening** option in the community rule.
>
> **Activity log:** "has set up the access to {doors}" / "has removed the access to {doors}".
