Button Icons Farbe Dashboard

Hallo!

Ich möchte die Farbe Icons bei dem Button im Dashboard ändern?

Ist es auch möglich, dass wenn die Entität (input_boolean.markise) eingeschaltet ist, der Button „Markise raus“ grün wird und aus ist grau?

Hier der Code von meiner Karte.

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: tile
        entity: input_boolean.markise_auto
        show_entity_picture: false
        vertical: true
        hide_state: false
        state_content: state
        tap_action:
          action: none
        icon_tap_action:
          action: toggle
        color: green
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: toggle
        entity: input_button.markise_raus
        show_state: false
        icon_height: 30px
        hold_action:
          action: none
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: toggle
        entity: input_button.markise_rein
        show_state: false
        icon_height: 30px
        hold_action:
          action: none

Ich hoffe das mir da wer helfen kann.

Ein Weg wäre mit einer Button Card zu experimentieren.

Ich habe so eine als Badge für angeschaltete Lichter hinterlegt und an diesen Code könntest Du Dich orientieren. Dort ändern sich Farbe und Icon je nach Zustand.

Beispiel_buttoncard

type: custom:button-card
entity: sensor.anzahl_lichter
layout: icon_label
show_label: false
show_name: false
show_state: true
icon: mdi:lightbulb-off
tap_action:
  action: navigate
  navigation_path: /lovelace/xxx
styles:
  card:
    - border-radius: 50px
    - width: 70px
    - height: 40px
    - padding: 0px
    - background-color: var(--card-background-color)
    - box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2)
  icon:
    - width: 20px
    - height: 20px
    - justify-self: center
    - color: gray
  state:
    - font-size: 16px
    - font-weight: 800
    - color: gray
    - align-self: center
  grid:
    - grid-template-areas: '"i s"'
  custom_fields:
    state:
      - align-self: center
      - justify-self: end
state:
  - operator: '>'
    value: 0
    icon: mdi:lightbulb
    styles:
      card:
        - background-color: white
      icon:
        - color: '#FFD930'
      state:
        - color: '#FFD930'

Viel Spaß