Automation that looks for X amount of time after another automation runs

My use case is I want an automation that does something (turn on lights) if an entity becomes something (phone is back on charger) for 30 seconds after another automation runs.

I see that you can use an automation run time changing as a trigger. I just can’t figure out how to have it look for the entity change on the phone charger only for a 30 second window after that.

Perhaps by using a wait_for_trigger in the automation’s actions.

actions: 
  - wait_for_trigger:
      - trigger: state
        entity_id: your_phone_charger_entity
        to: "on"
        for:
          seconds: 30
  - action: your_actions
    ... etc ...

I think I solved it - used a helper boolean and a separate automation that turns the helper on, waits 30s then turns it off.

What is the design decision that requires the use of two separate automations instead of a single one?

A single automation doesn’t need a “flag” (like an Input Boolean) as a signal to coordinate its actions.