Change Card-Color on condition

  - type: button
    tap_action:
      action: none
    entity: binary_sensor.openclose_4
    show_icon: false
    show_state: true
    show_name: true
    hold_action:
      action: none
    icon_height: 65px
    card_mod:
      style: |
        ha-card { 
          background-color: {{ '#AAFFAA' if is_state('binary_sensor.openclose_4', 'on') else '#FFAAAA' }};
        }
9 Likes