If you don't want the motion to be active, you have to deactivate the SW input with an action command (Detached) and reactivate it vice versa.
This could work. I believe I can only set both switches to detached mode, which means the whole ON/OFF control must be handled externall, in homeassistant.
Thanks