Not a valid value for dictionary value @ data['action'][0]['entity_id']. Got '{{ trigger.event.data.entity }}'

Thanks Tom, as you probably have figured out, I am not a expert at coding...
I tried replacing with your suggestion and replaced:

entity_id: "{{ trigger.event.data.entity }}"

with:

entity_id: "{{ trigger.event.data..slots[0].value.value }}"

and still have the same message when reloading configuration.yaml

I am sorry I don't understand what you mean by : Also to use a template the key (key: value ) must be under either service: , data: or target: . where do I get this key value ?

I followed that guide word to word but it seems we might have something different on our systems: