Hoping someone can help! I am trying to modify the button card using card-modder for my themostats so that it looks more like the Homekit button. From this:
To this (sort of):
Essentially the circle is the icon enlarged and moved, which changes colour based on state, and the number inside it is the temperature attribute of the climate entity. The current icon changes colour, I just need to reposition it, enlarge it and add the attribute within it.
My code for the buttons is:
- type: custom:decluttering-card
template: switch_button_card_flat
variables:
- entity: climate.air_conditioner
- name: Main AC
- icon: circle
- color: DodgerBlue
- tap_action:
action: more-info
haptic: light
And the decluttering card is (thanks to jimz01 homekit theme!):
switch_button_card_flat:
default:
- size: 25%
- lock: false
- color: auto
- background_color: var(–homekit)
- variable: spin
- spin: false
- show_name: true
- show_state: true
- show_label: true
- show_icon: true
- show_last_changed: false
- tap_action:
action: toggle
haptic: light
- hold_action:
action: more-info
haptic: success
- aspect_ratio: 3/1
- margin-left: 0px
- margin-right: 60px
- label: ’ ’
- opacity: 0.4
- off_icon_color: gray
- off_name_color: gray
- off_state_color: gray- icon_height: 120px
- icon_width: 120px
card:
type: custom:button-card
name: ‘[[name]]’
icon: ‘mdi:[[icon]]’
size: ‘[[size]]’
color: ‘[[color]]’
lock: ‘[[lock]]’
aspect_ratio: ‘[[aspect_ratio]]’
entity: ‘[[entity]]’
label: ‘[[label]]’
show_name: ‘[[show_name]]’
show_icon: ‘[[show_icon]]’
show_state: ‘[[show_state]]’
show_label: ‘[[show_label]]’
show_last_changed: ‘[[show_last_changed]]’
tap_action: ‘[[tap_action]]’
hold_action: ‘[[hold_action]]’
styles:
card:
- border-radius: 12px
- --paper-card-background-color: ‘[[background_color]]’
label:
- color: gray
- font-size: 11px- font-family: Helvetica
- padding: 0px 10px - justify-self: start state: - font-size: 11px
- font-family: Helvetica
- padding: 0px 10px - justify-self: start - text-transform: capitalize - font-weight: bold - padding-left: 40px - color: gray grid: - grid-template-areas: '"i" "n" "s" "l"' - grid-template-columns: 1fr - grid-template-rows: 1fr min-content min-content img_cell: - align-self: start - text-align: start - margin-left: '[[margin-left]]' - margin-right: '[[margin-right]]' name: - justify-self: start - padding-top: 6px - padding-left: 40px - font-weight: bold
- font-family: Helvetica
- font-size: 13px state: - value: "off" styles: card: - opacity: '[[opacity]]' icon: - color: '[[off_icon_color]]'
- height: ‘[[icon_height]]’
- width: ‘[[icon_width]]’
name: - color: '[[off_name_color]]' state: - color: '[[off_state_color]]' lock: - color: black - value: "dry" styles: card: - opacity: 1.0 icon: - color: '#F5AB98' state: - color: var(--secondary-text-color) name: - color: var(--primary-text-color) - value: "fan only" styles: card: - opacity: 1.0 icon: - color: 'rgb(96,201,48)' state: - color: var(--secondary-text-color) name: - color: var(--primary-text-color) - value: "heat" styles: card:
- color: var(–homekit)
- opacity: 1.0 icon: - color: 'rgb(253,148,38)' state: - color: var(--secondary-text-color) name: - color: var(--primary-text-color) - value: "cool" styles: card: - opacity: 1.0 icon: - color: 'rgb(96,201,48)' state: - color: var(--secondary-text-color) name: - color: var(--primary-text-color) - value: "auto" styles: card: - opacity: 1.0 icon: - color: 'rgb(96,201,48)' state: - color: var(--secondary-text-color) name: - color: var(--primary-text-color)