RM4 Help Needed

Help needed please chaps,

I have this rule you can see below that plays 2 tracks on my google speaker when I leave home(this part works), what I unable to achieve is getting it to stop playing when the HSM is either armed or dis-armed. If you can suggest a fix or a better way of doing It In 1 rule, then much appreciated.

What happens if you change your second IF
image
to an ELSE-IF.
As I understand it, the second IF will not run if the first IF is false as it will not progress to the second IF.
It will if its an ELSE-IF.
Just my logic and I'm probably wrong but that would be my first thing to try.

Oh and it'd good practice to put and END-IF when you have finished with an expression.

The above understanding is correct. Your second IF is nested inside your first, as you can see from the indentation hints. And ELSE-IF is indeed the best way to fix this, though since HSM states are mutually exclusive, here it would be equivalent to and END-IF followed by a new IF, which is what it appears you were trying to do.

Speaking of equivalence, your trigger could also be just one "changed" trigger instead of specifying individual states since you're already checking for those in your actions (this would save it one comparison and a tiny amount of work, though it shouldn't really matter).

Thank You gentlemen, I have it working well thanks .