If motion was sensed in the last 2 hours

I’d like to add a condition to an existing automation. “only if motion was sensed in the past 2 hours”.

I’m using an aeotec multisensor for both temp and motion.
“sensor.aeon_labs_zw100_multisensor_6_temperature”
“sensor.aeon_labs_zw100_multisensor_6_burglar”

The current automation sends me an alert if my child’s room temp rises above 80 degrees. But I don’t want it to happen if my child isn’t in her room.

How about something like:

- condition: template
  value_template: >
    {{ not is_state('sensor.aeon_labs_zw100_multisensor_6_burglar', '0') or
       (now() - states.sensor.aeon_labs_zw100_multisensor_6_burglar.last_changed)
       .total_seconds() <= 2*60*60 }}

Or what might be a bit easier to read:

- condition: template
  value_template: >
    {% set motion = states.sensor.aeon_labs_zw100_multisensor_6_burglar %}
    {{ motion.state != '0' or
       (now() - motion.last_changed).total_seconds() <= 2*60*60 }}