home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.79k stars 28.93k forks source link

`entity_wrong_state` VA error message does not contain translated state #118792

Open tetele opened 1 month ago

tetele commented 1 month ago

The problem

Asking Assist to unpause playback in Romanian in an area where there are no paused devices correctly produces the entity_wrong_state error which the voice satellite plays back.

However, the message contains the untranslated required state (paused) instead of the translated state (în pauză for Romanian).

What version of Home Assistant Core has the issue?

2024.6.0b7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

conversation

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

tage: done
run:
  pipeline: 01gzhn76ggytcfjn84k7nsgyrg
  language: ro
events:
  - type: run-start
    data:
      pipeline: 01gzhn76ggytcfjn84k7nsgyrg
      language: ro
    timestamp: "2024-06-04T11:03:06.706669+00:00"
  - type: wake_word-start
    data:
      entity_id: wake_word.openwakeword
      metadata:
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
      timeout: 5
    timestamp: "2024-06-04T11:03:06.706795+00:00"
  - type: wake_word-end
    data:
      wake_word_output:
        wake_word_id: ok_nabu_v0.1
        wake_word_phrase: ok nabu
        timestamp: 790
    timestamp: "2024-06-04T11:03:08.315612+00:00"
  - type: stt-start
    data:
      engine: stt.home_assistant_cloud
      metadata:
        language: ro-RO
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
    timestamp: "2024-06-04T11:03:08.315747+00:00"
  - type: stt-vad-start
    data:
      timestamp: 1440
    timestamp: "2024-06-04T11:03:09.594611+00:00"
  - type: stt-vad-end
    data:
      timestamp: 1970
    timestamp: "2024-06-04T11:03:10.649189+00:00"
  - type: stt-end
    data:
      stt_output:
        text: Reia redarea.
    timestamp: "2024-06-04T11:03:10.845538+00:00"
  - type: intent-start
    data:
      engine: conversation.home_assistant
      language: ro
      intent_input: Reia redarea.
      conversation_id: null
      device_id: eb1393b150fb2866fbcc50c7b689cd0c
    timestamp: "2024-06-04T11:03:10.845687+00:00"
  - type: intent-end
    data:
      intent_output:
        response:
          speech:
            plain:
              speech: Îmi pare rău, niciun dispozitiv nu este paused
              extra_data: null
          card: {}
          language: ro
          response_type: error
          data:
            code: no_valid_targets
        conversation_id: null
    timestamp: "2024-06-04T11:03:10.963623+00:00"
  - type: tts-start
    data:
      engine: tts.home_assistant_cloud
      language: ro-RO
      voice: AlinaNeural
      tts_input: Îmi pare rău, niciun dispozitiv nu este paused
    timestamp: "2024-06-04T11:03:10.963809+00:00"
  - type: tts-end
    data:
      tts_output:
        media_id: >-
          media-source://tts/tts.home_assistant_cloud?message=%C3%8Emi+pare+r%C4%83u,+niciun+dispozitiv+nu+este+paused&language=ro-RO&voice=AlinaNeural&preferred_format=mp3
        url: >-
          /api/tts_proxy/50efd1e35e6fcd64cac916f321997c10e4fccada_ro-ro_740b68ecc1_tts.home_assistant_cloud.mp3
        mime_type: audio/mpeg
    timestamp: "2024-06-04T11:03:10.964216+00:00"
  - type: run-end
    data: null
    timestamp: "2024-06-04T11:03:10.964455+00:00"
wake_word:
  entity_id: wake_word.openwakeword
  metadata:
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  timeout: 5
  done: true
  wake_word_output:
    wake_word_id: ok_nabu_v0.1
    wake_word_phrase: ok nabu
    timestamp: 790
stt:
  engine: stt.home_assistant_cloud
  metadata:
    language: ro-RO
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  done: true
  stt_output:
    text: Reia redarea.
intent:
  engine: conversation.home_assistant
  language: ro
  intent_input: Reia redarea.
  conversation_id: null
  device_id: eb1393b150fb2866fbcc50c7b689cd0c
  done: true
  intent_output:
    response:
      speech:
        plain:
          speech: Îmi pare rău, niciun dispozitiv nu este paused
          extra_data: null
      card: {}
      language: ro
      response_type: error
      data:
        code: no_valid_targets
    conversation_id: null
tts:
  engine: tts.home_assistant_cloud
  language: ro-RO
  voice: AlinaNeural
  tts_input: Îmi pare rău, niciun dispozitiv nu este paused
  done: true
  tts_output:
    media_id: >-
      media-source://tts/tts.home_assistant_cloud?message=%C3%8Emi+pare+r%C4%83u,+niciun+dispozitiv+nu+este+paused&language=ro-RO&voice=AlinaNeural&preferred_format=mp3
    url: >-
      /api/tts_proxy/50efd1e35e6fcd64cac916f321997c10e4fccada_ro-ro_740b68ecc1_tts.home_assistant_cloud.mp3
    mime_type: audio/mpeg

Additional information

Steps to reproduce:

  1. Start an Assist pipeline in a language that supports media intents, other than English (e.g. Romanian) on a satellite placed in an area where no media_player is paused.
  2. Say/write the phrase which triggers the HassMediaUnpause intent in that language

Expected result: the response error message states that no device is currently paused (using the translation for the state paused).

Actual result: the response is a mixture of the triggering language and English, mentioning the state paused in English.

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/core, @synesthesiam, mind taking a look at this issue as it has been labeled with an integration (conversation) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `conversation` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign conversation` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


conversation documentation conversation source (message by IssueLinks)

synesthesiam commented 1 month ago

It seems that the async_translate_state function is looking in the wrong place for languages other than English. I'm trying to figure out what's going on. For now, we will need to use the untranslated states.