Let me rephrase that. You took a snippet of valid Home Assistant configuration and added it to the end of your evcc configuration. Hope you can hear the irony in this
What I’ve posted must be part of your Home Assistant configuration. The code must go in a file under <HomeAssistantConfig>/packages/evcc-or-similar-name.yaml
. In order to load that file you need to also enable packages in your <HomeAssistantConfig>/configuration.yaml
. Read:
Related to Packages as a default part of the yaml based configuration