Can someone help me on templates

I wrote this on to add subtract sensor data… tested it on developer tools template… gives a value… finaly pasted it on sensors.yaml and I get error…

- platform: template

  sensors:

    ExportEnergy:

      unit_of_measurement: 'kWh'

      friendly_name: 'Export Energy'

      value_template: >

        {{ (states('sensor.solar_1_8kW') | float) +

           (states('sensor.solar_1_92kW') | float) -

           (states('sensor.aircon') | float) -

           (states('sensor.ricecooker') | float) }}

heres the error from developer tools YAML.

Invalid config for [sensor.template]: invalid slug ExportEnergy (try exportenergy) for dictionary value @ data['sensors']. Got OrderedDict([('ExportEnergy', OrderedDict([('unit_of_measurement', 'kWh'), ('friendly_name', 'Export Energy'), ('value_template', "{{ (states('sensor.solar_1_8kW') | float) +\n (states('sensor.solar_1_92kW') | float) -\n (states('sensor.aircon') | float) -\n (states('sensor.ricecooker') | float) }}\n")]))]). (See ?, line ?).

hope someone can enlighten me… Im new to Home assistant… thanks…

The error is telling you what to do

thanks… I did try to change the name to something else before but somehow now it works… thanks alot…

No capitals in the slugs, that’s the issue