Hi, i am searching now for days… and i can not find the mistake.
when i put in the code below in my configuration.yaml, i get this error message:
´type´
The editor shows on the upper right corner a green hook, so everything seems to be ok…
#sensor:
# Sensor for Riemann sum of energy import (W -> Wh)
- platform: integration
source: sensor.power_import
name: energy_import_sum
unit_prefix: k
round: 2
method: left
# # Sensor for Riemann sum of energy export (W -> Wh)
- platform: integration
source: sensor.power_export
name: energy_export_sum
unit_prefix: k
round: 2
method: left
# # Sensor for Riemann sum of energy consumption (W -> Wh)
- platform: integration
source: sensor.power_consumption
name: energy_consumption_sum
unit_prefix: k
round: 2
method: left
Your comments are all at the wrong indent level for the rest of the code you’re creating.
YAML is indentation sensitive. Additionally, your sensor declaration is commented out.
If this is supposed to be your entire sensor declaration going directly into the configuration.yaml then it should look like this:
sensor:
# Sensor for Riemann sum of energy import (W -> Wh)
- platform: integration
source: sensor.power_import
name: energy_import_sum
unit_prefix: k
round: 2
method: left
# Sensor for Riemann sum of energy export (W -> Wh)
- platform: integration
source: sensor.power_export
name: energy_export_sum
unit_prefix: k
round: 2
method: left
# Sensor for Riemann sum of energy consumption (W -> Wh)
- platform: integration
source: sensor.power_consumption
name: energy_consumption_sum
unit_prefix: k
round: 2
method: left
Yaml is insensitive to comment indentation. The only place you can come unstuck in in template blocks or keys where you have to use {# example comment here #}