Mushroom chips card conditional entity not showing at all

As a new HA user I’m still struggling a bit with binary_sensors and how to use them in frontend (mushroom) cards.

The binary sensor binary_sensor.afval_ophaaldienst_vandaag has been defined as:

- binary_sensor:
  - name: Afval ophaaldienst vandaag
    unique_id: "afval_ophaaldienst_vandaag"
    state: "{{ states('sensor.afval_vandaag') != 'Geen' }}"
    attributes:
      icon: >
        {% set waste_collection_date = as_datetime(state_attr('sensor.upcoming','upcoming')[0].date) %}
        {% set days_until_collection = (waste_collection_date.date() - now().date()).days %}
        {% if days_until_collection == 0 %}
          {% set icon = state_attr('sensor.upcoming','upcoming')[0].icon %}
        {% else %}
          {% set icon = "mdi:trash-can" %}
        {% endif %}
        {{ icon }}

to function as a simple True/False condition for the the Mushroom Chips Card where a Conditional Entity Chip is used to display the entity (icon), or not:

type: custom:mushroom-chips-card
chips:
  ...
  - type: conditional
    conditions:
      - condition: state
        entity: binary_sensor.afval_ophaaldienst_vandaag
        state: "on"
  ...

With the binary sensor set to on, it still does not show the icon in a Chips Card.

What state does Developer Tools show for your binary sensor?

This is a working Mushroom example

type: custom:mushroom-chips-card
chips:
  - type: conditional
    conditions:
      - condition: state
        entity: binary_sensor.xxxxxxxx
        state: "on"
    chip:
      type: template
      icon: mdi:test-tube
      icon_color: green

The issue most likely is with your template formatting and the sensor’s output

1 Like

I started in the UI editor which does not create this part… another rookie mistake!
Thanks.

1 Like

No worries and happy to assist!