battery-state-card icon indicating copy to clipboard operation
battery-state-card copied to clipboard

Change of icon based on state

Open ilexpl01 opened this issue 8 months ago • 0 comments

Describe what is wrong

I want to have mdi:odnoklassniki icon if state equals "2025.2.0" and mdi:alert-circle-outline if the state is OTHER.

tried code:

icon: "{state|equals(2025.2.0,mdi:odnoklassniki)|not_equals(2025.2.0,mdi:alert-circle-outline)}"

and other but with no luck.

Any advice ?

YAML configuration


# paste your card configuration here

`type: custom:battery-state-card
secondary_info: "{last_changed}"
icon: "{state|equals(2025.2.0,mdi:odnoklassniki)|not_equals(2025.2.0,mdi:alert-circle-outline)}"

filter:
  include:
    - name: entity_id
      value: "*_esphome_version"
  exclude:
    - name: state
      value: Unavailable
sort:
  by: state
  desc: true
bulk_rename:
  - from: ESPHome Version`
**Screenshot**
<!-- Add a screenshot if applicable -->

**Version**
<!-- What is the version of the card? (available in HACS and in browser developer console - Ctrl+Shift+J / F12) -->
3.2.1

ilexpl01 avatar Feb 19 '25 10:02 ilexpl01