Component error: sensors - Integration 'sensors' not found

Hello,

I’m new in home assist and integration as i like looks ok. now i start programming things and first i try is my solaredge integration https://www.home-assistant.io/integrations/solaredge/ and try to convert the values to kWh. I follow the example and configure looks like:

sensors:
platform: template
sensors:
solaredge_energy_this_year_template:
value_template: “{{ (states(‘sensor.solaredge_energy_this_year’) | float / 1000) | round(2) }}”

But then when I check configuration I get failure:
Component error: sensors - Integration ‘sensors’ not found.

What do I do wrong?

Thanks in advance

Wilfried

First, from now on you need to make sure you format your code to display the syntax correctly. put ``` before and after the code.

but this is an easy one. remove the exztra ‘s’ in sensors:

sensor:  #<--from here
  platform: template
  sensors:
    solaredge_energy_this_year_template:
    value_template: “{{ (states(‘sensor.solaredge_energy_this_year’) | float / 1000) | round(2) }}”

Dear Finity,

Thanks and yes it is working now. i did copy sensors including the s. Removed the s and it works thanks.
But as i now i like to change the name in the front-end and therefore i like to use a friendly name as follows:

sensor:
platform: template
sensors:
solaredge_energy_this_year_template:
friendly_name: “solaredge opbrengst dit jaar in Kwh”
value_template: “{{ (states(‘sensor.solaredge_energy_this_year’) | float / 1000) | round(2) }}”

this as i read on https://www.home-assistant.io/integrations/template:

friendly_name string (optional)
Name to use in the frontend.

But i don’t see a change in the front end.

First, you still didn’t format your code correctly again.

Did you restart HA after the change?

Where “in the frontend” are you looking?

Dear Finity,

I know. i learn and in future i will do like this:

sensor:
  platform: template
  sensors:
    solaredge_energy_this_year_template:
          friendly_name: "solaredge opbrengst dit jaar in Kwh"
          value_template: "{{ (states('sensor.solaredge_energy_this_year') | float / 1000) | round(2) }}"

For some reason i did restart and in the lovelace the friendly name wasn’t visible. now i look again and it is ok. maybe page refresh thing :frowning:

Thanks for help. in short time i understand what i do and can program my home assistant