#"Badge"/indicator appear on dashboard

1 messages · Page 1 of 1 (latest)

blazing lava
#

not sure if "badge" is the correct term, but like a number in a circle overlay on the icon for the view in a dashboard and the sum for the dashboard in the side pane, like for when settings list an update and such
I'd say the easiest way is going to be to create a template which will give you a sensor entity with a count of the entities that meet your criteria. #templates-archived would be able to help better on that. Scroll/search around in there; I'm sure there's something already mentioned that will set you on the right path for that.

#

Now, what you do with that sensor might be a little bit tricky. I don't think you can have a "badge" or indicator appear on the views tab. However, with that said, I have an indicator "appear" when motion is detected in the living room. A conditional card handles the visibility and some card_mod magic makes the icon appear where I want it. This could give the appearance you're trying to achieve.

#
  - type: custom:mushroom-chips-card
    chips:
      - type: conditional
        conditions:
          - entity: binary_sensor.living_room_motion_detector_on_off
            state: 'on'
        chip:
          type: template
          icon_color: red
          icon: mdi:motion-sensor
          card_mod:
            style: |
              :host {
                position: fixed;
                top: 0px;
                left: 94%;
                z-index: 99;
              }
              ha-card {
                {% if is_state('binary_sensor.living_room_motion_detector_on_off', 'on') %}
                    animation: ping 2s infinite
                {% endif %}
              }
              @keyframes ping {
                0% { box-shadow: inset 0 0 1px 0px rgba(255,0,0, 0.7); }
                100% { box-shadow: inset 0 0 1px 10px transparent; }
              }
          hold_action:
            action: navigate
            navigation_path: /fire-main/sensors```
#

"Badge"/indicator appear on dashboard

#

This code uses Mushroom Cards with the conditional and template chips. The conditional determines "when" the template chip will appear. The card_mod places the icon at the very top of the screen at 94% left, z-index just ensures it stays on top. There is animation around the icon; a red ring pulses around the icon. Pressing and holding the icon will navigate to my sensors view.

#

Instead of using an icon, you could just return the state of the template sensor. (I think this would work; just leave out the icon and icon_color.) javascript - type: template content: '{{ states(entity) }}'

hazy horizon
#

interesting, haven't used Mushroom Cards berofre, so I have to look into that...

#

but seems a bit hacky 😉

blazing lava
#

Definitely hacky. A lot of what I incorporate into my dashboards could be considered hacky... but, I make it do what I want it to do. Once you start using custom cards, it opens up a lot of new possibilities.