hello everyone
I Use minigraph plugins and I would like put a dinamyc parameter to an option by example for this config:
- color_thresholds_transition: smooth
entities:
- entity: sensor.humidity_exterieur
name: humidity exterieur
index: 0
font_size: 100
group: false
hour24: true
hours_to_show: 24
line_width: 6
points_per_hour: 1
show:
extrema: false
fill: fade
labels: true
name: true
state: true
type: 'custom:mini-graph-card'
I would like set the option “hours_to_show” with a input_number
can doing this in lovelace config file?
I have try with
hours_to_show: {{ states('input_number.days_to_show_temp_graph')|int *24 }}
but don’t seem working
eggman
(bertie basset)
February 9, 2020, 11:30am
3
Templates are not supported everywhere by default. But there are options.
Lovelace Templates
I’ve gone and made a crazy card that allows you to pretty much template anything in Lovelace for your card configurations using any information available on the frontend; states, attributes, user, etc.
Want state/attribute-based icons? DONE!
Want dynamic stacks; vertical vs horizontal based on user? DONE!
Want OR conditionals? DONE!
The list is pretty much endless and I’m sure you all will come up with some crazy stuff. Be sure to share.
Go nuts! Enjoy!
I had looked at the config-template card but, since I wanted to be able to reuse the Jinja2 templates I use in the rest of Home Assistant, I decided to see if I could create a card like that which could apply Jinja2 templates Lovelace cards.
Introducing the card-templater card
https://github.com/gadgetchnnel/lovelace-card-templater
Installation
This requires card-tools to be installed, check the link for details on installing this if you don’t have it installed.
This card can either be instal…
seem doesn’t work with mini graph I have put this in my config maybe can I have done a mistake somewhere;
type: 'custom:config-template-card'
variables:
- 'states[input_number.days_to_show_temp_graph''].state'
entities:
- input_number.days_to_show_temp_graph
card:
color_thresholds_transition: smooth
entities:
- entity: sensor.pressure_chambre
index: 0
name: pressure chambre
font_size: 100
group: false
hour24: true
hours_to_show: '${vars[0] * 24}'
line_width: 6
points_per_hour: 1
show:
extrema: false
fill: fade
labels: true
name: true
state: true
type: 'custom:mini-graph-card'
eggman
(bertie basset)
February 9, 2020, 8:57pm
5
I’ve never used this card, but the quotes are clearly wrong, a quick look at the examples on github suggest
variables:
- states[ ’input_number.days_to_show_temp_graph‘ ].state
indeed after this correction it’s working thanks
1 Like
AhmadK
(akasma74)
February 10, 2020, 11:06am
7
it’s amazing how many times it’s down to wrong quotes used and how many wrong options are available.
perhaps it’s something that has a great room for improvement?
woodmj74
(Mike Wood)
September 16, 2020, 11:11am
8
Awesome, had exactly the same use case with graphs - works a treat!!