Hallo,
ich habe meine selbsterstellten Sensoren in die template.yaml ausgelagert und erhalte dazu jetzt eine Fehlermeldung im Log.
Hier die template.yaml:
template:
- sensor:
- name: "input_power_with_efficiency_loss"
unique_id: "input_power_with_efficiency_loss"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: >-
{% set inverter_rating = 10000 %} {# adjust this value to the rated power of your inverter #}
{% set inpower = states('sensor.inverter_input_power')|float(0) %}
{% if inpower < (inverter_rating*0.1) %}
{{ inpower * 0.90 }}
{% elif inpower < (inverter_rating*0.2) %}
{{ inpower * 0.95 }}
{% else %}
{{ inpower * 0.98 }}
{% endif %}
sensor:
- platform: integration
source: sensor.input_power_with_efficiency_loss
name: solar_energy_riemann
round: 3
Und hier die Fehlermeldung:
IInvalid config for 'template' at template.yaml, line 1: 'template' is an invalid option for 'template', check: template Invalid config for 'template' at template.yaml, line 20: 'platform' is an invalid option for 'template', check: sensor->0->platform Invalid config for 'template' at template.yaml, line 20: required key 'state' not provided Invalid config for 'template' at template.yaml, line 21: 'source' is an invalid option for 'template', check: sensor->0->source Invalid config for 'template' at template.yaml, line 23: 'round' is an invalid option for 'template', check: sensor->0->round
Würde mich sehr freuen, wenn ihr mir sagen könntet, wo der Fehler liegt.
VG