Cover percentage

Hello

I tried to implement a slider on covers based on the current positions :

service: cover.set_cover_position
target:
entity_id: cover.volet_salon
data_template:
position: >
{% if state_attr(‘cover.volet_salon’, ‘current_position’) < 95 %}
{ {state_attr(‘cover.volet_salon’, ‘curent_position’ | int + 5}
{% endif -%}

but I doesnt work

Thank you for your help

Please use the right format, indentation is very important to detect any problem.
You are missing a “)” and a “}” at the line “state_attr”…
What is the value when the position is greather than 95 ? 100 ? So add a {%else%} 100…
Try this

  service: cover.set_cover_position
  target:
    entity_id: cover.volet_salon
  data_template:
    position: >
        {% if state_attr(‘cover.volet_salon’, ‘current_position’) < 95 %}
             {{state_attr(‘cover.volet_salon’, ‘curent_position’) | int + 5}}
        {% else %}
             100
        {% endif %}

Hi thank you for your assitance.

I have the following error when I tried to save :slight_smile:
Message malformed: template value should be a string for dictionary value @ data[‘action’][2][‘data_template’]

Probably to replace : with ’

I have the followin error

What about the shutter card in HACS

It’s best to stay independent and away from HACS imho

any idea for this error ?

Hello I didnt find any solution
any help