I created a template for a cover. Home assistant is telling me that the position is unknown in my dashboard. This is the code that I have:
- platform: template
covers:
danielle_s_shades:
friendly_name: Danielle's shade
position_template: >-
{% set p = 100 - (state_attr('cover.danielles_shades_window_covering', 'current_position') | int)%}
{% if p > 11 %} p
{% else %} 0
{% endif %}
open_cover:
service: cover.open_cover
data:
entity_id: cover.danielles_shades_window_covering
close_cover:
service: cover.close_cover
data:
entity_id: cover.danielles_shades_window_covering
stop_cover:
service: cover.stop_cover
data:
entity_id: cover.danielles_shades_window_covering
set_cover_position:
service: cover.set_cover_position
data:
entity_id: cover.danielles_shades_window_covering
position: "{{ 100 - (position) }}"
What am I doing wrong?