I learned today, via a campaign by the local aviary, that electric lights after sundown can confuse birds in migration. The very first thing I ever did with Home Assistant was to automate my exterior lights to turn on at sundown and turn off at sunrise. Not wanting to confuse the birds further, I modified my exterior lights to only turn on outside of the migration months of March-May & August-October. Then I changed my exterior lights to react to door openings & motion instead of being on all the time during those months.
- alias: Light Sunset Exterior On
trigger:
platform: sun
event: sunset
condition:
- condition: template
value_template: '{{ now().month in [1, 2, 6, 7, 11, 12] }}'
action:
service: homeassistant.turn_on
entity_id:
- light.porch
- light.kitchen_patio
- light.office_door
- light.mud_room_door
- light.laundry_door
- light.garage_east_door
- switch.landscape_lights
- switch.rear_deck_north_outlet
- alias: Light Sunrise Exterior Off
trigger:
platform: sun
event: sunrise
action:
service: homeassistant.turn_off
entity_id:
- light.porch
- light.kitchen_patio
- light.office_door
- light.mud_room_door
- light.laundry_door
- light.garage_east_door
- switch.landscape_lights
- switch.rear_deck_north_outlet
- alias: Light Porch Motion On
trigger:
platform: state
entity_id:
- binary_sensor.porch_motion_detected
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: sun.sun
state: "below_horizon"
- condition: state
entity_id: light.porch
state: 'off'
action:
- service: light.turn_on
entity_id:
- light.porch
- delay: '00:05:00'
- service: light.turn_off
entity_id:
- light.porch
- alias: Light South Kitchen Door
trigger:
platform: state
entity_id:
- binary_sensor.kitchen_south_door
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: light.kitchen_south_door
state: 'off'
action:
- service: light.turn_on
entity_id:
- light.kitchen_south_door
- delay: '00:05:00'
- service: light.turn_off
entity_id:
- light.kitchen_south_door
- alias: Light Kitchen Patio
trigger:
platform: state
entity_id:
- binary_sensor.kitchen_deck_door
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: light.kitchen_patio
state: 'off'
action:
- service: light.turn_on
entity_id:
- light.kitchen_patio
- service: switch.turn_on
entity_id:
- switch.rear_deck_north_outlet
- switch.landscape_lights
- delay: '00:05:00'
- service: light.turn_off
entity_id:
- light.kitchen_patio
- service: switch.turn_off
entity_id:
- switch.rear_deck_north_outlet
- switch.landscape_lights