Motion Sensors Question

My question is I have motion sensors that I built and they stay activated for a brief period of time, I would like to display if there has been motion in the last 10 minutes in the front end does anyone have any examples to show this? How it functions now is it goes off with in 1-10 second so it always displays as off.


This is what I figured out, for some reason it too me too long to test it.

  - platform: time_date
     - 'time'
 - platform: template
        friendly_name: Motion Sensor
        value_template: '{{ (as_timestamp(now())-as_timestamp(states.binary_sensor.motion_sensor_10_1.last_updated)) < 300 }}'
        device_class: motion
        entity_id: sensor.time

It was the time portion that was the trick, because nothing else changes if there is no motion.