Ecobee thermostat and motion detection

Hello. It’s been two weeks now since I installed an ecobee enhanced thermostat. I am utilizing its motion detection attribute in an automation to turn on a smart switch for a lamp at night. However, the ecobee clears the motion detection after 5 minutes. Is there a way to clear the motion detection in HA? Maybe I should extend the lamp switch to be on for 5-1/2 minutes so if there is another motion detection after 5 minutes, it keeps the smart switch to on again. What do you think?