Automation to switch lights on at specific time, off at specific time, and then motion activated for a specifci time

Please follow Community Questions Guideline #9 by sharing your properly-formatted automation YAML configuration and/or Node-RED flow json, so that we can see what you want and where you are having issues.

FYI, these forums tend to have fewer Node-RED users than some of the other Home Assistant-related support sites. If you don’t get an answer here you may want to try Reddit or Discord.