@DavidFW1960 My solution is probably worse though, a lot of code to accomplish a simple thing. It could however work fine if the colors in the card work for both themes (or apply some more transparancy to it). I only use one theme at the moment (I might work on making a day theme as well, but for now I am too busy reworking my entire frontend to be more simple, elegant and wife friendly).
ofcourse I will share the code:
- cards:
- type: custom:state-switch
entity: light.woonkamer_plafond
states:
"on":
type: 'custom:card-modder'
style:
border-radius: 20px
border-style: solid
border-width: 1px
border-color: '#e5e5e5'
--paper-card-background-color: rgba(20, 20, 20, 0.4)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.woonkamer_plafond
icon: 'mdi:ceiling-light'
name: Plafond
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"off":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.woonkamer_plafond
icon: 'mdi:ceiling-light'
name: Plafond
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"unavailable":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.woonkamer_plafond
icon: 'mdi:ceiling-light'
name: Plafond
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
- type: custom:state-switch
entity: light.eettafel_lamp
states:
"on":
type: 'custom:card-modder'
style:
border-radius: 20px
border-style: solid
border-width: 1px
border-color: '#e5e5e5'
--paper-card-background-color: rgba(20, 20, 20, 0.4)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.eettafel_lamp
icon: 'mdi:ceiling-light'
name: Eettafel
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"off":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.eettafel_lamp
icon: 'mdi:ceiling-light'
name: Eettafel
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"unavailable":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
card:
entity: light.eettafel_lamp
icon: 'mdi:ceiling-light'
name: Eettafel
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
- type: custom:state-switch
entity: light.tafel_lamp
states:
"on":
type: 'custom:card-modder'
style:
border-radius: 20px
border-style: solid
border-width: 1px
border-color: '#e5e5e5'
--paper-card-background-color: rgba(20, 20, 20, 0.4)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.tafel_lamp
icon: 'mdi:lamp'
name: Tafel Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"off":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.tafel_lamp
icon: 'mdi:lamp'
name: Tafel Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"unavailable":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.tafel_lamp
icon: 'mdi:lamp'
name: Tafel Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
- type: custom:state-switch
entity: light.vloerlamp_2
states:
"on":
type: 'custom:card-modder'
style:
border-radius: 20px
border-style: solid
border-width: 1px
border-color: '#e5e5e5'
--paper-card-background-color: rgba(20, 20, 20, 0.4)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.vloerlamp_2
icon: 'mdi:floor-lamp'
name: Vloer Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"off":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.vloerlamp_2
icon: 'mdi:floor-lamp'
name: Vloer Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
"unavailable":
type: 'custom:card-modder'
style:
border-radius: 20px
box-shadow: 2px 2px rgba(0,0,0,0.3)
height: 50px
padding: 20%
font-size: 13px
white-space: nowrap
card:
entity: light.vloerlamp_2
icon: 'mdi:floor-lamp'
name: Vloer Lamp
type: entity-button
tap_action:
action: toggle
hold_action:
action: more-info
type: horizontal-stack
This is just a single row of 4 buttons. As you can see the code to achieve this the way I have done it is massive, though in all fairness I haven’t found any performance differences (but then again I run HA on a hexacore i7 along with some other virtual machines).
Took me a while to rewrite all of my previously existing code to the way it is now and I might rewrite everything again if this would ever be possible with the core entity button. Let me know what your thoughts on this would be.