Not mentioning that values for brightness and kelvin should be in [brackets] and in example on official HA page they are not.
Also if I create new empty automation and click “Edit as YAML” on top right of screen the script looks completelly different than in official documentation. Whole structure is different - looking like this:
The example clearly says “example configuration.yaml entry”
There’s two takeaways from that. First is that it’s an example, and the second is that this particular example would go in the configuration.yaml, but you’re trying to put it in automations.yaml.
Please read up on basic yaml for homeassistant and basic configuration splitting before proceeding.
the YAML you pasted has a few flaws and the documentation is meant for a pure YAML-file configuration with a text editor.
This is not obvious to people that joined after the introduction of the GUI configuration possibilities.
The key automation: is not allowed here since you are already in the context of automations in the GUI.
The key trigger: is missing other keys and values, also the example you are referring to has something in there.
What keeps you from using the GUI editor?
If it’s just the brightness and kelvin options in the action:, you can just edit the action as YAML via the 3-dot menu:
During the copy-paste operation, somehow you lost the example’s trigger section. Without it, the automation monitors nothing so is never activated by anything.