How to create a template for navigation_path?

I’m having a really hard time understanding how to use the navigate functionality of a button. I want to create a button that opens up the history panel (/history/) with the predefined sensors and with the time frame of the last 2 weeks.
For this I have already created a template:

/history?entity_id=sensor.atc_2284_temperature%2Csensor.atc_35d5_temperature%2Csensor.atc_0e40_temperature%2Csensor.atc_ffa7_temperature&start_date={{ (now() - timedelta(weeks=1)).isoformat() }}&end_date={{ now().isoformat() }}

And I thought that you just cant place it in the navigation_path of a tap_action because it can’t understand templates. So I created a sensor which has this link as its state. However, when I try to use it like this:

- type: custom:mushroom-chips-card
              - type: template
                content: History
                icon: mdi:clock
                icon_color: grey
                  action: navigate
                  navigation_path: states['sensor.time_history'].state

It just plainly inserts it as a string and not the state of the sensor… How can I achieve this functionality? Is it even possible?

Did you find a solution to this problem?