Circular Menu - Lovelace

Circle Menu Card

preview

The Circle Menu Card is a custom Lovelace card for Home Assistant that allows you to create a circular menu of actions or shortcuts. 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 and menu items to match your dashboard’s theme.
  • Multiple Actions: Each menu item can perform various actions, such as toggling lights, controlling media players, or navigating to specific dashboards.
  • Responsive Design: The circular menu adjusts its position based on the configuration, ensuring compatibility with different screen sizes and layouts.

Installation:

HACS (Home Assistant Community Store)

  1. Go to HACS page on your Home Assistant instance
  2. Add this repository (GitHub - bhuebschen/circle-menu-card: Allows you to create a circular menu with actions or shortcuts that can be accessed via a floating button in the bottom corner.) via HACS Custom repositories How to add Custom Repositories
  3. Select Frontend
  4. Press add icon and search for Circle Menu Card
  5. Select Circle Menu Card repo and install
  6. Force refresh the Home Assistant page (Ctrl + F5 / (Shift +) + R)
  7. Add circle-menu-card to your page

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual

  1. Download the ‘circle-menu-card.js’ from the latest [release][release-url] (with right click, save link as)
  2. Place the downloaded file on your Home Assistant machine in the config/www folder (when there is no www folder in the folder where your configuration.yaml file is, create it and place the file there)
  3. In Home Assistant go to Configuration->Lovelace Dashboards->Resources (When there is no resources tag on the Lovelace Dashboard page, enable advanced mode in your account settings, and retry this step)
  4. Add a new resource
    1. Url = /local/circle-menu-card.js
    2. Resource type = module
  5. Force refresh the Home Assistant page (Ctrl + F5 / (Shift +) + R)
  6. Add circle-menu-card to your page

Configuration:

Here’s an example configuration for the Circle Menu Card:

type: 'custom:circle-menu-card'
left: true # Position the menu on the left
icon: 'mdi:menu' # Floating button icon
button_color: '#3498db' # Button background color
icon_color: 'white' # Icon color
menu_background_color: '#3498db' # Menu background color
items:
  - icon: mdi:lightbulb
    alt: Lights on...
    action:
      action: call-service
      service: light.turn_on
      service_data:
        entity_id: light.living_room
  - icon: mdi:thermometer
    alt: Default Dashboard
    action:
      action: navigate
      navigation_path: /lovelace/0
  - icon: mdi:music
    alt: Music Control
    action:
      action: call-service
      service: media_player.media_play_pause
      service_data:
        entity_id: media_player.living_room
  - icon: mdi:fan
    alt: Fan Control
    action:
      action: call-service
      service: fan.turn_on
      service_data:
        entity_id: fan.living_room
  # Up to 4 menu items...

Options:

Name Description Default Value
left Whether to position the menu on the left side of the screen false
icon The icon to be displayed on the floating button 'mdi:menu'
button_color Background color of the floating button var(–primary-color)
icon_color Color of the icon on the floating button var(–text-primary-color)
menu_background_color Background color of the menu var(–primary-color)
auto_close Closes the menu after a timeout in milliseconds ``
json_config Load an external json-file with the menu and items configuration ``
item_active_color When using call_service, this defines the background color of a menu item whose destination entity is ‘positive’. var(–accent-color)
positive_states Defines an array of ‘positive’ states for entities to be highlighted. ‘true’, ‘on’, ‘open’, ‘active’, ‘detected’, ‘occupied’, ‘unlocked’, ‘home’, ‘above_horizon’, ‘ready’
json_config Load an external json-file with the menu and items configuration ``
items Array of menu items. Each item should contain icon, alt, and action properties. []
items[].icon Icon for the menu item ''
items[].alt Alt text for the menu item ''
items[].action Action to be performed when the menu item is clicked. Can be either 'navigate' or 'call-service'. ''
items[].action.navigation_path Path to navigate to if action is 'navigate' ''
items[].action.service Service to call if action is 'call-service' ''
items[].action.service_data Service data to pass if action is 'call-service' {}

Usage:

  1. Clicking the floating button toggles the visibility of the circular menu.
  2. Each menu item performs a predefined action, such as controlling devices or navigating to other dashboards.

Global configuration:

You can store the configuration in a JSON file to provide a global setup for all menus. Use json_config to load the configuration into the circle-menu-card instance.

18 Likes

Seems nice.

The configuration i believe will need to be placed in the Raw Configuration Editor under each view right?

Thanks

Oh, wow, this is truly amazing!

Hi Michail,

you can find the card now in the card-list … and an small sample is also provided when adding it to a dashboard.

You can add the card everywhere, because it does not require any space

Great, i just updated and i confirm i can find it! It also works flawlesly!

1.0.2

  • Menu item positions are now calculated.
  • Clicking outside the menu now closes it.
  • The floating button now displays an “x” to indicate the close behavior upon clicking.
  • Default colors now follow the theme-based colors.
  • Added the “auto-close on timeout” feature (thanks to @ngocjohn).
1 Like

1.0.3

  • Menu items can show the state of an entity
  • ‘positive’ entities can have a custom color
  • Configuration can be stored in /www and loaded with ‘json_config’.
  • ‘Visual Editor’ shows JSON-Configuration.
  • ‘positive States’ can be customized

I am struggling with the global config via JSON file.
I have created „circularmenu.json“ in /www and added „json_config: circularmenu.json“ in the card config (removing everything else) but nothing does show up.
Can somebody post an example so that I can compare what I do wrong!?
Thanks!

Please try: json_config: /local/circularmenu.json

Yes, that helped!

Danke!

Can you explain and have example how to get this card for all menu ?
Thanks

