My welcome home piston is one of my more complex ones. It triggers when either my phone or my wife’s phone changes from away to present, or when the side door lock is unlocked using a valid code. It unlocks the side door and front door, turns on the front porch lights and side porch lights if it’s dark out, and disarms the alarm if it was armed. Because presence isn’t always 100% reliable, if neither the front door or back door are opened within 4 minutes of the piston triggering, it locks everything back up and re-arms the alarm (if it was armed). Once an exterior door does open, it has a wide variety of responses depending on which presence sensors arrived, what mode the home was in, what time of day it is, and whether or not the house was determined to be occupied or not prior to the piston triggering. Some actions include broadcasting customized welcome home messages though Alexa devices, playing various music playlists in certain rooms, starting Harmony routines that turn a TV on and set it to a specific streaming service or channel, turning on a series of dim night lighting if it’s late at night and dark in the house, changing the mode, turning on and adjusting thermostats, etc. If the porch lights were turned on by the piston, they wait until 15 min after the exterior door closes and then turn back off. If the night lighting was turned on, they wait until there’s been 10 min without motion in the rooms each light is in and then turn off. There’s a timer component that won’t allow the piston to trigger if the presence sensor that triggered it hasn’t been away for at least 10 min. This prevents minor glitches with presence from falsely triggering.