Larnak
(Arango)
August 22, 2022, 5:52pm
1
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
browetd
(Browet Didier)
August 22, 2022, 6:18pm
2
Larnak:
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 -%}
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 %}
Larnak
(Arango)
August 22, 2022, 8:33pm
3
Hi thank you for your assitance.
I have the following error when I tried to save
Message malformed: template value should be a string for dictionary value @ data[‘action’][2][‘data_template’]
Larnak
(Arango)
August 22, 2022, 8:37pm
4
Probably to replace : with ’
Larnak
(Arango)
August 23, 2022, 5:18am
5
I have the followin error
myle
(StePhan McKillen (Other kiwi Here))
August 23, 2022, 5:33am
6
What about the shutter card in HACS
It’s best to stay independent and away from HACS imho
Larnak
(Arango)
August 24, 2022, 5:36pm
8
any idea for this error ?
Larnak
(Arango)
September 24, 2022, 1:27pm
9
Hello I didnt find any solution
any help