FAB Card
The FAB Card is a custom Lovelace card for Home Assistant that allows you to place a floating action-button. This card provides a visually appealing way to access common actions or navigate to different parts of your Home Assistant dashboard.
Features:
- Customization: Configure the icons, colors, and positions of the floating button to match your dashboard’s theme.
Installation:
HACS (Home Assistant Community Store)
- Go to HACS page on your Home Assistant instance
- Add this repository (GitHub - bhuebschen/fab-card) via HACS Custom repositories How to add Custom Repositories
- Select
Frontend
- Press add icon and search for
FAB Card
- Select FAB Card repo and install
- Force refresh the Home Assistant page (Ctrl + F5 / (Shift +) ⌘ + R)
- Add fab-card to your page
Manual
- Download the ‘fab-card.js’ from the latest [release][release-url] (with right click, save link as)
- Place the downloaded file on your Home Assistant machine in the
config/www
folder (when there is nowww
folder in the folder where yourconfiguration.yaml
file is, create it and place the file there) - In Home Assistant go to
Configuration->Lovelace Dashboards->Resources
(When there is noresources
tag on theLovelace Dashboard
page, enable advanced mode in your account settings, and retry this step) - Add a new resource
- Url =
/local/fab-card.js.js
- Resource type =
module
- Url =
- Force refresh the Home Assistant page (Ctrl + F5 / (Shift +) ⌘ + R)
- Add fab-card to your page
Configuration:
Here’s an example configuration for the FAB Card:
type: 'custom:fab-card'
button_color: '#FF5722'
icon_color: '#FFFFFF'
active_color: '#2257FF'
icon: 'mdi:menu'
action:
action: navigate
navigation_path: '/lovelace/1'
# Example for service call:
# action:
# action: call-service
# service: light.turn_on
# service_data:
# entity_id: light.living_room
entity: light.living_room
positive_states:
- 'on'
- 'home'
left: false
Options:
Options
Name | Type | Requirement | Description | Default |
---|---|---|---|---|
type | string | Required | custom:fab-card |
|
button_color | string | Optional | Background color of the button | --primary-color |
icon_color | string | Optional | Color of the icon | --text-primary-color |
active_color | string | Optional | Background color of the button when active | --accent-color |
icon | string | Required | Icon to display on the FAB button | mdi:menu |
action | object | Required | Action to perform when the button is clicked | |
action.action | string | Required | Type of action (navigate , call-service , etc.) |
|
action.navigation_path | string | Optional | Path to navigate to (required if action is navigate ) |
|
action.service | string | Optional | Service to call (required if action is call-service ) |
|
action.service_data | object | Optional | Data to include with the service call (required if action is call-service ) |
|
entity | string | Optional | Entity to monitor for state changes | |
positive_states | list | Optional | List of states considered positive | ['true', 'on', 'open', 'active', 'detected', 'occupied', 'unlocked', 'home', 'above_horizon', 'ready'] |
left | boolean | Optional | Position the button on the left side | false |
Usage:
After installation, you can add the fab-card to your Lovelace dashboard using the sample configuration provided above. Customize the card by setting the desired options in your YAML configuration
Issues & Contributions:
If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.