C’est bon, cela marche. Effectivement, en %, ca fonctionne bien mieux
Ma card:
type: vertical-stack
cards:
- type: grid
cards:
- type: 'custom:button-card'
entity: light.bonsoir
name: Bonsoir
icon: 'mdi:lightbulb-group'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.terrasse
name: Terrasse
show_state: false
show_icon: true
icon: 'mdi:coach-lamp'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: switch.projecteur_palmiers
name: palmiers
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.orangerie
name: Orangerie
icon: 'mdi:desk-lamp'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.patio
name: Patio
icon: 'mdi:ceiling-light'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.veranda
name: Véranda
icon: 'mdi:floor-lamp-dual'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
icon: 'mdi:television'
entity: light.tv
name: TV
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.salon
name: Salon
icon: 'mdi:sofa'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.lampe_bureau
name: Bureau
icon: 'mdi:desk'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.buffet
name: Buffet
icon: 'mdi:buffet'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.sejour
name: Séjour
icon: 'mdi:silverware'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.couloir
name: Couloir
icon: 'mdi:track-light'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
- type: 'custom:button-card'
entity: light.chambre_de_clarisse
name: Ch.Clarisse
icon: 'mdi:bed'
aspect_ratio: 1/1
state:
- value: 'on'
styles:
card:
- background-color: 'rgba(255, 255, 255, 0.8)'
- border: '1px rgba(80, 80, 80) solid'
name:
- color: 'rgba(0, 0, 0, 0.6)'
icon:
- color: var(--button-card-light-color-no-temperature)
double_tap_action:
action: more-info
variables:
circle_input: |
[[[ return Math.round(entity.attributes.brightness / 2.54); ]]]
styles:
icon:
- top: '-2%'
- left: 3%
- width: 57%
- position: absolute
name:
- top: 80%
- left: 15%
- position: center
card:
- font-size: 100%
- border-radius: 15%
- box-shadow: none
- transition: none
custom_fields:
circle:
- top: 8.5%
- left: 56%
- width: 40%
- position: absolute
custom_fields:
circle: |
[[[
if (entity.state === 'on') {
const input = variables.circle_input;
const radius = 20.5;
const circumference = radius * 2 * Math.PI;
return `
<svg viewBox="0 0 50 50">
<style>
circle {
transform: rotate(-90deg);
transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - input / 100 * circumference};
}
tspan {
font-size: 10px;
}
</style>
<circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${input}<tspan font-size="10">%</tspan></text>
</svg>
`;
}
]]]
columns: 4
square: false