Automation for motion sensor

hey guys I have some lights turned on with a motion sensor and then turn off If no motion detected for a period of time. What I need to do now is to know if the light was trigger by motion or by switch press, and if it is pressed I don’t want the light turn of if no motion detected.
it is possible and someone have a solution for it ? thanks

You can create a Boolean helper that is triggered (set to on) by your motion (and set off when the light is off) and as a condition to run your automation the light should be off OR the helper should be on.

1 Like

Thank you so much I will try to do it.

1 Like

Look at the trigger id Conditions - Home Assistant Trigger id

1 Like