Good night - Deactivate motion sensor with a Xiaomi Button

I’m trying to deactivate the presence/motion sensor using a Xiaomi Zigbee button.
I can listen to the event of the pushed button but as it has no state i don’t know how to accomplish my goal.

I do not want to deactivate the sensor itself but the node-red automation i’m doing.

I think the easiest way is to have some kind of a state, but i dont know how.

Thanks for you help!

You can turn an automation off and on.