Hi,
I need help with this situation. I am trying to format output of my template card based on number of ligths that is on. In my language we are using different form of word for different number of entitities.
if there is 0 or more then 4 we are using one form, if 1 another form, 2-4 another form.
I am trying to format output based on this using if but still getting wrong output syntax wise, could you please help me where the mistake is?
chips:
- type: template
icon: mdi:lightbulb
content: >-
{% set pocet =
expand('light.all_lights')|selectattr('state','eq','on')|list|count %}
{% if pocet == 1 set slovo = 'svetlo' %}
{% elif 5>pocet>1 set slovo = 'svetla' %}
{% else set slovo ='svetiel' %}
{% endif %}
{{' {} {} vypnúť'.format(pocet, slovo) }}