language: fr responses: intents: HassGetState: # 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 " default: | {{ state.state_with_unit }} one: | {{ slots.name | capitalize }} est {{ state.state_with_unit }} one_yesno: | {% if query.matched %} Oui {% else %} Non {% endif %} any: | {% if query.matched %} {% set match = query.matched | map(attribute="name") | sort | list %} {% set count_match = no_match | length | int %} {% if match | length > 4 %} Oui, {{ match[:3] | join(", ") }} et {{ (match | length - 3) }} autres {% elif match | length == 1 %} Oui, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} est {{ state.state_with_unit }} {%- else -%} Oui, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} sont {{ state.state_with_unit }} {% endif %} {% else %} Non {% endif %} any_short: | {% if query.matched %} {% set match = query.matched | map(attribute="name") | sort | list %} {% set count_match = no_match | length | int %} {% if match | length > 4 %} Oui, {{ match[:3] | join(", ") }} et {{ (match | length - 3) }} autres {% elif match | length == 1 %} Oui, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} {%- else -%} Oui, {% for name in match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} {% endif %} {% else %} Non {% endif %} any_super_short: | {% if query.matched %} Oui {% else %} Non {% endif %} all: | {% if not query.unmatched: %} Oui {% else %} {% set no_match = query.unmatched | map(attribute="name") | sort | list %} {% set count_match = no_match | length | int %} {% if no_match | length > 4 %} Non,pas {{ no_match[:3] | join(", ") }} et {{ (no_match | length - 3) }} autres {% elif no_match | length == 1 %} Non, pas {% for name in no_match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {%- endfor %} {%- else -%} Non, pas {% for name in no_match -%} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {%- endfor %} {% endif %} {% endif %} all_super_short: | {% if not query.unmatched: %} Oui {% else %} Non {% endif %} which: | {% if not query.matched %} Aucun appareil {% else: %} {% set match = query.matched | map(attribute="name") | sort | list %} {% set count_match = match | length | int %} {% if match | count > 4 %} {{ match[:3] | join(", ") }} et {{ (match | length - 3) }} autres {% elif match | count == 1 %} {% for name in match %} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} est {{ state.state_with_unit }} {% else %} {% for name in match %} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} sont {{ state.state_with_unit }}s {% endif %} {% endif %} which_person: | {% if not query.matched %} Personne {% else: %} {% set match = query.matched | map(attribute="name") | sort | list %} {% set count_match = match | length | int %} {% if match | count > 4 %} {{ match[:3] | join(", ") }} et {{ (match | length - 3) }} autres {% elif match | count == 1 %} {% for name in match %} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} {% else %} {% for name in match %} {% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} et {% endif -%} {{ name }} {% endfor %} {% endif %} {% endif %} how_many: | {{ query.matched | length }} where: | {% if state == "not_home" %} {{ slots.name | capitalize }} est absent(e) {% else %} {{ slots.name | capitalize }} est dans la zone {{ state.state }} {% endif %} # Binary Sensor Device Class specific responses all_windows: | {% if not query.unmatched: %} Oui {% else %} {% set count_no_match = query.unmatched | length | int %} {% if count_no_match == 1 %} Non, une fenêtre n'est pas {{ slots.state }} {%- else -%} Non, {{count_no_match}} fenêtres ne sont pas {{ slots.state }} {% endif %} {% endif %} any_windows: | {% if query.matched %} {% set count_match = query.matched | length | int %} {% if count_match == 1 %} Oui, une fenêtre est {{ slots.state }} {%- else -%} Oui, {{count_match}} fenêtres sont {{ slots.state }} {% endif %} {% else %} Non {% endif %} all_doors: | {% if not query.unmatched: %} Oui {% else %} {% set count_no_match = query.unmatched | length | int %} {% if count_no_match == 1 %} Non, une porte n'est pas {{ slots.state }} {%- else -%} Non, {{count_no_match}} portes ne sont pas {{ slots.state }} {% endif %} {% endif %} any_doors: | {% if query.matched %} {% set count_match = query.matched | length | int %} {% if count_match == 1 %} Oui, une porte est {{ slots.state }} {%- else -%} Oui, {{count_match}} portes sont {{ slots.state }} {% endif %} {% else %} Non {% endif %} all_garage_doors: | {% if not query.unmatched: %} Oui {% else %} {% set count_no_match = query.unmatched | length | int %} {% if count_no_match == 1 %} Non, une porte de garage n'est pas {{ slots.state }} {%- else -%} Non, {{count_no_match}} portes de garage ne sont pas {{ slots.state }} {% endif %} {% endif %} any_garage_doors: | {% if query.matched %} {% set count_match = query.matched | length | int %} {% if count_match == 1 %} Oui, une porte de garage est {{ slots.state }} {%- else -%} Oui, {{count_match}} portes de garage sont {{ slots.state }} {% endif %} {% else %} Non {% endif %}