you still need to add the element to your dashboards/subdashboards… but you dont have to provide the whole configuration to every instance, you can save the config to a json file and provide it via json_config

Hi there, I have been looking for FAB related posts because I’m trying to merge the design benefits of a FAB with a sticky bottom navigation bar. This card that you designed is the closest and cleanest implementation of anything close to what I’m thinking.

type: vertical-stack
cards:
  - type: conditional
    conditions:
      - entity: input_boolean.nav_menu_open
        state: "off"
    card:
      type: custom:mod-card
      card_mod:
        style: |
          ha-card {
            z-index: 5;
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 56px;
            height: 56px;
            background: #7d4bff;
            border-radius: 28px;
            box-shadow: 0 3px 8px rgba(0,0,0,0.4);
            transition: all 0.3s ease-in-out;
            animation: fab-in 0.3s ease-in-out;
          }
          @keyframes fab-in {
            0% {
              transform: scale(0);
              opacity: 0;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
      card:
        type: custom:button-card
        icon: mdi:plus
        tap_action:
          action: call-service
          service: input_boolean.turn_on
          service_data:
            entity_id: input_boolean.nav_menu_open
        styles:
          icon:
            - width: 28px
            - color: white
          img_cell:
            - width: 56px
            - height: 56px
          card:
            - background: none
            - padding: 0
            - display: flex
            - justify-content: center
            - align-items: center
  
  - type: conditional
    conditions:
      - entity: input_boolean.nav_menu_open
        state: "on"
    card:
      type: custom:mod-card
      card_mod:
        style: |
          @media (min-width:180px) {
            ha-card {
              z-index: 5;
              position: fixed;
              bottom: 10px;
              left: 10px;
              width: calc(100% - 20px);
              background: black;
              border-radius: 100px;
              padding: 10px;
              box-shadow: 0 3px 8px rgba(0,0,0,0.4);
              transition: all 0.3s ease-in-out;
              animation: navbar-in 0.3s ease-in-out;
            }
          }
          @media (min-width:800px) {
            ha-card {
              width: calc(60% - 30px);
              left: calc(20% + 43px);
            }
          }
          @keyframes navbar-in {
            0% {
              transform: translateX(50px) scale(0.5);
              opacity: 0;
              width: 56px;
              right: 20px;
              left: auto;
              border-radius: 28px;
            }
            100% {
              transform: translateX(0) scale(1);
              opacity: 1;
            }
          }
      card:
        type: grid
        square: false
        columns: 5
        cards:
          - type: custom:button-card
            icon: mdi:vacuum
            tap_action:
              action: navigate
              navigation_path: '#vacuum'
            styles:
              icon:
                - width: 24px
                - color: white
              img_cell:
                - width: 50px
                - height: 50px
              card:
                - background: none
                - padding: 0
          - type: custom:button-card
            icon: mdi:power-plug
            tap_action:
              action: navigate
              navigation_path: '#electricity'
            styles:
              icon:
                - width: 24px
                - color: white
              img_cell:
                - width: 50px
                - height: 50px
              card:
                - background: none
                - padding: 0
          - type: custom:button-card
            icon: mdi:car
            tap_action:
              action: navigate
              navigation_path: '#var'
            styles:
              icon:
                - width: 24px
                - color: white
              img_cell:
                - width: 50px
                - height: 50px
              card:
                - background: none
                - padding: 0
          - type: custom:button-card
            icon: mdi:server
            tap_action:
              action: navigate
              navigation_path: '#server'
            styles:
              icon:
                - width: 24px
                - color: white
              img_cell:
                - width: 50px
                - height: 50px
              card:
                - background: none
                - padding: 0
          - type: custom:button-card
            icon: mdi:menu
            tap_action:
              action: call-service
              service: input_boolean.turn_off
              service_data:
                entity_id: input_boolean.nav_menu_open
            styles:
              icon:
                - width: 24px
                - color: white
              img_cell:
                - width: 50px
                - height: 50px
              card:
                - background: none
                - padding: 0

I have followed the youtube channel My Smart Homes tutorial for a sticky navigation menu and played with it a bit but I still don’t think its smooth enough. What I was trying to do was get the FAB to fade/morph/change/expand into the sticky navigation bar and if I wanted to collapse it back just click the far right button.

Is there anything you might change or tweak to make it function more closely to what you’ve done here but still be a nav bar for mobile devices? I’m getting to the desperate stage of my trying things.

This might suit you better: GitHub - bhuebschen/fab-card: The FAB Card is a custom Lovelace card for Home Assistant that allows you to place a floating action-button.

1 Like

I am very novice at CSS and I have you fab card already added. I guess what I was looking for was if you could refactor your animated circle one to be a better version of what I’m trying to do since your approach is obviously way cleaner since you wrote JS to do the heavy lifting and I hacked mine together with janky CSS. Here’s a video of it in action.

ah, now i know what you mean.

Actually, I’ve thought about making a menu like this before… but I thought there were already such.

If you give me some time, I’ll build one. I’m currently moving, so I’m a little short on time.

Lovely card however I’m seeing a ‘X’ (partially cut off) below my circle menu when viewing on mobile …

Any idea on how to remove it?

I am a full time dad and get VERY little nerd time anymore, and even less time where its optimal for brain work, so if you can work on this, and I can maybe beta test it with you or give you feedback so I can integrate this directly into my project, I would be SUPER grateful. Thank you for being receptive at the least and good luck with the move!

Thats a strange issue. But cool layout! how did you do the people buttons with status icons?

Hey there!

Here’s the YAML for the top ‘Welcome’ card … Home Assistant | Mobile Welcome Card - Pastebin.com