Skip to content

Instantly share code, notes, and snippets.

@mathieucarbou
Last active February 19, 2024 14:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathieucarbou/bc0181dc3517297071f3bc7b944b05a6 to your computer and use it in GitHub Desktop.
Save mathieucarbou/bc0181dc3517297071f3bc7b944b05a6 to your computer and use it in GitHub Desktop.
Tempo colored icons with RTE

Tempo colored icons with RTE

image

Edit view:

image

Code:

type: conditional
conditions:
  - condition: state
    entity: sensor.rte_tempo_couleur_actuelle
    state_not: unavailable
card:
  type: vertical-stack
  cards:
    - type: conditional
      conditions:
        - condition: state
          entity: sensor.rte_tempo_couleur_actuelle
          state: Bleu
      card:
        type: custom:mushroom-entity-card
        entity: sensor.rte_tempo_couleur_actuelle
        icon: mdi:traffic-light-outline
        name: Aujourd'hui
        icon_color: blue
    - type: conditional
      conditions:
        - condition: state
          entity: sensor.rte_tempo_couleur_actuelle
          state: Blanc
      card:
        type: custom:mushroom-entity-card
        entity: sensor.rte_tempo_couleur_actuelle
        icon: mdi:traffic-light-outline
        name: Aujourd'hui
        icon_color: white
    - type: conditional
      conditions:
        - condition: state
          entity: sensor.rte_tempo_couleur_actuelle
          state: Rouge
      card:
        type: custom:mushroom-entity-card
        entity: sensor.rte_tempo_couleur_actuelle
        icon: mdi:traffic-light-outline
        name: Aujourd'hui
        icon_color: red
    - type: conditional
      conditions:
        - condition: state
          entity: sensor.rte_tempo_couleur_actuelle
          state: Inconnu
      card:
        type: custom:mushroom-entity-card
        entity: sensor.rte_tempo_couleur_actuelle
        icon: mdi:recycle
        name: Aujourd'hui
        icon_color: yellow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment