Dummy entities as icon for Lovelace Navigation Actions

I want to use glance cards as navigation menus. To achieve this require entities to be created . I am using an input boolean entity , but this is messy . Double click reveals a switch.

Could we have single blank entity that does nothing, but in lovelace I can add it to cards that support navigation actions and icons . This would be much simpler and cleaner than creating input boolean

Just create a script that creates an event and use that single entity for everything. Or use the button card where the entity is not required.

script:
  buttonpress:
    sequence:
    - event: ButtonPress
      event_data:
        button: buttonpress

Then if you wanted, you could create actions off that. But using in glance…

type:glance
entities:
- entity: script.buttonpress
  icon: ...
  tap_action:
    action: navigate
    navigation_path: /lovelace/0
- entity: script.buttonpress
  icon: ...
  tap_action:
    action: navigate
    navigation_path: /lovelace/1

Also, before I forget, there’s a demo platform and it creates all sorts of fake entities

The best I can get is to create a an input_boolean.

icon:
  initial: off

then in Lovelace create this

- type: glance 
        columns: 4
        entities:
          - entity: input_boolean.icon
            name: Living Room
            show_state: false
            icon: mdi:sofa
            tap_action: 
              action: navigate
              navigation_path: /lovelace/livingroom
            double_tap_action:
              action: none
            hold_action:
              action: none

The above is for one icon to navigate to another view. It would be much simpler with a dummy entity icon . Then I would not have to code for double tap and hold and hide state. It gets a little long winded.

It seems a simple change . It would also allow for a momentary switch in Lovelace as you can also call a service rather than navigate action.

and if you use the script I posted above, it shortens your code to for any button.

      - type: glance 
        columns: 4
        entities:
          - entity: script.buttonpress
            name: Living Room
            icon: mdi:sofa
            tap_action: 
              action: navigate
              navigation_path: /lovelace/livingroom
            double_tap_action:
              action: none
            hold_action:
              action: none

Mind you, with your proposed change, the configuration would be the same number of lines

      - type: glance 
        columns: 4
        entities:
          - type: icon
            name: Living Room
            icon: mdi:sofa
            tap_action: 
              action: navigate
              navigation_path: /lovelace/livingroom
            double_tap_action:
              action: none
            hold_action:
              action: none

No the idea is the blank entity or icon has no secondary info or state so that will not need to suppressed
so I save 5 lines and an input boolean I don’t have to define. I have a Glance card with 12 icons that’s 60 lines

As I said it a small change, but makes sense

Yes, the script doesn’t need to have it’s state suppressed. Scripts are stateless when you don’t have a delay. You don’t need any of that extra secondary info, i’m not sure why you’re adding it… It would only be the bare minimum required per entity in a glace is:

          - entity: script.buttonpress
            name: Living Room
            icon: mdi:sofa
            tap_action: 
              action: navigate
              navigation_path: /lovelace/livingroom

vs your proposal (same number of lines)

          - type: icon
            name: Living Room
            icon: mdi:sofa
            tap_action: 
              action: navigate
              navigation_path: /lovelace/livingroom

tap_action is always needed, they aren’t going to break yaml format for 1 new call.

Both script and input_boolean have a secondary popup screen that need to be suppressed in lovelove if you double tap or hold the icon, hence the extra lines to suppress hold and double tap

Using a script or any entity as a dummy is a good workaround and works fine . It just a “cludge” and just looks odd, as I said not the end of world , but the proposed code does look neater , like your idea of just using the icon: instead of entity: :slight_smile:

Well it has to conform with current Lovelace standard. Also, you should vote for your own wth

True I should . Thank you :slight_smile: