The config checker failed to report the error; you can’t use for in that manner. The proof is when you execute the automation it will produce an error message.
I used this automation:
- alias: 'test for in action'
trigger:
platform: state
entity_id: input_boolean.flash
to: 'on'
action:
service: light.turn_on
data:
entity_id: light.family
for: '00:00:10'
and executing it produced this error message in the system log:
2019-07-12 09:10:29 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.test_for_in_action. Invalid data for call_service at pos 1: extra keys not allowed @ data[‘for’]
You can use a 5-minute delay in the action: turn on the light, delay for 5 minutes, turn off the light. However, while the delay is counting down from 5 minutes, the automation is considered ‘in use’ and cannot be executed again until the countdown is finished. Depending on your application, this may or may not be an issue.