Conditional badge: How?

Is it possible to only display a badge only when something is on, for example, a light? The documentation is very vague in explaining. I also tried the suggestions in this thread but it also doesn’t work.

Thank you.

Copy this into your raw config below badges: (remove the [] )


      - type: entity-filter
        entities:
          - entity: light.kugellampe_lang
        state_filter:
          - 'on'

The documentation examples work, but yes, it’s not good enough explained, they should look like this:


# raw config
views:
  - title: Home
    badges:
      - type: entity-filter
        entities:
          - entity: light.bed_light
            name: Bed
          - light.kitchen_lights
          - light.ceiling_lights
        state_filter:
          - "on"


# raw config
views:
  - title: Home
    badges:
      - type: entity-filter
        state_filter:
          - "on"
          - operator: ">"
            value: 90
        entities:
          - sensor.water_leak
          - sensor.outside_temp
          - entity: sensor.humidity_and_temp
            state_filter:
              - operator: ">"
                value: 50
                attribute: humidity


6 Likes