That is not possible for the for category. The only variables that can be introduced into triggers is with a value_template trigger. If you set it up properly, you could mimic a for x time duration but it takes alot of setup.
If you wanted to get a for duration you’d probably be best off creating a template sensor that returns true when a device has been a state for x amount of time. Then trigger off that.
The ideas suggested so far are probably easiest and therefore maybe best. But, if you do want to do this with one automation, then I believe it’s possible. The idea is to have two triggers (one for 1 min, and another for 20 min), then filter them (via a template condition) depending on when the motion sensor went off. Something like this:
- alias: Downstairs lights off at no movement
trigger:
- entity_id: binary_sensor.downstairs_motion
platform: state
to: 'off'
for: '00:01'
- entity_id: binary_sensor.downstairs_motion
platform: state
to: 'off'
for: '00:20'
condition:
condition: template
value_template: >
{% set off_hour = trigger.to_state.last_changed.hour %}
{% set off_at_night = off_hour >= 23 or off_hour < 6 %}
{% set off_min = (trigger.for.total_seconds() / 60)|round %}
{{ off_at_night and off_min == 1 or not off_at_night and off_min == 20 }}
action:
- service: homeassistant.turn_off
entity_id:
- light.downstairs
- light.dining_room
- switch.jordglob
Disclaimer: This is based on theory and some minimal testing. I haven’t actually tried all of this together, so the details may be off in places. But hopefully it gets the idea across and gives you at least a starting point.