Skip to content

imhotep/hass-unifi-access

Repository files navigation

Unifi Access Custom Integration for Home Assistant

  • This is a basic integration of Unifi Access in Home Assistant.
  • If you have Unifi Access set up with UID this will likely NOT work although some people have reported success using the free version of UID.
  • Camera Feeds are currently not offered by the API and therefore NOT supported.

Core integration vs. this HACS integration

Home Assistant now includes a core UniFi Access integration. For most users, the core integration is the recommended starting point.

The core integration has met Home Assistant's Platinum quality requirements and any changes to it are reviewed by Home Assistant core maintainers. This provides stronger long-term stability, consistency with Home Assistant architecture, and better alignment with the Home Assistant entity model.

This HACS integration will continue to be maintained for the foreseeable future. It exists for users who prefer its current behavior, need features that are not yet available in core, or want functionality that does not fit easily into the architectural rules required for Home Assistant core integrations.

In short:

Use the core integration if you want the most official, reviewed, and Home Assistant-native experience. Use this HACS integration if you specifically need one of the differences listed below.

Current differences The core integration uses button entities/actions for door operations. This follows Home Assistant's entity model more strictly, especially because the UniFi Access API does not currently support locking doors. This HACS integration exposes doors as lock entities for convenience. You can unlock/open a door, but locking is unsupported by the UniFi Access API and will only log a warning. The core integration supports auto-discovery. This HACS integration does not. The core integration may require additional Home Assistant helpers/templates or automations for some workflows that this HACS integration exposes more directly.

Supported hardware

  • Unifi Access Hub (UAH) ✅
  • Unifi Access Hub (UAH-DOOR) ✅
  • Unifi Access Intercom (UA-Intercom) ✅
  • Unifi Access G3 Intercom (UA-G3-Intercom) ✅
  • Unifi Access Hub Enterprise (UAH-Ent) ✅
  • Unifi Gate Hub (UGT) ✅
  • Unifi Access Ultra (UA-Ultra) ✅
  • Unifi Access Door Mini (UA-Hub-Door-Mini) ✅

Getting Unifi Access API Token

  • Go to http(s)://{unifi_access_console}/access/settings/system
  • Create a new token and pick all permissions (this is IMPORTANT). At the very least pick: Space, Device and System Log.

Installation (HACS)

  • You can just add this integration to HACS by searching for Unifi Access. If you can't find it, follow the steps below.

  • Add this repository as a custom repository in HACS and install the integration.

  • Restart Home Assistant

  • Add new Integration -> Unifi Access

  • Enter your Unifi Access controller IP or Hostname (default is unifi or UDMPRO). No need to enter port or scheme

  • Enter your API Token that you generated in Unifi Access

  • Select Verify SSL certificate only if you have a valid SSL certificate. For example: If your Unifi Access API server is behind a reverse proxy. Selecting this will fail otherwise.

  • Select Use polling if your Unifi Access version is < 1.90. Default is to use websockets for instantaneous updates and more features.

  • It should find all of your doors and add the following entities for each one

    • Door Position Sensor (binary_sensor). If you don't have one connected, it will always be off (closed).
    • Doorbell Pressed (binary_sensor). Requires Unifi Access Reader Pro G1/G2 otherwise always off. Only appears when Use polling is not selected!
    • Door Lock (lock). You can unlock or open a door, but locking is unsupported and only logs a warning.
    • Event entities (event): Door Event and Doorbell Press. These are only created when Use polling is not selected.

Installation (manual)

  • Clone this repository
  • Copy the custom_components/unifi_access to your config/custom_components folder in Home Assistant.
  • Restart Home Assistant
  • Add new Integration -> Unifi Access
  • Enter your Unifi Access controller IP or Hostname (default is unifi or UDMPRO). No need to enter port
  • Enter your API Token that you generated in Unifi Access
  • Select Verify SSL certificate only if you have a valid SSL certificate. For example: If your Unifi Access API server is behind a reverse proxy. Selecting this will fail otherwise.
  • Select Use polling if your Unifi Access version is < 1.90. Default is to use websockets for instantaneous updates and more features.
  • It should find all of your doors and add the following entities for each one
    • Door Position Sensor (binary_sensor). If you don't have one connected, it will always be off (closed).
    • Doorbell Pressed (binary_sensor). Requires Unifi Access Reader Pro G1/G2 otherwise always off. Only appears when Use polling is not selected!
    • Door Lock (lock). You can unlock or open a door, but locking is unsupported and only logs a warning.
    • Event entities (event): Door Event and Doorbell Press. These are only created when Use polling is not selected.

