if you use templates, how about reducing conditions in the on
automation to
- condition: template
value_template: >
{{
state_attr('sun.sun', 'elevation') < 0 and
is_state('switch.backyard_lights', 'off')
}}
?
UPDATE: however, it depends on what camp are you in according to this discussion