Sun.sun entity not working

i have a window cover working great with Time. but now, I see it should be better if the automation is based on the sun rise or sunset.

code with Time:

- id: '1572921598489'
  alias: auto window open
  trigger:
  - at: 08:00:00
    platform: time
  action:
  - data:
      entity_id: cover.motorized_blinds
    service: cover.close_cover

changing to sun does not work. what’s the trick?

- id: '1572921598489'
  alias: auto window open
  trigger:
  - entity_id: sun.sun
    from: 'below_horizon '
    platform: state
    to: above_horizon
  action:
  - data:
      entity_id: cover.motorized_blinds
    service: cover.close_cover	

because you have an extra space at the end of below_horizon inside your quotes.

EDIT: Also, why are you using that? Just use the actual sunset/sunrise trigger.

  trigger:
  - platform: sun
    event: sunrise