- Generate OTP codes with a specified lifetime.
- Automatically delete expired or used OTPs.
- Display current active OTP codes and their expiry times.
- Integrate with Nuki Smart Lock API to manage access.
- Bundled OTP Lovelace card (
ha-otp-card) that is registered automatically — no manual file copying or dashboard resource setup required.
This integration ships a custom Lovelace card, ha-otp-card, that displays a
one-time password with a live countdown ring, grouped digits, tap-to-copy, and
reveal/hide controls. Because the card is bundled with the integration, it is
served and registered as a frontend module automatically on setup — installing
the integration through HACS makes the card available with no extra steps.
Add it to a dashboard like any other card:
type: custom:ha-otp-card
entity: sensor.nuki_otp # read the current code from the OTP sensorThe card can also generate RFC 6238 TOTP codes entirely in the browser from
a base32 secret (secret: option) when you are not reading from an entity. A
visual editor is included, so you can also configure it from the dashboard UI.
If the card does not appear immediately after upgrading, do a hard refresh of the browser (Ctrl/Cmd+Shift+R) to clear the cached frontend bundle.
If you have HACS installed, you can easily add this repository as a custom integration:
- Open HACS in the Home Assistant frontend.
- Navigate to "Integrations" section.
- Click on the "..." button in the top right corner and select "Custom repositories".
- Add the URL of this repository.
- Choose "Integration" as the category and click "Add".
- You should now be able to search for and install the Nuki OTP integration directly through HACS.
To manually install this integration, follow these steps:
- Ensure you have a Home Assistant instance running.
- Download this repository and copy the
custom_components/nuki_otpfolder to thecustom_componentsdirectory of your Home Assistant installation. - Restart Home Assistant to detect the new integration.
After installation, add the integration through the Home Assistant frontend:
- Navigate to
Configuration->Integrations. - Click on the
+ Add Integrationbutton. - Search for
Nuki OTPand select it. - Enter the required configuration details:
- API Token
- API URL
- OTP Username
- Nuki Name
- OTP Lifetime Hours
Once configured, the integration will provide a sensor and a switch within Home Assistant:
- Sensor: Displays the currently active OTP and its expiry time.
- Switch: Allows generating a new OTP or deleting the current one.
If you encounter any issues, check the Home Assistant logs for errors and ensure your configuration details are correct. If problems persist, please report them on the GitHub repository.
This integration uses GitHub releases for version management in HACS. The version in manifest.json is the source of truth.
-
Update version in
manifest.json -
Stage and commit the change:
- Open the Source Control panel (Ctrl+Shift+G or Command+Shift+G)
- Stage the manifest.json change
- Enter commit message: "chore: bump version to X.Y.Z"
- Click the checkmark to commit
-
Push the changes:
- Click the sync button in VSCode
- Or use the Command Palette: "Git: Push"
The GitHub Action will automatically:
- Create a Git tag matching the version
- Create a GitHub release from the tag
- Make the release available in HACS
The automated release process:
- Monitors changes to
manifest.json - When version changes, creates a tag if needed
- Creates a GitHub release if it doesn't exist
- HACS uses the release version for updates
This ensures the version in manifest.json always matches the latest release.
This integration is released under the MIT License.
This integration is not officially affiliated with Nuki and is provided "as is" without warranty of any kind.