Change a boolean helper via external switch

Hello there,

I have a problem and I am not sure how to solve it.

The light in my rooms will be activated by a motion sensor and after a certain time deactivated. I have solved this with two automation (on/off). This is in most cases good, but sometime the light should be on for longer.

My thought was to use a boolean helper, which is triggered by a wall switch. When I press the button, the light should go on and the boolean helper should toggle to “on”. This should than be an addition condition for the “off automation of the motion sensor”.

When I set the boolean helper via lovelace it wrks perfect. But I am not able to change it via wall switch.

Do you have any idea how I realize this via automation? Right now I am using “condition” as action…