Not sure this is even possible, or if ST is the way to do it, but let’s say for example my arrival time from work varies day to day due to traffic, varying work load etc… But I want to have Alexa playing my favorite music in the living room when I walk in the door from work.
It’s either pretty easy or very hard, depending on. The exact details.
If it’s an echo action that you can do through an echo routine (not a SmartThings routine) then it’s pretty easy. You just have your arrival turn on a virtual switch and that virtual switch coming on will cause an echo routine to run. See the community FAQ on this:
But if it’s something that you can’t to do with an echo routine, it gets much harder.
So start by figuring out whether you can play the music you want with an echo routine:
You can do this natively in the Alexa app, with no ST involvement, using an Echo routine based on “this device arrives / leaves a location”. Then Alexa is using your phone’s GPS (and maybe WiFi?) to determine your arrival.
You can also do it via ST if you want to add more conditions - for instance, if you don’t want to miss your favorite song while you’re walking from the driveway to the front door, you can create a routine/automation that “arms” ST when you arrive by turning on virtual switch A, and then create a second automation that will open virtual contact sensor B when you open the front door, but only if switch A is on (then turns off switch A and closes contact sensor B after a delay), and create an Echo routine that plays the song when that contact sensor opens.
As JD said, it can be easy or hard depending on exactly what you want to do…