Conditional state reporting as markdown card

I have this card setup:

type: conditional
conditions:
  - condition: or
    conditions:
      - condition: state
        entity: sensor.cph50_charger_state
        state: In Use
  - condition: or
    conditions:
      - condition: state
        entity: sensor.cph50_charger_state
        state: Fully Charged
card:
  type: markdown
  content: |
    {% if states('sensor.cph50_charger_state') == 'Fully Charged' %}
      Fully Charged
    {% elif states('sensor.cph50_charger_state') == 'In Use' %}
      In Use
    {% endif %}
  card_mod:
    style: |
      ha-card {
        {% if states('sensor.cph50_charger_state') == 'Fully Charged' %}
          background-color: #2dce89;
          color: white;
          font-weight: bold; /* Make font bold */
        {% elif states('sensor.cph50_charger_state') == 'In Use' %}
          background-color: #ffd600;
          color: black;
          font-weight: bold; /* Make font bold */
        {% else %}
          background-color: white;
          color: black;
        {% endif %}
      }

For some reason, its not displaying on my dashboard, but i see it fine when i go to edit the dashboard. The current status of the charger is “Fully Charged”. Anyone see what im missing?

Just remove the second - condition: or

What Wally means is that, the way you wrote the conditions, you’re actually asking for sensor.cph50_charger_state to be “In Use” and “Fully Charged”

Thanks Koying,

I tried to figure out the actual meaning of the way the conditions were set up, but I lacked the ability to comprehend it, due to my reliance on Node Red in my own setup. :smiley:

1 Like

Just FYI Conditional cards are always shown in edit mode, regardless of if they pass the condition or not.