Script/Automation With Boolean Check

I have scripts that turn on the lights and plugs. It is triggered by automation whenever person arrives home. However, I only want to turn on the lights after sunset. If person arrives home before sunrise, just turn on the plugs.

I am wondering if this can be done within just one automation instead of creating 2 automations (1 for condition sun.above_horizon and 1 for condition sun.below_horizon). Is this possible with just one automation?

Yes it is particularly easy since Phil’s recent and comprehensive overhaul of scripts (or action in automations). See: