Hello, I’m the same. I have tried to modify the button size but this happens. Ignore the other buttons on the card and it is positioned in the upper left. It is the same with everyone when I modify them. The template code is the same as that of your configuration. The buttons are adapted in terms of size depending on the buttons you have in that row of the letter and depending on the size of the screen where you see it but I can not set it as you want.
styles:
card:
- width: 7vw
- height: 7vw
custom_fields:
icon_fan: >
[[[ const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9
30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3 0-4.5-.9-6-2.4-.9
1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7 3.9 2.4 9.8 3.1 14.1 1.9
4.6-1.3 7.9-4.7 7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17
28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0 0 1 6.4-8.4l-1.6-3.5L19
6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7 11.3-1.2 4.6.2 9.2 4.7 11.3 3.1
1.3 6.1 1.2 9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5
4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7 1.3 7.1
1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility: visible; transform: rotate(0deg);}100%{transform: rotate(1080deg);}}.start{animation: rotate 2.8s ease-in; transform-origin: center; fill: #5daeea; visibility: hidden;}.on{animation: rotate 1.8s linear infinite; transform-origin: center; fill: #5daeea; animation-delay: 2.8s; visibility: hidden;}.end{animation: rotate 2.8s; transform-origin: center; fill: #9ca2a5; animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);}</style>';
if (entity.state === 'on') { return `${style}<g class="start">${path}</g><g class="on">${path}</g></svg>`; }
else { return `${style}<g class="end">${path}</g></svg>`; } ]]]
entity: switch.velocidad_baja
name: ON/OFF
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
card:
- width: 7vw
- height: 7vw
custom_fields:
icon_fan:
- top: 9%
- left: 10%
- width: 3vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
The card config:
- cards:
- custom_fields:
icon_fan: >
[[[ const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9
30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3
0-4.5-.9-6-2.4-.9 1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7
3.9 2.4 9.8 3.1 14.1 1.9 4.6-1.3 7.9-4.7
7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17 28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0
0 1 6.4-8.4l-1.6-3.5L19 6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7
11.3-1.2 4.6.2 9.2 4.7 11.3 3.1 1.3 6.1 1.2
9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5
4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7
1.3 7.1 1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility: visible; transform: rotate(0deg);}100%{transform: rotate(1080deg);}}.start{animation: rotate 2.8s ease-in; transform-origin: center; fill: #5daeea; visibility: hidden;}.on{animation: rotate 1.8s linear infinite; transform-origin: center; fill: #5daeea; animation-delay: 2.8s; visibility: hidden;}.end{animation: rotate 2.8s; transform-origin: center; fill: #9ca2a5; animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);}</style>';
if (entity.state === 'on') { return `${style}<g class="start">${path}</g><g class="on">${path}</g></svg>`; }
else { return `${style}<g class="end">${path}</g></svg>`; } ]]]
entity: switch.velocidad_baja
name: ON/OFF
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
card:
- width: 7vw
- height: 7vw
custom_fields:
icon_fan:
- top: 9%
- left: 10%
- width: 3vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
- custom_fields:
icon_fan: >
[[[ const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9
30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3
0-4.5-.9-6-2.4-.9 1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7
3.9 2.4 9.8 3.1 14.1 1.9 4.6-1.3 7.9-4.7
7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17 28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0
0 1 6.4-8.4l-1.6-3.5L19 6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7
11.3-1.2 4.6.2 9.2 4.7 11.3 3.1 1.3 6.1 1.2
9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5
4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7
1.3 7.1 1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility: visible; transform: rotate(0deg);}100%{transform: rotate(1080deg);}}.start{animation: rotate 2.8s ease-in; transform-origin: center; fill: #5daeea; visibility: hidden;}.on{animation: rotate 1.8s linear infinite; transform-origin: center; fill: #5daeea; animation-delay: 2.8s; visibility: hidden;}.end{animation: rotate 2.8s; transform-origin: center; fill: #9ca2a5; animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);}</style>';
if (entity.state === 'on') { return `${style}<g class="start">${path}</g><g class="on">${path}</g></svg>`; }
else { return `${style}<g class="end">${path}</g></svg>`; } ]]]
entity: switch.velocidad_media
name: MEDIA
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
custom_fields:
icon_fan:
- top: 9%
- left: 10%
- width: 3vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
- custom_fields:
icon_fan: >
[[[ const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9
30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3
0-4.5-.9-6-2.4-.9 1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7
3.9 2.4 9.8 3.1 14.1 1.9 4.6-1.3 7.9-4.7
7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17 28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0
0 1 6.4-8.4l-1.6-3.5L19 6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7
11.3-1.2 4.6.2 9.2 4.7 11.3 3.1 1.3 6.1 1.2
9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5
4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7
1.3 7.1 1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility: visible; transform: rotate(0deg);}100%{transform: rotate(1080deg);}}.start{animation: rotate 2.8s ease-in; transform-origin: center; fill: #5daeea; visibility: hidden;}.on{animation: rotate 1.8s linear infinite; transform-origin: center; fill: #5daeea; animation-delay: 2.8s; visibility: hidden;}.end{animation: rotate 2.8s; transform-origin: center; fill: #9ca2a5; animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);}</style>';
if (entity.state === 'on') { return `${style}<g class="start">${path}</g><g class="on">${path}</g></svg>`; }
else { return `${style}<g class="end">${path}</g></svg>`; } ]]]
entity: switch.velocidad_alta
name: ALTA
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
custom_fields:
icon_fan:
- top: 9%
- left: 10%
- width: 3vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
type: horizontal-stack
- cards:
- custom_fields:
icon_hue: >
[[[ const state = entity.state === 'on' ? 'animate' : null; return
`<svg viewBox="0 0 50 50"><style>@keyframes animate{0%{transform:
scale(0.85);}20%{transform: scale(1.1);}40%{transform:
scale(0.95);}60%{transform: scale(1.03);}80%{transform:
scale(0.97);}100%{transform: scale(1);}}.animate{animation: animate
0.8s; transform-origin: center;}</style> <path fill="#9da0a2"
d="M27.4 47.3h-4.9s-.7.1-.7.8.4.9.7.9h4.9c.3 0
.7-.1.7-.9s-.7-.8-.7-.8zm3.3-2.9H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2 0
.8-.1.8-.9-.1-.8-.9-.8-.9-.8zm0-3H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2 0
.8-.1.8-.9-.1-.8-.9-.8-.9-.8zm0-2.9H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2
0 .8-.1.8-.9s-.9-.8-.9-.8zm5.2-23.2c-3.3-5.3-7-5.6-10.9-5.6-3.8
0-8.4.4-10.9 5.6-.1.1-.1.3.1.7.4.8 3.3 7.2 3.2 18.8 0 1.1-.1 1.6 0
1.7 0 .1 0 .7 1.1.7h13c1 0 1-.5 1.1-.7v-1.7c-.1-11.6 2.8-18
3.2-18.8.1-.4.1-.5.1-.7"/> <path class="${state}"
fill="var(--button-card-light-color-no-temperature)" d="M14.1
15.3c3.4-.3 7-.4 10.9-.4 3.8 0 7.5.2 10.9.4.4-.4.7-.8.9-1.1C39 8.5
38.9 6.5 38.9 6c-.2-4.4-8.4-5-12.1-5h0-3.4c-3.7 0-12 .5-12.1 5 0
.5-.1 2.5 2.1 8.2 0 .3.3.8.7 1.1z"/></svg>`; ]]]
entity: switch.on_off_luz
name: LUZ
style:
left: 30.31%
top: 20.35%
width: 10%
styles:
custom_fields:
icon_hue:
- top: 11%
- left: 4.5%
- width: 3.05vw
- position: absolute
template: light
type: 'custom:button-card'
- custom_fields:
icon_fan: >
<svg viewBox="0 0 1150 1150"><path d="M316.54 164.3c-48.85
20.66-92.713 50.232-130.373 87.893s-67.23 81.524-87.893
130.375c-21.4 50.592-32.25 104.313-32.25 159.675s10.85 109.083 32.25
159.675c20.66 48.85 50.232 92.713 87.893 130.373s81.524 67.23
130.373 87.893c50.592 21.398 104.314 32.248 159.675
32.248s109.083-10.85 159.675-32.25c48.85-20.66 92.713-50.23
130.373-87.893s67.23-81.524 87.893-130.373c21.398-50.592
32.25-104.314
32.25-159.675s-10.852-109.083-32.25-159.676c-20.66-48.85-50.232-92.713-87.893-130.374l-1.328-1.297
18.656-19.75 34.818 29.54 44-51.854-118.792-100.783-43.992 51.854
32.05 27.2-18.875
19.982c-23.94-16.935-49.645-31.244-76.9-42.773a407.64 407.64 0 0
0-61.477-20.432V68h54.727V0H323.3v68h54.727v75.868c-20.92
5.147-41.445 11.96-61.476 20.432zm501.864 377.94c0 91.4-35.594
177.333-100.225 241.965S567.617 884.43 476.215 884.43 298.882
848.837 234.25 784.206 134.025 633.644 134.025 542.24 169.62 364.907
234.25 300.276c40.77-40.77 90.02-69.97 143.766-85.985 22.003-6.557
44.76-10.9 68-12.9 9.986-.867 20.057-1.33 30.2-1.33a349.06 349.06 0
0 1 30.199 1.331c23.24 2.02 45.998 6.353 68 12.9 53.748 16.016
102.996 45.216 143.766 85.985 64.63 64.63 100.224 150.563 100.224
241.965zM446.016 70.112h60.398v63.03a418.36 418.36 0 0
0-30.2-1.09c-10.126 0-20.193.367-30.2 1.1v-63.03zm30.2
167.67v68c7.832 0 15.603.38 23.298 1.128 54.36 5.282 104.78 29.005
143.902 68.13 44.662 44.662 69.258 104.042 69.258 167.202 0
11.352-.805 22.576-2.375 33.645L574.2
535.7c-3.373-51.114-46.023-91.67-97.976-91.67-54.147 0-98.2
44.052-98.2 98.2s44.052 98.197 98.2 98.197c32.167 0 60.77-15.547
78.693-39.52l199.73 58.954 2.096.887c15.887-37.556 23.94-77.432
23.94-118.52
0-81.323-31.668-157.78-89.174-215.285-33.518-33.518-73.48-58.238-117.084-73.046-31.207-10.594-64.276-16.125-98.2-16.125zm0
334.657a30.15 30.15 0 0
1-8.547-1.238c-12.5-3.696-21.652-15.276-21.652-28.96 0-16.652
13.547-30.2 30.2-30.2a30.14 30.14 0 0 1 8.548 1.239c12.5 3.695 21.65
15.275 21.65 28.96.001 16.65-13.546 30.197-30.198 30.197z"/></svg>
entity: switch.temp_2h
name: |
[[[
if (states["timer.temp2h"].state == 'idle') return "TIEMPO 2H";
else return states["timer.temp2h"].state
]]]
show_state: false
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
custom_fields:
icon_fan:
- top: 13%
- left: 10%
- width: 3.5vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
- custom_fields:
icon_fan: >
<svg viewBox="0 0 1150 1150"><path d="M316.54 164.3c-48.85
20.66-92.713 50.232-130.373 87.893s-67.23 81.524-87.893
130.375c-21.4 50.592-32.25 104.313-32.25 159.675s10.85 109.083 32.25
159.675c20.66 48.85 50.232 92.713 87.893 130.373s81.524 67.23
130.373 87.893c50.592 21.398 104.314 32.248 159.675
32.248s109.083-10.85 159.675-32.25c48.85-20.66 92.713-50.23
130.373-87.893s67.23-81.524 87.893-130.373c21.398-50.592
32.25-104.314
32.25-159.675s-10.852-109.083-32.25-159.676c-20.66-48.85-50.232-92.713-87.893-130.374l-1.328-1.297
18.656-19.75 34.818 29.54 44-51.854-118.792-100.783-43.992 51.854
32.05 27.2-18.875
19.982c-23.94-16.935-49.645-31.244-76.9-42.773a407.64 407.64 0 0
0-61.477-20.432V68h54.727V0H323.3v68h54.727v75.868c-20.92
5.147-41.445 11.96-61.476 20.432zm501.864 377.94c0 91.4-35.594
177.333-100.225 241.965S567.617 884.43 476.215 884.43 298.882
848.837 234.25 784.206 134.025 633.644 134.025 542.24 169.62 364.907
234.25 300.276c40.77-40.77 90.02-69.97 143.766-85.985 22.003-6.557
44.76-10.9 68-12.9 9.986-.867 20.057-1.33 30.2-1.33a349.06 349.06 0
0 1 30.199 1.331c23.24 2.02 45.998 6.353 68 12.9 53.748 16.016
102.996 45.216 143.766 85.985 64.63 64.63 100.224 150.563 100.224
241.965zM446.016 70.112h60.398v63.03a418.36 418.36 0 0
0-30.2-1.09c-10.126 0-20.193.367-30.2 1.1v-63.03zm30.2
167.67v68c7.832 0 15.603.38 23.298 1.128 54.36 5.282 104.78 29.005
143.902 68.13 44.662 44.662 69.258 104.042 69.258 167.202 0
11.352-.805 22.576-2.375 33.645L574.2
535.7c-3.373-51.114-46.023-91.67-97.976-91.67-54.147 0-98.2
44.052-98.2 98.2s44.052 98.197 98.2 98.197c32.167 0 60.77-15.547
78.693-39.52l199.73 58.954 2.096.887c15.887-37.556 23.94-77.432
23.94-118.52
0-81.323-31.668-157.78-89.174-215.285-33.518-33.518-73.48-58.238-117.084-73.046-31.207-10.594-64.276-16.125-98.2-16.125zm0
334.657a30.15 30.15 0 0
1-8.547-1.238c-12.5-3.696-21.652-15.276-21.652-28.96 0-16.652
13.547-30.2 30.2-30.2a30.14 30.14 0 0 1 8.548 1.239c12.5 3.695 21.65
15.275 21.65 28.96.001 16.65-13.546 30.197-30.198 30.197z"/></svg>
entity: switch.temp_4h
name: |
[[[
if (states["timer.temp4h"].state == 'idle') return "TIEMPO 4H";
else return "Quedan:"
]]]
show_state: false
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
custom_fields:
icon_fan:
- top: 13%
- left: 10%
- width: 3.5vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
- custom_fields:
icon_fan: >
<svg viewBox="0 0 1150 1150"><path d="M316.54 164.3c-48.85
20.66-92.713 50.232-130.373 87.893s-67.23 81.524-87.893
130.375c-21.4 50.592-32.25 104.313-32.25 159.675s10.85 109.083 32.25
159.675c20.66 48.85 50.232 92.713 87.893 130.373s81.524 67.23
130.373 87.893c50.592 21.398 104.314 32.248 159.675
32.248s109.083-10.85 159.675-32.25c48.85-20.66 92.713-50.23
130.373-87.893s67.23-81.524 87.893-130.373c21.398-50.592
32.25-104.314
32.25-159.675s-10.852-109.083-32.25-159.676c-20.66-48.85-50.232-92.713-87.893-130.374l-1.328-1.297
18.656-19.75 34.818 29.54 44-51.854-118.792-100.783-43.992 51.854
32.05 27.2-18.875
19.982c-23.94-16.935-49.645-31.244-76.9-42.773a407.64 407.64 0 0
0-61.477-20.432V68h54.727V0H323.3v68h54.727v75.868c-20.92
5.147-41.445 11.96-61.476 20.432zm501.864 377.94c0 91.4-35.594
177.333-100.225 241.965S567.617 884.43 476.215 884.43 298.882
848.837 234.25 784.206 134.025 633.644 134.025 542.24 169.62 364.907
234.25 300.276c40.77-40.77 90.02-69.97 143.766-85.985 22.003-6.557
44.76-10.9 68-12.9 9.986-.867 20.057-1.33 30.2-1.33a349.06 349.06 0
0 1 30.199 1.331c23.24 2.02 45.998 6.353 68 12.9 53.748 16.016
102.996 45.216 143.766 85.985 64.63 64.63 100.224 150.563 100.224
241.965zM446.016 70.112h60.398v63.03a418.36 418.36 0 0
0-30.2-1.09c-10.126 0-20.193.367-30.2 1.1v-63.03zm30.2
167.67v68c7.832 0 15.603.38 23.298 1.128 54.36 5.282 104.78 29.005
143.902 68.13 44.662 44.662 69.258 104.042 69.258 167.202 0
11.352-.805 22.576-2.375 33.645L574.2
535.7c-3.373-51.114-46.023-91.67-97.976-91.67-54.147 0-98.2
44.052-98.2 98.2s44.052 98.197 98.2 98.197c32.167 0 60.77-15.547
78.693-39.52l199.73 58.954 2.096.887c15.887-37.556 23.94-77.432
23.94-118.52
0-81.323-31.668-157.78-89.174-215.285-33.518-33.518-73.48-58.238-117.084-73.046-31.207-10.594-64.276-16.125-98.2-16.125zm0
334.657a30.15 30.15 0 0
1-8.547-1.238c-12.5-3.696-21.652-15.276-21.652-28.96 0-16.652
13.547-30.2 30.2-30.2a30.14 30.14 0 0 1 8.548 1.239c12.5 3.695 21.65
15.275 21.65 28.96.001 16.65-13.546 30.197-30.198 30.197z"/></svg>
entity: switch.temp_8h
name: |
[[[
if (states["timer.temp8h"].state == 'idle') return "TIEMPO 8H";
else return "Quedan:"
]]]
show_state: false
style:
left: 80.05%
top: 37.9%
width: 10%
styles:
custom_fields:
icon_fan:
- top: 13%
- left: 10%
- width: 3.5vw
- position: absolute
tap_action:
action: toggle
template: switch
type: 'custom:button-card'
type: horizontal-stack
type: vertical-stack