HSM strange behavior when arming by RM

Hello ALL,
I have a problem, I'm looking for simple way to arm/ disarm HSM by virtual switch.
I do not get why developers gave us only button option in config. I'm trying to use switch to see straight away HSM option configured on dashboard. One swith for "arm night" and one for "arm away".

So I've creaded 2 virtual switches + for now firs rule for arm night. Idea is to check if status of switches changed (trigger) and then IF night ON AND away OFF (HSM:arm NIGHT). Everything is working till moment when HSM is stuck at "arming night" status. In logs I see that it schould be armed byt in interface it is still "arming". Is that bug or I've made something wrong?