Template if states

Hi all, whoever gives me a hand to complete this template. When it’s open it gives me on or off
Thanks

{% if states("cover.velux_bagno")}
 on
{% else %}
 off
{% endif %}

Not 100% sure what you want to achieve … but:

{% if states("cover.velux_bagno") == "open" %}
 on
{% else %}
 off
{% endif %}

or

{% if states("cover.velux_bagno") == "on" %}
 open
{% else %}
 closed
{% endif %}

Thank you very kind