Just turn off the lights with sensor no motion [without turn on previously]

Is there a way to set an automation to turn off the lights with no motion on the sensor, after having them switched on via other methods (App, Dimmer Switch, Google Assistant, etc)?

I need the sensors to just turn off the lights, in the event of them having been left on for any reason. Sensors are not meant to turn on the lighs in any case.