Can I remove select words from a variable/expression?


#1

1) Give a description of the problem

I like to give my devices labels in ST so they are grouped together. I’ve done this with Life360, and would like to do it with locations too, in preparation for making a piston telling me who is where. I wrote a piston that checks each Life360 device variable, and rewrites the variable without the “Life360”. I was just wondering if there’s a way to automate the process so I don’t have to write a piston for each person. I intend to do this with places that will become virtual switches, each starting with the label LOCATION.


#2

If I’m understanding the target correctly…
replace(string,“Life 360 “,””) would remove that from the string.


#3

Thanks, I’ll try that!

[EDIT] Hmmm…I guess “replace” isn’t a command under location. How would I incorporate that?

[EDIT] Ah, found this thread that you commented in: Replace works sort of

[EDIT] Figured it out! Thanks!!!