ST Alarm send repeated text messages

Trying to create a piston that will trigger when my ST alarm goes off and send me repeated txt messages about what sensors are being activated. I have a virtual switch that ST turns on which is what the piston is listening to. I originally tried to use the “switch changes to On” type of logic but it didn’t seem to fire all of the time so I’m using “switch is on” with a blocking variable to keep it from running constantly.

The problem is with the while loop and the device list. I’m experimenting with the motion sensors which is why they are set the “changes to active” instead of “is active”.

When the alarm goes off and the lights all come on like expected, I’ll get anywhere from 4 to 6 text messages for a single motion sensor when it changes to active rather than just a single text like I would expect. Also I don’t get text messages from the other motion sensors when I trigger them. When it was set to is active instead, I would get multiple texts per sensor.

Should I dump the while loop and just use the blocking variable with changes to active / open on the sensors?

Hi wolfman, did you you get the piston to work? I am looking for the same txt message integration.

You are getting multiple texts because of the while loop. It will keep looping and checking those if statements every time. You should probably use the Switch 4 state as a condition check for those if statements instead, then it will only act on those if statements if something actually changes.

Also, as a side note, you’re only allowed 100 texts per day now. It might be better to use push notifications instead if you plan to use looping statements or you could use those up quickly.

Another issue I see is that you are trying to use SHM status as a condition. This is only for the Classic app’s SHM. For the new app’s STHM you will instead have to either use virtual switches or you could use location mode depending on your setup.