If Smart Lighting is doing what you want, then great! You can probably ignore this wall of text I’m about to post.
If you’re curious, though. Here’s how I have things set up at home. Having Routines controlling these things allows for some more flexibility, as I can trigger things other than lights when I arrive after sunset. This text is lifted from the good old days when I was in Support, so excuse me for over-explaining things. heh
First, a brief overview of Routines and Modes:
Tap the check mark with the circle going around it.
Here, you should see some Routines:
Tapping Good Night! will change the mode to “Night”.
Tapping Goodbye! will change the mode to “Away”.
Tapping I’m back! will change the mode to “Home”.
Tapping Good Morning! will also change the mode to “Home”.
You can add in more automations to your routines by tapping the gear icon at the top right of each routine. At the bottom, you can see a section for “Automatically performing” your routine.
You can add a new routine by tapping the icon at the top right and tapping “Add Routine”.
A mode filter can be used so certain actions only fire when in a certain mode, or in some cases so that certain actions only fire when not in a certain mode.
To add a new mode, tap the icon at the top right and then tap "My Locations"
Tap the gear icon for your location
Scroll down and tap “Add a new Mode”
For this, you’ll want to add two new modes: Home PM and Away PM. That’s what I call 'em anyways. It really doesn’t matter.
Now you’ll need to add some new routines. Assuming you’ve already set up Goodbye! and I’m Back! to automatically fire with respect to the arrival and leaving of your chosen presence sensor, we can move to the next steps. As you remember, Goodbye! will change the mode to “Away”", and I’m back! will change the mode to Home. Now, you’ll want to add two more routines. Again, feel free to use whatever naming convention you like, but mine are called Goodbye PM and I’m Back PM. These actions change the mode to “Away PM” and “Home PM” respectively using the same presence triggers.
When editing the “Automatically perform” section of the routine, you’ll notice a section that says “Don’t automatically do this if I am in one of these modes”.
Goodbye! should only be set to fire when you’re in Home mode. Therefore you’ll want to tell it not to happen in Home PM, Away, Away PM, or Night mode.
I’m back! should be set to not fire if you’re in Away PM, or Home PM mode.
Goodbye PM should only be set to fire if you’re in Home PM mode, so check all the others
I’m back PM should only be set to fire if you’re in Away PM mode (and Home PM mode if necessary for your setup).
Still with me? Good!
You’ll need a couple of more actions. These will change Away to Away PM at sunset and Home to Home PM at Sunset.
I call mine Home to Home PM and Away to Away PM, but feel free to get creative with the names. One is set to change the mode to Home PM at Sunset, but only when already in Home mode. The other is set to change the mode from Away to Away PM at sunset only when already in Away mode.
The last things you’ll need to do is find a way to go from Home PM to Home, or to go from Away PM to Away if you happen to be gone all night.
For me, I go through Night mode using Good Night between Home PM and Home, but I think you should have all the tools you need to get this working well for you.
After all of this, you can set I’m Back PM to turn on a light. Using this logic, it’ll only happen after sunset.