Hey all. My project View Assist extends Assist capabilities through custom sentence blueprints. I would like to make these multilingual but my efforts have not been met with success. I am trying to create a dictionary for each language and having those translations used in the blueprint description, name and other display settings. Unfortunately what I have is showing the JINJA text rather than the expanded variable values. Can someone tell me if what I’m trying to do is possible? This would make things easy to translate and self contained.
Here’s the attempt:
blueprint:
name: View Assist - Multilingual
description: Ask "How's the Weather?" and ViewAssist will respond with the weather and show the weather view (View Assist howstheweather v 1.0.0)
domain: automation
input:
command_prompt:
name: >-
{{ translations[language]['command_prompt']['name'] }}
description: >-
{{ translations[language]['command_prompt']['description'] }}
default: >-
{{ translations[language]['command_prompt']['default'] }}
weather_entity:
name: >-
{{ translations[language]['weather_entity']['name'] }}
description: >-
{{ translations[language]['weather_entity']['description'] }}
selector:
entity:
filter:
- domain: weather
group_entity:
name: >-
{{ translations[language]['group_entity']['name'] }}
description: >-
{{ translations[language]['group_entity']['description'] }}
selector:
entity:
filter:
- domain: group
default: "group.viewassist_satellites"
dashboard:
name: >-
{{ translations[language]['dashboard']['name'] }}
description: >-
{{ translations[language]['dashboard']['description'] }}
default: "/dashboard-viewassist/weather"
alias: View Assist - How's the Weather
description: "Provides information on the current weather and forecast"
trigger:
- platform: conversation
command: !input command_prompt
variables:
language: "es"
group_entity: !input group_entity
weather_entity: !input weather_entity
dashboard: !input dashboard
translations:
en:
command_prompt:
name: "Command Text"
description: "The phrase you want to use to trigger the automation"
default: "(How's | How is | What's | What is) [the] weather"
weather_entity:
name: "Weather Entity"
description: "The entity that provides weather information (example weather.home)"
group_entity:
name: "Group Entity"
description: "The group that holds the list of View Assist satellites (example group.viewassist_satellites)"
dashboard:
name: "Dashboard Weather view"
description: "The View Assist dashboard view to use for weather (example /dashboard-viewassist/weather)"
responses:
temperature: "It's {temperature} degrees and {condition}"
es:
command_prompt:
name: "Texto de comando"
description: "La frase que desea usar para activar la automatización"
default: "(¿Cómo está | Cómo está | ¿Cuál es | Cuál es) [el] clima"
weather_entity:
name: "Entidad meteorológica"
description: "La entidad que proporciona información meteorológica (ejemplo weather.home)"
group_entity:
name: "Entidad de grupo"
description: "El grupo que contiene la lista de satélites de View Assist (ejemplo group.viewassist_satellites)"
dashboard:
name: "Vista del clima en el tablero"
description: "La vista del tablero de View Assist para usar para el clima (ejemplo /dashboard-viewassist/weather)"
responses:
temperature: "Hace {temperature} grados y está {condition}"
condition: []
action:
- variables:
target_satellite_device: |-
{% for sat in expand(group_entity) %}
{% if (device_id(sat.attributes.mic_device) == trigger.device_id) or (device_id(sat.attributes.display_device) == trigger.device_id) %}
{{ sat.entity_id }}
{% endif %}
{% endfor %}
target_display_device: "{{ device_id(state_attr(target_satellite_device, 'display_device')) }}"
target_mediaplayer_device: "{{ state_attr(target_satellite_device, 'mediaplayer_device') }}"
target_satellite_device_type: "{{ state_attr(target_satellite_device, 'type') }}"
enabled: true
- set_conversation_response: >-
{{ translations[language]['responses']['temperature'].replace("{temperature}", state_attr(weather_entity, 'temperature')).replace("{condition}", states[weather_entity].state) }}
enabled: true
- if:
- condition: template
value_template: "{% if target_satellite_device_type != 'audio_only' %}true{% else %}false{% endif %}"
then:
- service: browser_mod.navigate
data:
path: "{{ dashboard }}"
target:
device_id: "{{ target_display_device }}"
enabled: true
mode: single
And this is what it looks like:
Any help would be greatly appreciated. Thanks!