language: sl responses: intents: HassGetState: default: "{{ state.state_with_unit | replace('.', ',') }}" # Uporabi vejico namesto pike # the number of names returned is limited to 4, in case there are more, the first 3 names and the remaining count is returned # with 4 names or less, the names are joined with a comma ", " and the last name is joined with " and " one: | {{ slots.name | capitalize }} je {{ state.state_with_unit }} # one_sensor for SL variation one_sensor: | {{ slots.device_class }} {{ slots.name | capitalize }} je {{ state.state_with_unit }} one_yesno: | {% if query.matched: %} Da {% else: %} Ne, {{ state.state_with_unit }} {% endif %} any: | {% if query.matched %} {% set match = query.matched | map(attribute="name") | sort | list %} {% if match | length > 4 %} Da, {{ match[:3] | join(", ") }} in še {{ (match | length - 3) }} {%- else -%} Da, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor -%} {% endif %} {% else %} Ne {% endif %} #any_bs is for SL variation of response any_bs: | {% if query.matched %} {% set match = query.matched | map(attribute="name") | sort | list %} {% if match | length > 4 %} Da, {{ match[:3] | join(", ") }} in še {{ (match | length - 3) }} {%- else -%} Da, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor -%} {% endif %} {% else %} Ne {% endif %} all: | {% if not query.unmatched: %} Da {% else %} {% set no_match = query.unmatched | map(attribute="name") | sort | list %} Ne, {% if no_match | length == 2 %} nista {%- elif no_match | length > 2 %} niso {%- else -%} ni {% endif %} {% for name in no_match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor %} {% endif %} # all_bs is SL variation of response all_bs: | {% if not query.unmatched: %} Da {% else %} {% set no_match = query.unmatched | map(attribute="name") | sort | list %} Ne, {% if 'vrata' in no_match %} {{ no_match[:-1] | join(' ') }} niso {%- else %} {{ no_match[-1] }} ni {% endif %} {% for name in no_match[0:-1] -%} {% if not loop.first %}, {% endif -%} {{ name }} {%- endfor %} {% endif %} which: | {% if not query.matched %} Ni {{ slots.state[:-1]}}ih {{ slots.device_class[:-1] }}a {% else: %} {% set match = query.matched | map(attribute="name") | sort | list %} {% if match | length > 4 %} {{ match[:3] | join(", ") }} in še {{ (match | length - 3) }} drugih. {% else %} {%- for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor -%} {% endif %} {% endif %} # which_bs is SL variation of response which_bs: | {% if not query.matched %} Noben {% else: %} {% set match = query.matched | map(attribute="name") | sort | list %} {% if match | length > 4 %} {{ match[:3] | join(", ") }} in še {{ (match | length - 3) }} drugih. {% else %} {%- for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor -%} {% endif %} {% endif %} # which_bs_opening is SL variation of response which_bs_opening: | {% if not query.matched %} Nič {% else: %} {% set match = query.matched | map(attribute="name") | sort | list %} {% if match | length > 4 %} {{ match[:3] | join(", ") }} in še {{ (match | length - 3) }} drugih. {% else %} {%- for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} in {% endif -%} {{ name }} {%- endfor -%} {% endif %} {% endif %} how_many: | {{ query.matched | length }} where: | {% if state == "not_home" %} {{ slots.name | capitalize }} ni doma {% else %} {{ slots.name | capitalize }} je {{ state.state }} {% endif %} # sensor_value is SL variation of response for sensor sensor_value: | Vrednost senzorja je {{ state.state_with_unit | replace('.', ',') }} sensor_value_temperature: | Temperatura je {{ state.state_with_unit | replace('.', ',') }}