FWIW, you could turn those two “simpler” automations into one more compact automation that uses service_template:
- id: pump
alias: Pump
trigger:
platform: state
entity_id: sun.sun, sensor.yr_symbol
action:
service_template: >
{% if states('sun.sun') == 'above_horizon' and
states('sensor.yr_symbol') in ['1', '2'] %}
switch.turn_on
{% else %}
switch.turn_off
{% endif %}
entity_id: switch.courtney_box_fan_
Be aware that the actions will run whenever either sun.sun or sensor.yr_symbol changes in any way (i.e., not just their states, but also their attributes, and sun.sun’s elevation and azimuth attributes change quite often.) But, the switch services do optimize a bit - i.e., trying to turn on a switch that is already on does nothing. Same for turning off. So, depending on what else you have HA doing, you can go with this automation that is a bit more compact, or you can go with the two “simpler” but less compact automations, which also happen to be more efficient (because they only run when the actual states of the sensors change accordingly.)
If it were me, I’d probably go with this last automation (that uses service_template.) BTW, I also wrote it so that you can easily add other sensor.yr_symbol values if you find other ones when you want the pump to run.