Events

When websocket mode is enabled (Use polling is not selected), this integration creates two Home Assistant event entities for each door:

  • Door Event
  • Doorbell Press

Doorbell Press

One Doorbell Press entity is created per door. It updates when the integration receives a doorbell start or stop event.

Event types

  • unifi_access_doorbell_start
  • unifi_access_doorbell_stop

Event metadata

  • door_name
  • door_id
  • type

For hardware doorbells, the integration may emit unifi_access_doorbell_stop automatically after a short delay if no explicit stop event is received.

Door Event

One Door Event entity is created per door. It updates whenever the integration receives an access event for that door.

Event types

  • unifi_access_entry
  • unifi_access_exit
  • unifi_access_access (generic access event when the controller does not provide a clear entry/exit direction)

Event metadata

  • door_name
  • door_id
  • actor # the user tied to the event, when available
  • authentication # authentication source reported by the controller
  • method # opened method, when provided by the controller
  • type
  • result # examples: ACCESS, BLOCKED, INCOMPLETE

Warning regarding Door Events

Door events are using an undocumented API. Sadly, in September 2025, the Unifi Access API introduced some bugs that we have worked around but these events are still not 100% reliable depending on your hub. I recommend using the Alarm Manager webhooks if you need a more reliable way to automate based on door events.

Evacuation/Lockdown

The evacuation (unlock all doors) and lockdown (lock all doors) switches apply to all doors and gates and will sound the alarm no matter which configuration you currently have in your terminal settings. The status will not update currently (known issue).

Thumbnail

A thumbnail of when the door is last accessed/locked/unlocked.

Door lock rules (only applies to UAH)

The following entities will be created: input_select, input_number and 2 sensor entities (end time and current rule). You are able to select one of the following rules via the input_select:

  • keep_lock: door is locked indefinitely
  • keep_unlock: door is unlocked indefinitely
  • custom: door is unlocked for a given interval (use the input_number to define how long. Default is 10 minutes).
  • reset: clear all lock rules
  • lock_early: locks the door if it's currently on an unlock schedule.
  • lock_now: locks the door if it's currently on an unlock schedule OR if it's unlocked temporarily via a locking rule.

Example automations

Unlock door

alias: Unlock Front Gate when motion is detected in Entryway
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.entryway_motion_detected
condition: []
action:
  - service: lock.unlock
    data: {}
    target:
      device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
mode: single

Use event as automation trigger

Listen to Unifi Access events and use the event data to send a notification whenever someone accesses a door.

alias: Announce person having opened a Unifi door
description: ""
triggers:
  - platform: event
    event_type: 
      - unifi_access_entry
      - unifi_access_access
variables:
  actor: "{{ trigger.event.data.actor or 'Unknown' }}"
  door_name: "{{ trigger.event.data.door_name or 'Unknown' }}"
actions:
  - action: notify.mobile_app_my_phone
    data:
      title: Door opened
      message: "{{ actor }} has opened {{ door_name }}."
mode: single

API Limitations

The Unifi Access API does NOT support door locking at the moment. You probably already have it set to automatically lock after a small delay anyway.

Removing the integration

  1. Go to Settings → Devices & Services → Unifi Access
  2. Click on the three-dot menu (⋮) on the integration card
  3. Select Delete
  4. Restart Home Assistant
  5. If you installed via HACS you can also uninstall the repository from HACS afterwards

Wishlist

  • door code via service

Troubleshooting

Invalid API Key

You have likely created a Unifi Protect token and you need to create a Unifi Access token

Please create an issue if you have a feature request and pull requests are always welcome!

Support my work

"Buy Me A Coffee"

About

Unifi Access Integration for Home Assistant

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages