Make Blueprint input section multilingual

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. This would make things easy to translate, self contained and distributable. This would go a long way in unifying the Home Assistant community so that a common code base can be used but extending to multiple languages.

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:
  - set_conversation_response: >-
      {{ translations[language]['responses']['temperature'].replace("{temperature}", state_attr(weather_entity, 'temperature')).replace("{condition}", states[weather_entity].state) }}
    enabled: true
mode: single

And this is what it looks like:

I am unsure how the blueprints are rendered and if this would be possible currently but hopefully the value of doing this will not be lost on the developers. Thanks!

EDIT I am certainly open to any other methods that would allow this to happen but would kindly request that whatever the alternative solution it should allow for the translation dictionary to be included within the blueprint file itself to make distribution and installation as easy as it is now.

Didn’t someone else already explain to you why the templates aren’t working in inputs? Pretty sure I saw this a few days ago and Drew replied to you saying that templates aren’t available for inputs.

EDIT: Oh I see, this is now in feature requests.

1 Like

Correct. I did initially post a message here . I do feel passionate enough about this to make a request that this functionality be added. Perhaps I am in the minority but it does seem to be a feature that would benefit many who use blueprints to distribute automations for use by others who speak different languages.

1 Like

Well, I think a better FR would just be to support multiple languages. Template support would b really odd unless it was limited templates.

I’m certainly fine with that with the caveat that the translation dictionary would be contained within the single blueprint file.

Yah, that would be a must. Or it could be a separate file for each language and the user just chooses the one they want. That would be easier on revisioning for the blueprint and users could create them for you without modifying the blueprint

If clicking the ‘install blueprint’ button also installs the language files then that would be okay. Any manual downloading and placement of files by the user would be problematic for some users.

Duplicate / merge with Localized Blueprints (translating existing) ?