Retrieve the device that triggered the action?

Moving from Webcore I have a number if routines I need to duplicate but don’t see a directly analogous solution.

  1. Random: is it possible to generate a random offset. I use this in a vacation lighting routine, like SUNSET -15 + random(30) would be a time sunset + or - 15 min, which creates some variablity

  2. Random device: given an array of say 3 devices, pick one, again used for some randomization with a vacation routine

  3. Give an OR list of devices ( if light a or light b or light c) turns on the send message light x turned on, where light x is the actual trigger device ( or set a timer or turn off or…)
    This saves me from writing 10 different routines that are essentially the same. Another garage I have is “ if switchA or B or C is double tapped down, Dim that light to 10%”

In the US you can use Alexa Guard to randomly turn lights on and off. I use a virtual switch with an integral contact sensor (call Virtual Alexa Switch in the Groovy days) to turn Alexa Guard on and off via ST when my home mode is set to Away. Not sure if Guard is available in other regions.

1 Like

I’ve tried Alexa guard, they claim it will closely follow my normal usage, but that is not what I have experienced, it seems to turn on the set of lights randomly but not like I would… well after we would normally sleep, lights are coming on and off in the kitchen, bedroom lights on for 10 min then off for 5 then back on for an hour. In Webcore I was able to create several routines that almost exactly mimicked our real behavior when home. I could do without the random devices, but random offset would be very useful

The trigger device ($currentDevice in Webcore) allowed me to create an array of switch’s that If any of them was double tapped down, then set that light at 10%, double tapped up, 100%. This saves me from writing duplicate routines that are essentially identical and manage from like 7 down to 1

1 Like