Recommendations setup for obstacle recognition

Hi Guys

i have search but not find a definitive answer to my problem.
i have Hassio installed on a VM and i have a Shelly that i can control my Garagedoor to open and close, for the Garagedoor status open and close i have a Aqara Sensor. This setup works well, now my Problem is that i need a sensor that recognize if anyone or a object (car) is in front of the Garagedoor (obstacle sensor?) with this input i can control if i must block the Garagedoor to open because anything is in front of it.

Did anyone have setup this and what Hardwrae and implentation did you have use?

I don’t be sure if a ultrasonic sensor is the right for me, or IR Sensor, but they are sensitive of lights they can have false positive value?

Thnaks for your sharing

fonio