I am trying to make a custom mod card for my ceiling fan and want the first button to look more like in the second picture and the speed buttons to turn blue when turned on but i cant find a way how...
type: custom:mod-card
style: |
ha-card {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 12px;
padding: 12px;
}
card:
type: horizontal-stack
cards:
- type: custom:button-card
entity: fan.deckenventilator
icon: mdi:fan
name: Fan
show_state: false
show_icon: true
styles:
card:
- border: 1px solid white
- border-radius: 10px
- height: 40px
- width: 100px
- background-color: transparent
- display: flex
- align-items: center
- justify-content: center
- gap: 8px
icon:
- color: white
- width: 20px
name:
- font-size: 14px
- color: white
state:
- value: "off"
styles:
icon:
- color: white
name:
- color: white
- operator: default
spin: true
styles:
icon:
- color: deepskyblue
name:
- color: deepskyblue
card:
- background-color: rgba(0, 191, 255, 0.2)
- type: custom:button-card
name: "1"
tap_action:
action: call-service
service: fan.set_percentage
service_data:
entity_id: fan.deckenventilator
percentage: 20
state:
- value: 20
operator: "=="
styles:
card:
- background-color: deepskyblue
- color: white
styles:
card:
- border: 1px solid white
- border-radius: 10px
- height: 40px
- width: 40px
- background-color: transparent
name:
- font-size: 14px
- color: white
- type: custom:button-card
name: "2"
tap_action:
action: call-service
service: fan.set_percentage
service_data:
entity_id: fan.deckenventilator
percentage: 33
state:
- value: 33
operator: "=="
styles:
card:
- background-color: deepskyblue
- color: white
styles:
card:
- border: 1px solid white
- border-radius: 10px
- height: 40px
- width: 40px
- background-color: transparent
name:
- font-size: 14px
- color: white
- type: custom:button-card
name: "3"
tap_action:
action: call-service
service: fan.set_percentage
service_data:
entity_id: fan.deckenventilator
percentage: 50
state:
- value: 50
operator: "=="
styles:
card:
- background-color: deepskyblue
- color: white
styles:
card:
- border: 1px solid white
- border-radius: 10px
- height: 40px
- width: 40px
- background-color: transparent
name:
- font-size: 14px
- color: white
the code is too long for the message but the rest looks the same...