Generate secure login links for Home Assistant to share with your guests.
It's based on the code of @kcsoft, I forked it and I work on it to have one repository and a start date. Other changes are coming
To install Guest Mode using HACS:
- Add this repository as a custom repository in HACS:
- Go to HACS → Integrations → Add Custom Repository.
- Enter the URL of this repository and select Integration as the category.
- Search for "Guest Mode" in HACS and install it.
- Restart Home Assistant.
- Go to Settings → Devices & Services → Add Integration.
- Search for "Guest Mode" and select it.
| Option Name | Description | required | default Value |
|---|---|---|---|
| Tab Icon | Icon for the Guest Mode tab, chosen from 23 MDI icons | No | mdi:shield-key |
| Tab Name | Name of the Guest Mode tab. | No | Guest |
| Path for Admin UI | Custom URL path for accessing the admin interface | No | /guest-mode |
| Login Path | Custom URL path for guest to access the login page | No | /guest-mode/login |
| Copy link directly (skips sharing) | If checked, clicking the share button will copy the link directly to the clipboard instead of opening the native share dialog. | No | Unchecked |
Default User Name (default_user) |
Preselects the user when creating a token. This matches the Home Assistant user's Name field. | No | Empty |
Default Dashboard/View Path (default_dashboard) |
Preselects dashboard or dashboard view when creating a token. Use dashboard or dashboard/view (examples: lovelace-guest, lovelace-guest/entry) and do not include a leading slash. |
No | Empty |
In this version, all configurations are handled exclusively through the Home Assistant interface, allowing users to easily modify options as needed without manual edits.
You can set the link to be active immediately (default mode) or enable a date selector to specify a start date. Additionally, the Home Assistant token is generated only if the guest accesses the link within the defined time frame.
If you want to know whether your guest has used the link, you can check the icon next to the token's name:
- Red: The link has not been used.
- Green: The link has been used, and the Home Assistant token has been created.
I want to share an access with my friends that is valid for a limited time and that they can use to access specific entities in Home Assistant like the fron gate. The access is actually a link to my Home Assistant that can be opened in a browser.
To make this work, I need to make some optional and additional steps (before or after installing Ha Guest Mode):
-
Create a new user in Home Assistant e.g. "guest" (recommended)
-
Set permission, create group e.g. "guests" and add this user this group, and also the devices you want to give access to, e.g. "cover.front_gate". See User Permissions
-
Customize the interface by creating a new View (tab) in the default Lovelace UI and add the entities you want to give access to, e.g. "cover.front_gate", set the visibility to only show to user "guest". (optional)
-
Use Kiosk Mode or Browser Mod to hide unnecessary UI elements for guests, like sidebar. (optional)
You can now generate a secure link to share with your guests.
This integration provides services that can be used in automations.
Creates a new guest mode token.
| Parameter | Description | Required |
|---|---|---|
user_id |
The name of the user to create the token for. | Yes |
token_name |
The name of the token. | No |
expiration_duration |
The duration until the token expires (e.g., '02:00:00'). | No |
expiration_date |
The date when the token expires. | No |
start_date |
The date when the token becomes valid. | No |
dashboard |
The URL path of the desired dashboard (e.g., 'lovelace-guest'). Do not include the leading slash. | No |
Note: If neither expiration_duration nor expiration_date is provided, the token will never expire.
- service: ha_guest_mode.create_token
data:
user_id: "guest"
token_name: "My Guest Token"
expiration_duration: "01:00:00" # 1 hourThis integration creates the following entity:
| Entity ID | Name | Description |
|---|---|---|
image.guest_qr_code |
Guest QR Code | An image entity that displays a QR code for the most recently created guest token. The QR code contains the direct login URL for the guest. The state of the entity will be Ready if a token is available and a QR code has been generated, and No token otherwise. |
-
Removing seconds in UI or Using ha-date-range-picker 🚀
-
Fix timezone in display of the token 🛠️
-
Adding a function to sanitize url for loginPath and path_to_admin_ui 🛠️
-
Improving error handling and code maintainability. 🛠️
If you want this component to support another language, feel free to submit a PR or create an issue. If you open an issue, I’ll gladly handle the translation for you! 😄
See CONTRIBUTORS.md for the full list of contributors.