How to: dynamic "days_to_show"

All I need is: “not to copy/paste dashboards for seeing the same graphs over different time windows” (the simplest solution wins)

I created a helper, shown below. code is fine in “developer tools > template”. but cant get it to work. Is it a small syntax issue, or am I confused at a higher level?

chart_type: line
period: hour
type: statistics-graph
entities:

  • sensor.t_schuur_temperature
    stat_types:
  • mean
    days_to_show: “{{ states(‘input_number.db_nrdays’) | int }}”

I cannot get this to work.

I am not using HACS yet, is that what i am supposed to do?
Thanks!!!

You can’t template things in the frontend without custom cards that allow that.

1 Like

Place your card into custom:config-template-card.
thread
github

1 Like