How to create a dynamic (Hours to show) Lovelace map card?

Hi!
Is there a way to make the

hours_to_show: 48

Dynamic?

I would like to have an input slider to select the hours to show on the map dynamically.

This is the way I try:


type: map
entities:
  - entity: device_tracker.automower
hours_to_show: {{ states("input_number.hours") | int }}

But It throws me an error:


 ({"[object Object]":null})

Anybody an idea how to solve it?
Thank you

Yes there is. You can pick the sensor to show too if you want. It requires the custom template card. Details in this topic: