You can definitely write AND/ORs into SmartApps if you write them yourself. If you look at the sample code they give you, itâs pretty easy to figure out.
Check out my SmartApp named: On when open, then off Sunset/Sunrise only
Itâs in the Shared SmartApps area. It does almost exactly what you want. It looks for open/close after sunset rather than coming home, but should be pretty easy to adapt.
After looking at the dashboard options a little bit, I think you can do this with the built in functions.
Select the light you want to control, then Turn on when people arrive.
Now select which people.
If you scroll down there are options for Turn off after a certain duration.
And further down there are options for times when you want this to happen. The only problem here is you canât specific sunset⊠youâll just have to pick a beginning and ending time. Otherwise I think it fits all your criteria.
I created a cloud application called apilio.io which extends IFTTT and allows you to create the setup you want without coding. Check it out and let me know if it helped!
I may be late to the party on this posting, but here is my CoRE solution. You can substitute anything for the motion sensor in my example, like location or presence.
Before you begin, turn on Advanced Mode by going into Settings->ExpertFeatures->Expert Mode
Many things have changed in the last 4 years including community-created code and official features. You would not need a third party app unless you were trying to communicate with a device that doesnât have SmartThings integration. Otherwise you could do everything the OP asked with WebCore or the Rules API. See the community-FAQ: