Hey guys, im have some hard times with one of the param of a template cover. Im using shelly for controlling my covers, and im trying to do a template cover, where the original cover entitys position 1-25% is defined as 1% in the template cover, and the 26-100 percent is the other 99. I need that because the shelly calibration is don’t take in consideration the roller blinds holes (between the bars) that take some time to close.
So, my problem is that the set_cover position not working properly.
cover:
- platform: template
covers:
nappali2redony:
device_class: shutter
friendly_name: "tesztredőny"
unique_id: "nappali2redony"
value_template: "
{% if state_attr('cover.shellyswitch25_b89f26','current_position') | int==0 %}
closed
{%else%}
open
{%endif%}"
position_template: "
{% if state_attr('cover.shellyswitch25_b89f26','current_position') | int==0 %}0
{% elif state_attr('cover.shellyswitch25_b89f26','current_position') | int<26 %}1
{%else%}
{{ ((state_attr('cover.shellyswitch25_b89f26','current_position')-25)/(100-25) *100) | round(0)}}
{%endif%}"
open_cover:
service: cover.open_cover
data: {}
target:
entity_id: cover.shellyswitch25_b89f26
close_cover:
service: cover.close_cover
data: {}
target:
entity_id: cover.shellyswitch25_b89f26
stop_cover:
service: cover.stop_cover
data: {}
target:
entity_id: cover.shellyswitch25_b89f26
set_cover_position:
service: cover.set_cover_position
data:
position: "{{position}}"
target:
entity_id: cover.shellyswitch25_b89f26
With that config the slider (or simply call the service) act as the original cover. How should i change that to work with the positions i set in the template?