HI,
trying to add a generic graph to my buttons, I am stuck somehow templating the entity of the button into the graph:
- type: custom:button-card
template: button_body
entity: sensor.cpu_temperature
name: Cpu temp
custom_fields:
plot:
card:
type: custom:mini-graph-card
entities:
- sensor.cpu_temperature
is the correct functionality, and makes it all happen. Of course, I need to set the entity of the mini-graph-card in the template and tried various optionsā¦
- type: custom:button-card
template: button_body
entity: sensor.cpu_temperature
name: Cpu temp
custom_fields:
plot:
card:
type: custom:mini-graph-card
entities:
- '[[[ return states[entity]; ]]]'
or - '[[[ return entity; ]]]'
and
- >
[[[ return entity; ]]]
no luck just yet. could you please have a look how I could accomplish this? Iād like to set this whole config bit as an anchor for the buttons below, or maybe even as a button-card template.
to give you the idea, this is what I copied and edited from Petroās repoā¦
- type: custom:button-card
template: button_body
entity: sensor.cpu_temperature
name: Cpu temp
custom_fields:
plot:
card:
type: custom:mini-graph-card
entities:
- '[[[ return states[entity]; ]]]'
group: true
points_per_hour: 1
hour24: true
line_color: var(--primary-color)
line_width: 10
hours_to_show: 24
update_interval: 600
show:
name: false
icon: false
state: false
points: false
legend: false
average: false
extrema: false
labels: false
fill: false
labels_secondary: false
name_adaptive_color: false
icon_adaptive_color: false
styles:
custom_fields:
plot:
- position: absolute
- top: 55%
- left: 50%
- width: calc(100% + 25px)
- transform: translate(-50%, calc(-50% + 10px))
- z-index: 3
- --paper-card-background-color: 'rgba(0, 0, 0, 0.0)'
- --ha-card-background: rgba(0, 0, 0, 0.0)"
- --ha-card-box-shadow: 'none'
- pointer-events: none
showing like:
thanks for having a look