Templates in Lovelace dashboard?

I have a history graph in a Lovelace dashboard and I want to use another entity to dynamically change the number of hours it shows. Is this possible? I tried the below code, this doesn’t work.

hours_to_show: {{ states("input_number.tesla_graph_hours") }}

As far as I know it’s not possible. This dashboard is not template-able the way you want and therefore this will not work. I suggest you use the card below, perhaps it can:

Also, consider custom cards like config-template-card (CTC).
Discussion - in a dedicated CTC thread.