Close cover with sun position not working

Hi everybody!

I am having some problems configuring my first automation.
It is basically a very simple task. The blinds on the terrace should go down when the sun reaches the azimuth AND is sunny OR partly cloudy.
In the log file I get this error

Invalid config for [automation]: not a valid value for dictionary value @ data[‘event’]. Got None. (See /config/configuration.yaml, line 9)

secondary problem: the automation is not showing in the configuration card

thank you for your help!

- id: '1623946367722'
  alias: Close blinds with sun
  description: ''
  trigger:
  - platform: sun
    event: azimuth
  condition:
    alias: wather is sunny or partially cloudy
    condition: or
    conditions:
    - condition: state
      entity_id: weather.home
      state: sunny
    - condition: state
      entity_id: weather.home
      state: partlycloudy
  action:
    - service: close_cover
      entity_id: cover.peq1682473
  mode: single

azimuth is an attribute of sun.sun, not a generated event. It contains the current azimuth angle.

Assuming you want this to happen at solar noon, try this:

  trigger:
  - platform: state
    entity_id: sun.sun
    attribute: rising
    to: false

thank you for you fast reply!

now I get this error

Invalid config for [automation]: Service close_cover does not match format . for dictionary value @ data[‘action’][0][‘service’]. Got None. (See /config/configuration.yaml, line 24)

I post you also my config.yaml
line 24 is: group: !include groups.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  name: Casa
  latitude: xxxxx
  longitude: xxxxx
  elevation: 200
  unit_system: metric
  time_zone: "Europe/Vienna"
  external_url: "xxxx"
  internal_url: "xxxx"

# Track the sun
sun:

map:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Yeah sometimes you have to look at the line after, which is the link to your automations file.

It’s complaining about your service call to close the cover.

You have: service: close_cover

It should be: service: cover.close_cover

See: Cover - Home Assistant

Most (all?) services are of the form domain.what_to_do like

light.turn_off
group.turn_off
switch.turn_off