Need help debugging this automation

I am configuring my homeassistant run from a venv mostly via the files and not lovelace.
So I just moved all my automations and scripts into seperate files and did the propably usual
automation: !include_dir_merge_list automations trick in my configuration.yaml
This works fine for all automations except one.

For some reason I cannot get rid of the following error in my log:

Invalid config for [automation]: [platform] is an invalid option for [automation]. Check: automation->action->0->platform. (See /root/homeassistant/configuration.yaml, line 92).

I know which file it is from, because it is the only automation not showing up.
I tried a reloading everything and also restarted homeassistant.

This is the exact content of my file

- alias: "Warne mich wenn ich das Haus verlasse und mein Licht noch an ist"
    - platform: state
      from: "home"
      to: "not_home"
      entity_id: device_tracker.nokia_6_2
    - platform: notify.notify
        message: "Hast du vergessen dein licht auszumachen?"

Could someone please enlighten me on where my mistake is, because I am sure it is just something minor I am currently overseeing.

I usually never post on forums, but I am now sitting on this 10 lines of yaml for the past hour and don’t know what to do else.

Okay, I found out what I did wrong.
the correct keyword in action must have been service not platform.

    - service: notify.notify
        message: "Hast du vergessen dein licht auszumachen?"