A simple Lovelace plugin that automatically redirects users to their default tab when they visit a dashboard.
- Add this repository as a custom repository in HACS
- Install "View Default Tab KNUTS"
- Add the resource to your Lovelace resources
- Download
view-default-tab.js - Place it in your
config/wwwfolder - Add the resource to your Lovelace configuration:
resources:
- url: /local/view-default-tab.js
type: moduleAdd this configuration to your dashboard YAML at the top level, similar to other dashboard features like keep_texts_in_tabs.
- Go to the dashboard in which you want to add the configuration
- Click on the pencil icon located on the top-right corner (
Edit dashboard) - Click on the three dots located on the top-right corner and then click on
Raw configuration editor - Add the configuration at the very beginning of the code
- Go to the dashboard yaml file in which you want to add the configuration
- Add the configuration at the very beginning of the code
view_default_tab:
users:
- username: "john"
default_tab: 1
- username: "mary"
default_tab: 2| Name | Type | Default | Description |
|---|---|---|---|
| users | list | Required | List of user configurations |
| users.username | string | Required | Home Assistant username |
| users.default_tab | number | Required | Tab index to redirect to (0-based) |
- The plugin runs in the background automatically
- When a user opens the dashboard from the menu, it automatically redirects to their default tab
- Only redirects once per page load - users can freely navigate between tabs afterwards
- Users can manually click any tab and stay there without being redirected back
- Only works in view mode, not edit mode
- Reads configuration from dashboard top-level config (like
keep_texts_in_tabs)
- Tab indices are 0-based (first tab = 0, second tab = 1, etc.)
- The plugin only works in view mode, not edit mode
- Redirects only once when opening dashboard from menu
- Users can freely navigate between tabs after the initial redirect
- Works with standard Lovelace dashboards
- Configuration must be at dashboard top-level, not in views or cards