Hi
I made the config on button_card_templates exactly
See below for an updated version compared to what you see above:
cover_gang:
aspect_ratio: 1/1
show_state: true
show_icon: false
state:
- value: 'open'
styles:
card: [background-color: 'rgba(255, 255, 255, 0.8)']
name: [color: 'rgba(0, 0, 0, 0.6)']
state: [color: 'rgba(0, 0, 0, 0.6)']
- value: 'opening'
styles:
card: [background-color: 'rgba(255, 255, 255, 0.8)']
name: [color: 'rgba(0, 0, 0, 0.6)']
state: [color: 'rgba(0, 0, 0, 0.6)']
- value: 'closing'
styles:
card: [background-color: 'rgba(255, 255, 255, 0.8)']
name: [color: 'rgba(0, 0, 0, 0.6)']
state: [color: 'rgba(0, 0, 0, 0.6)']
styles:
name:
[top: 57.7%, left: 11%, line-height: 2vw, position: absolute]
state:
[top: 74%, left: 11%, line-height: 2vw, position: absolute]
card:
[font-family: Sf Display, letter-spacing: 0.05vw, font-weight: 400, color: 'rgba(255, 255, 255, 0.3)', font-size: 1.34vw,
background-color: 'rgba(115, 115, 115, 0.2)', border-radius: 0.8vw, box-shadow: none, transition: none]
custom_fields:
circle:
[top: 8.5%, left: 56.2%, width: 3.5vw, position: absolute, letter-spacing: 0.03vw, color: 'rgba(141, 142, 144, 1)']
temp:
[top: 28%, left: 6%, width: 5vw, position: absolute, font-size: 1.2vw, color: 'rgba(141, 142, 144, 1)']
icon:
[top: 8.5%, left: 11.2%, width: 1.5vw, position: absolute, color: 'rgba(141, 142, 144, 1)']
custom_fields:
temp: >
[[[
return states['sensor.gang_sensor_temperature'].state + '°C';
]]]
circle: >
[[[ if (entity.state === 'open') {
const position = states['sensor.velux_position_gang'].state;
const radius = 20.5; const circumference = radius * 2 * Math.PI;
return `<svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" style="
transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: ${circumference}; stroke-dashoffset: ${circumference - position / 100 * circumference};" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${position}<tspan font-size="10">%</tspan></text></svg>`; } ]]]
icon: >
[[[ return `<ha-icon icon="mdi:thermometer" > </ha-icon>` ]]]
In your lovelace.yaml
- type: custom:button-card
entity: cover.velux_gang
triggers_update:
['cover.velux_gang', 'input_boolean.velux_gang']
style:
top: 51.45%
left: 49.18%
width: 10%
tap_action:
action: call-service
service: cover.toggle
service_data:
entity_id: cover.velux_gang
hold_action: !include popup/velux_gang.yaml
template: cover_gang
the popup
action: call-service
service: browser_mod.popup
service_data:
title: Velux Gang
deviceID: this
card:
type: custom:stack-in-card
cards:
- type: entities
show_header_toggle: false
entities:
- entity: cover.velux_gang
name: Åben/luk
secondary_info: last-changed
style: |
:host {
--paper-item-icon-color:
{% if is_state(config.entity, 'on') %}
#3182b7
{% else %}
#9e9e9e
{% endif %};
}
- type: custom:slider-entity-row
entity: cover.velux_gang
name: Juster manuelt
min: 0
max: 100
step: 1
attribute: position
- entity: automation.open_velux_gang_temp
icon: mdi:chart-bell-curve-cumulative
name: Åben hvis temp > 26 °C
- type: custom:mini-graph-card
entities:
- color: '#385581'
entity: sensor.gang_sensor_temperature
line_width: 8
hour24: true
group: true
align_icon: left
align_state: right
align_header: left
hours_to_show: 24
show:
fill: fade
icon: true
name: true
state: true
name_adaptive_color: false
labels: hover
legend: false
style: |
ha-card {
border-radius: 0.35em;
background: none;
box-shadow: none;
margin-top: -0.4em;
}
.name > span, .state > span.state__value.ellipsis,
.state > span.state__uom.ellipsis {
font-size: 14px !important;
font-weight: 400 !important;
opacity: 1 !important;
}
.name > span {
margin-left: 16px !important;
}
.icon {
margin-left: 31px !important;
}
.state {
margin-top: -36px;
margin-right: 33px;
}
.state > span.state__uom.ellipsis {
margin-top: -3px;
}
.state > div {
opacity: 0;
}
tap_action:
action: none
Let me know if it works