I’ve been racking my brain about creating a simple sensor which adds up the current consumption of my smart lights. However the Home Assistant keeps informing me that the configuration is wrong and throws several error messages.
Been looking through forums and posts but can’t seem to resolve it
Below is my config, what am I doing wrong?
sensor:
- platform: template
sensors:
energieverbruik_totaal:
friendly_name: 'Energie Verbruik (Totaal)'
entity_id:
- sensor.eetkamer_1_current_consumption
- sensor.eetkamer_2_current_consumption
- sensor.eetkamer_3_current_consumption
- sensor.eetkamer_4_current_consumption
- sensor.eetkamer_5_current_consumption
- sensor.eetkamer_6_current_consumption
value_template: "{{ states("sensor.eetkamer_1_current_consumption") |float + states("sensor.eetkamer_2_current_consumption") | float + states("sensor.eetkamer_3_current_consumption") | float + states("sensor.eetkamer_4_current_consumption") | float+ states("sensor.eetkamer_5_current_consumption") | float+ states("sensor.eetkamer_6_current_consumption") | float}}"
unit_of_measurement: "kWh"
On the code at the top, I get this error message:
can not read a block mapping entry; a multiline key may not be an implicit key at line 47, column 26:
unit_of_measurement: “kWh”
^
If I remove the unit_of_measurement I get the following error message:
can not read an implicit mapping pair; a colon is missed at line 46, column 372:
… current_consumption") | float}}"
^