I have been looking for the right solution for a long time and all I find is just not.
I have a switch that I use a motion sensor and that works.
Now I would like, when the lamp is switched on manually or with Google Home, that it stays on. So that the lamp does not switch off with the automation with the motion sensor.
As soon as I turn the lamp off manually again, the lamp then continues on the motion sensor via the automation.
My own approach uses an input boolean controlled by the automation. When the light is turned on automatically, it turns on the boolean. The light is only turned off automatically if the boolean is on.
That avoids any fixed delay, and means that the light turns off X minutes after the last activity.
This is fantastic, this is exactly what I was looking for. It works perfectly! Thank you for the very quick and correct answers. More people will indeed have problems with this. I am sure that with this topic several people have been helped. Thanks again.