Splitting templates

why is this not correct?

  1. i have a folder called: templates.
  2. in the folder “templates” i have two files called: “cover.yaml” and “sensor.yaml”
  3. in configuration.yaml: template: !include_dir_merge_named templates
  4. in cover.yaml :
    cover:
  • name: “OG Rollo Bad Dachfenster (invertiert)”
    unique_id: og_rollo_bad_dachfenster_invertiert
    device_class: blind
    position_template: >
    {% set pos = state_attr(‘cover.og_rollo_bad_dachfenster’, ‘current_position’) | float(0) %}
    {{ 100 - pos }}
    open_cover:
    service: cover.open_cover
    target:
    entity_id: cover.og_rollo_bad_dachfenster
    close_cover:
    service: cover.close_cover
    target:
    entity_id: cover.og_rollo_bad_dachfenster
    stop_cover:
    service: cover.stop_cover
    target:
    entity_id: cover.og_rollo_bad_dachfenster

Why is cover: wrong? in sensor.yaml i start also with “sensor:”. This seens to be OK

Thanks

A template cover is not part of the template integration. It is part of the cover integration.

https://www.home-assistant.io/integrations/cover.template/#configuration

Also in future please format your config correctly for the forum. See: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Next release it will be.

1 Like