Sunrise automation

Hello, could somebody tell me what’s wrong in my code:

- id: '1602004200747'
  alias: Evening-Morning switch lights
  description: Turn ON lights at time if sun below horizon
  trigger:
  - platform: sun
    event: sunset
    offset: -00:45:00
  - platform: time
    at: 06:10:00
  condition: []
  action:
  - service: switch.turn_on
    entity_id:
    - switch.bf4d1031e92d85215ciptn
    - switch.bf1da4e7ab6a06a8c4cynz
    - switch.bfd932f6f240f60ea3xrti
  mode: single
#
- id: '1602004200748'
  alias: Evening-Morning switch lights OFF
  description: Turn OFF lights by time
  trigger:
  - platform: sun
    event: sunrise
    offset: +00:00:00
  - platform: time
    at: '08:30:00'
  - platform: time
    at: '20:45:00'
  condition: []
  action:
  - service: switch.turn_off
    entity_id:
    - switch.bf4d1031e92d85215ciptn
    - switch.bf1da4e7ab6a06a8c4cynz
    - switch.bfd932f6f240f60ea3xrti
    - switch.01005156bcddc26070bc_1
  mode: single

The first part (sunset) works well, but second part doesn’t work with event - sunrise.

you have in the first part:
at: 06:10:00

in the second part:
at: ‘08:30:00’

maybe this is the reason

Try removing this line:

No, I have tested with/without it. I have sat it as an limitation. Because in summer time - sunrise at 4-5am, and goes down about 1-2am, but in winter time sunrise at 10am and sunset about 5pm. So I use OR conditions.

I will try to remove 00:00:00 offset