[unifiaccess] Unifi access binding initial contribution #19412
[unifiaccess] Unifi access binding initial contribution #19412digitaldan wants to merge 11 commits intoopenhab:mainfrom
Conversation
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
There was a problem hiding this comment.
Pull Request Overview
Initial contribution of a new UniFi Access binding integrating Ubiquiti UniFi Access controllers, doors and devices into openHAB, including discovery, channel definitions, handlers, API client, and documentation.
- Adds new bundle org.openhab.binding.unifiaccess with thing types, handlers, DTOs, API client, discovery, i18n, feature, README, and BOM / aggregator references.
- Introduces WebSocket-based live event handling (doorbell, access attempts, logs) and REST interactions (lock control, device access method configuration).
- Provides i18n resources and documentation, though some naming/branding and translation duplication issues are present.
Reviewed Changes
Copilot reviewed 45 out of 48 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/pom.xml | Adds unifiaccess module and formatting change to root POM (one-line collapse). |
| org.openhab.binding.unifiaccess/.../thing-types.xml | Defines bridge, door, and device thing and channel types. |
| unifiaccess.properties | Adds i18n labels (some duplication & branding inconsistencies). |
| addon.xml | Declares addon metadata (branding inconsistency). |
| Multiple handler Java classes | Implements bridge, door, and device handlers; several silent exception swallows and incomplete state updates. |
| UniFiAccessApiClient.java | Implements REST/WebSocket client (potential NPE in media type logging). |
| DTO classes | Data models for API (mostly straightforward POJOs). |
| Binding constants / factory / discovery | Wiring for thing creation and discovery. |
| feature.xml | Karaf feature for new binding. |
| BOM & CODEOWNERS | Registers new binding in build and ownership. |
| README.md | User documentation (branding mismatches & incorrect product name in examples). |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bundles/org.openhab.binding.unifiaccess/src/main/resources/OH-INF/i18n/unifiaccess.properties
Show resolved
Hide resolved
bundles/org.openhab.binding.unifiaccess/src/main/resources/OH-INF/i18n/unifiaccess.properties
Outdated
Show resolved
Hide resolved
...s/src/main/java/org/openhab/binding/unifiaccess/internal/handler/UnifiAccessDoorHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/unifiaccess/internal/handler/UnifiAccessDeviceHandler.java
Show resolved
Hide resolved
bundles/org.openhab.binding.unifiaccess/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
...iaccess/src/main/java/org/openhab/binding/unifiaccess/internal/api/UniFiAccessApiClient.java
Show resolved
Hide resolved
...iaccess/src/main/java/org/openhab/binding/unifiaccess/internal/api/UniFiAccessApiClient.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 46 out of 49 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bundles/org.openhab.binding.unifiaccess/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
bundles/org.openhab.binding.unifiaccess/src/main/resources/OH-INF/i18n/unifiaccess.properties
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/unifiaccess/internal/handler/UnifiAccessDeviceHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
lsiepel
left a comment
There was a problem hiding this comment.
Picked up the review of this binding. Will continue when these are fixed. Looked at all files except the handlers and apiclient.
|  | ||
|
|
There was a problem hiding this comment.
Logo can be added afterwards. Please remove from the docs here.
| - `unifiaccess:bridge` (Bridge): The UniFi Access controller instance. | ||
| Required to discover and manage door things. | ||
| - `unifiaccess:door`: A UniFi Access door with status and control channels. | ||
| - `unifiaccess:device`: A UniFi Access device (reader, hub, or camera) with device-level status and controls. |
There was a problem hiding this comment.
no need to add the binding id.
| - `unifiaccess:bridge` (Bridge): The UniFi Access controller instance. | |
| Required to discover and manage door things. | |
| - `unifiaccess:door`: A UniFi Access door with status and control channels. | |
| - `unifiaccess:device`: A UniFi Access device (reader, hub, or camera) with device-level status and controls. | |
| - `bridge` (Bridge): The UniFi Access controller instance. | |
| Required to discover and manage door things. | |
| - `door`: A UniFi Access door with status and control channels. | |
| - `device`: A UniFi Access device (reader, hub, or camera) with device-level status and controls. |
| ## Discovery | ||
|
|
||
| - Add the `Bridge` by entering the controller Hostname or IP and an API Token. | ||
| - Once the Bridge is ONLINE, Doors are discovered automatically and appear in the Inbox. |
There was a problem hiding this comment.
| - Once the Bridge is ONLINE, Doors are discovered automatically and appear in the Inbox. | |
| - Once the `bridge` is ONLINE, `door`s are discovered automatically and appear in the Inbox. |
|
|
||
| ## Thing Configuration | ||
|
|
||
| ### Bridge `unifiaccess:bridge` |
There was a problem hiding this comment.
Also check other places
| ### Bridge `unifiaccess:bridge` | |
| ### Bridge `bridge` |
| | door-sensor | Contact | R | Door position sensor. | | ||
| | doorbell-contact | Contact | R | Doorbell contact. | | ||
|
|
||
|
|
| <channel-type id="face-detect-distance"> | ||
| <item-type>String</item-type> | ||
| <label>Face Detect Distance</label> | ||
| <description>Face Detect Distance</description> |
There was a problem hiding this comment.
Applies to all channel type descriptions. Either make the description a good description (add value) or remove it. It should not be a copy of the label.
| <label>Emergency Status</label> | ||
| <description>Emergency Status</description> | ||
| <category>Alarm</category> | ||
| <state> |
There was a problem hiding this comment.
Applies to all channel types, consider marking them readOnly="true" where appropiate.
| <item-type>DateTime</item-type> | ||
| <label>Last Unlock</label> | ||
| <category>Time</category> | ||
| <state readOnly="true"/> |
| <type>binding</type> | ||
| <name>UnifiAccess Binding</name> | ||
| <description>This is the binding for UnifiAccess.</description> | ||
|
|
There was a problem hiding this comment.
Can you add the connection tag ?
Does the controller announce itself on mDNS? Or any other mechanism that can be used for the binding suggestion finder ?
|
|
||
| <type>binding</type> | ||
| <name>UnifiAccess Binding</name> | ||
| <description>This is the binding for UnifiAccess.</description> |
There was a problem hiding this comment.
Not wrong, but can use a better description.
This binding integrates Ubiquiti UniFi Access with openHAB. It connects to your UniFi Access controller over HTTPS and listens for live door events while exposing channels to monitor and control door locks.
This is very WIP as i only have a door hub right now to test with, i'm waiting for the G6 Pro Entry to be released in the next couple months to get a full working access system.