Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Icon color based on state/value #292

Answered by damaro241
damaro241 asked this question in Q&A
Discussion options

You must be logged in to vote

Figured out the template, looks like you need to also specify the icon, not just the color:
type: custom:room-card
hide_title: true
templates:

  • name: defaultsecuritydoor
    template:
    show_icon: true
    tap_action:
    action: more-info
    hold_action:
    action: more-info
    icon:
    conditions:
    - icon: mdi:door-open
    condition: equals
    value: 'on'
    styles:
    color: red
    - icon: mdi:door-closed
    condition: equals
    value: 'off'
    styles:
    color: green
  • name: defaultsecuritywindow
    template:
    show_icon: true
    tap_action:
    action: more-info
    hold_action:
    action: more-info
    icon:
    conditions:
    - icon: mdi:window-open
    condition: equals
    value: 'on'
    styles:
    color: red
    - icon: mdi:window-closed
    condition: equals
    value: 'off'
    styles:
    colo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by damaro241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant