Change icon by state Lovelace

For the record, I found the “state_icons” to not work in my lovelace UI. But the following worked well:

              - type: custom:button-card
                template: bootstrap_button
                class: col-xl-2 col-lg-2 col-md-3 col-sm-3 col-4
                entity: group.opening
                state:
                  - value: 'on'
                    color: gold
                    icon: "mdi:door-open"
                  - value: 'off'
                    color: var(--text-color)
                    icon: "mdi:door"
1 Like