Konnected rules

Hi clever people, me again.
I need some help with my new connected alarm panel, please.
I have made a few virtual switches one to arm the alarm system and one to activate the alarm if needed, I set up a simple basic automation to arm the alarm when the garage is closed and to activate the alarm when motion is detected or if the contact breaks when the alarm is armed, but I can't get the virtual switch to stop the alarm when it has been activated. My virtual switch for the alarm is very buggy, trying to bring all into home kit. Appreciate the help I think you people are great