Trigger an automation based on time sensor with offset of few seconds

For future reference, the Solution tag is normally assigned to the first, or best, post that answers/resolves the original question/problem mentioned in the topic’s first post. You chose to mark your own post with the Solution tag, despite the fact it contains solutions supplied by others.

Reference: FAQ Guideline 21