Detect if light is controlled from app

Hello everyone! Is it possible to detect if a light (or any other device) is being turned on/off bij the app?
I have most of my lights controlled by automations and motion sensors. It works great but sometimes I want to turn my lights on and don’t want them to be turned off again by the automation. It would be great if I can actually detect the action is coming from a user instead of an automation so I can disable some automations for x minutes.

Thanks! :slight_smile: