Automation to turn on lights if someone is home or comes home

At the moment I use Presence-based Lights:

The disadvantage of this is that there is little to adjust, for example I prefer to have the lights on half an hour earlier. I’ve tried to create an automation but I can’t use a group with location trackers like I have now. I can’t find any examples/blueprints either.

So I would like:

Turn on the lights when the sun is setting (with offset) and there are people home.

Turn on the lights when people get home after the sun has set.

I don’t need a ready-made example, but maybe someone can point me in the right direction.

combine a proximity sensor with sun