Actual @KTibow, this SoftUI helps us to create an awesome and clean dashboard.
I think because this is in Portuguese you didn’t notice that all my sensors and switches have custom On and Off messages as well as custom icons
I use the soft ui with combination of custom:button-card, grids, templates and CSS styles.
Then i used 2 main templates and 1 auxiliar template
- main_style - Just for defination of the general button style
- cover_style - Define the grid for the covers buttons (Up, Down and Stop)
- cover_inside_button - Auxiliar template for the inside cover buttons
I have this defined on the lovelace raw code
main_style:
styles:
img_cell:
- padding-left: 25px
- padding-bottom: 15px
- justify-content: start
card:
- width: 'min(37vw, 170px)'
- height: 'min(35vw, 150px)'
- border-radius: 15px
- border-style: solid
- border-color: var(--primary-background-color)
- background-color: var(--primary-background-color)
- border-width: 2px
- margin: 3px 20px 3px 3px
- box-shadow: >
[[[ return '-4px -4px 8px rgba(255, 255, 255, .5), 5px 5px 8px
rgba(0, 0, 0, .09)' ]]]
- font-family: 'Google Sans, Roboto'
- font-weight: 500
name:
- justify-self: start
- font-size: 18px
- font-weight: 400
- align-self: center
- text-align: left
- padding-left: 15px
- opacity: 0.5
- color: var(--primary-text-color)
icon:
- color: var(--primary-icon-color)
- justify-self: start
- align-self: start
- opacity: 0.5
state:
- justify-self: start
- font-weight: normal
- font-size: 14px
- opacity: 0.6
- padding: 0 15px 5px
- color: var(--primary-text-color)
- opacity: 0.5
label:
- justify-self: start
- font-weight: normal
- font-size: 14px
- opacity: 0.6
- padding: 0 15px 5px
- color: var(--primary-text-color)
- opacity: 0.5
cover_style:
show_label: true;
show_state: false
variables:
sensor_name: ' '
label: |
[[[ return (states[entity.entity_id].attributes.current_position)+'%' ]]]
hold_action:
action: more-info
tap_action:
action: none
styles:
grid:
- grid-template-areas: '"i top" "i stop" "n bottom" "l l"'
- grid-template-rows: 1fr 1fr 1fr min-content
- grid-template-columns: 2fr 1fr
custom_fields:
top:
card:
type: 'custom:button-card'
entity: null
icon: 'mdi:arrow-up-circle-outline'
template: cover_inside_button
tap_action:
action: call-service
service: cover.open_cover
service_data:
entity_id: '[[[ return entity.entity_id ]]]'
bottom:
card:
type: 'custom:button-card'
entity: null
icon: 'mdi:arrow-down-circle-outline'
template: cover_inside_button
tap_action:
action: call-service
service: cover.close_cover
service_data:
entity_id: '[[[ return entity.entity_id ]]]'
stop:
card:
type: 'custom:button-card'
entity: null
icon: 'mdi:stop-circle-outline'
template: cover_inside_button
tap_action:
action: call-service
service: cover.stop_cover
service_data:
entity_id: '[[[ return entity.entity_id ]]]'
cover_inside_button:
size: 70%
show_icon: true
show_name: false
styles:
card:
- width: 30px
- height: 30px
- margin: 5px
- border-radius: 20px
- box-shadow: >
[[[ return '-4px -4px 8px rgba(255, 255, 255, .5), 5px 5px 8px
rgba(0, 0, 0, .03)'; ]]]
- background-color: var(--primary-background-color)
icon:
- color: '#b473f5'
opacity: 1
And then i just create a custom button card
entity: cover.cover1
name: Kitchen
icon: 'mdi:blinds'
template:
- main_style
- cover_style
type: 'custom:button-card'
The HEX color codes that i mainly use are:
red: "#d62b5b"
yellow: "#f7bf42"
green: "#60eb60"
blue: "#46bdea"
Regarding the buttons, just for you have an ideia
entity: switch.switch_light_garage
name: Light
template:
- main_style
- button_grid
- button
type: 'custom:button-card'
variables:
icon_on: 'mdi:lightbulb-on-outline'
icon_off: 'mdi:lightbulb-off'
message_on: 'Attention, light is on'
message_off: Off
color: var(--yellow)