All Collections
Integrations
Home Assistant & LOQED integration
Home Assistant & LOQED integration
Updated over a week ago

Control you LOQED Touch Smart Lock with Home Assistant (HASS).

Supported features

  • Lock/Unlock/open your LOQED Touch Smart Lock

  • Take actions when the lock is locked/unlocked/opened.

  • Last used "local key id" when then lock is locked/unlocked/opened. Each ID corresponds to a unique LOQED key. Note that when you delete a key and create a new one, local key ids are re-used.
    Future: the LOQED cloud API can connect a user's email address to a local key ID, but this feature is not yet available in the integration.

The integration was created by the community and is not officially supported by LOQED. However, we do intent to help you if you have any questions.

Security

  • This integration uses the local bridge API. During the setup process, the web API is used to create a key. The web API will not store your key.

  • When the LOQED Bridge sends a status update to HASS, it includes a digital signature. Even if an unsecure connection (non-HTTPS) is used, as is usually the case on an internal network, this means the information cannot be altered (but the contents can be read).

Installation

1. Ensure you are running at least Home Assistant 2023.7.0

This version supports 'opening', 'unlocking' and 'locking' a lock (instead of just 'unlocking' and 'locking'), and has support for LOQED.

2. Ensure no old webhooks in the LOQED Bridge exist

Did you have a previous install of any kind of integration and LOQED? Then please ensure there are no old webhooks set in the LOQED Bridge, pointing to an old HASS installation. This could make receiving status update from the lock slower or not working at all. Simply login on app.loqed.com, go the the heading "Outgoing Webhooks via LOQED Bridge", and click the button next to the bridge. If you see a warning about CORS network policy, temporarily disable this flag in your browser, restart your browser, and try again. Then, delete all the webhooks you see. Now the bridge is free of webhooks and you can install the HASS integration again, which will create one new entry.

Below is a screenshot of a LOQED Bridge with one webhook entry (as it should be, after the LOQED integration for HASS is properly installed).

3. Ensure your Home Assistant URLs are properly set

When the lock status changes, the LOQED Bridge posts data to your Home Assistant URL. The integration prefers the internal URL over de external one. You can set the URLs on the Settings -> System -> Network, under the heading "Home Assistant URL".

In case a HTTPS is URL is used, the LOQED Bridge validates the certificate (be sure it is valid!). The integration always verifies a digital signature of the data that the bridge posts, thus even if an unsecure connection is used, nobody can send fake data to HASS about the door's status.

With the below settings (Home Assistant version 2023.6.3), the integrations will use "http://homeassistant.local:8123" as URL. If you set "Local Network" to automatic, the integration uses 'https://MYSUB.duckdns.org' (which does not seem logical to us either).

⚠️ If you use HTTPS, we highly recommend you use the "NGINX Home Assistant SSL proxy" with "Let's Encrypt". If you install TLS certificates without using a proxy server, the internal HASS URL will also use the TLS certificates, but since the internal hostname is not on the TLS certificate, the LOQED Bridge will not connect for security reasons. TLDR; ensure you can connect to your internal hostname without any TLS certificate warnings (thus, without HTTPS).

4. Generate a personal access token

On the LOQED personal access token website, please follow the following steps:

  1. Login with your LOQED App e-mail address (you need to be admin)

  2. Tap on "Create"

  3. Give your personal access token a name (this will not be used further on, but we recommend something like "Home Assistant" to be able to recognize it as used by Home Assistant)

  4. Tap on Save

  5. Store the access token somewhere you can easily copy/paste from as you'll need them in the next step (and it will only be shown once). Note that you can use this token for setting up multiple locks.
    Ensure to copy paste the full token! Double clicking sometimes only copies a part of the token.

5. Reboot Home Assistant

The easiest way to install the integration is to reboot HASS after the installation (so, you are rebooting multiple times). HASS will automatically detect the LOQED Bridge (using Zero Conf) if it is within your local network. The integration currently does not support bridges outside your local network.

6. Configure the Home Assistant integration

Go to "Settings" -> "Devices & Serivces". Click the "configure" button of the automatically detected smart lock. Provide the personal access token from previous step.

Not recommended: If you want to install this integration without a reboot, you need to enter the key name of your lock exactly as shown in the lock list of the LOQED App (note: this is not the name of the lock for administrators, it is the name you choose for yourself and is on the very first screen of the LOQED App).

You can also set up a lock manually when for some reason it is not automatically detected. In that case you need to provide both the API Key from the previous step and the name of the Lock as it is known in the LOQED companion app.

More information

Debugging

First, test if your personal access token works

  1. Enter "https://integrations.production.loqed.com/api/locks/" as URL with the "GET" method.

  2. Enter "Authorization: Bearer YOUR-TOKEN-HERE" as authorization token. Of course, replace the word "YOUR-TOKEN-HERE" with your token.

  3. Press "Send". You should get back an array with data such as in the screenshot below.

Debugging in Home Assistant

Enable logging:

service: logger.set_level
data:
homeassistant.components.loqed: debug
loqedAPI: debug
Did this answer your question?