Hallo zusammen,
leider komme ich seit Tage nicht mehr weiter.
Wenn ich das im Template-Tester schreibe, bekomme ich rechts das Ergebnis.
sensor:
- name: "Windrichtung"
state: >
states('sensor.wind_direction')|float(0)
{% set direction = ['N','NNO','NO','ONO','O','OSO','SO','SSO','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
{% set degree = states('sensor.windrichtung_ventus')|float %}
{{ direction[((degree+11.25)/22.5)|int] }}
Wenn ich das Template in der yaml file schreibe bekomme ich kein Ergebnis sondern nur eine Fehlermeldung beim Start.
sensor:
- name: "Windrichtung"
- platform: template
sensors: 'Windrichtung_ventus'
value_template: >
{% set direction = ['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
{% set degree = states('sensor.sensor.wind_bearing')|float %}
{{ direction[((degree+11.25)/22.5)|int] }}
Fehlermeldung:
Logger: homeassistant.config
Source: config.py:1293
First occurred: 17:02:13 (2 occurrences)
Last logged: 17:02:13
Invalid config for 'sensor' at configuration.yaml, line 105: required key 'platform' not provided, please check the docs at https://www.home-assistant.io/integrations/sensor
Invalid config for 'sensor' from integration 'template' at configuration.yaml, line 107: expected dictionary for dictionary value 'sensors', got 'Windrichtung_ventus', please check the docs at https://www.home-assistant.io/integrations/template Invalid config for 'sensor' from integration 'template' at configuration.yaml, line 108: 'value_template' is an invalid option for 'template.sensor', check: value_template, please check the docs at https://www.home-assistant.io/integrations/template
Ich bin auch verschiedene Lösungsansätze gefolgt( besonders die vom Orsorkon)
Was mache ich hier falsch? Kann mir bitte einer Helfen?



