Skip to content

Error: TTS message using pt-BR pronunciation renders accented words incorrectly via notify.send_message #146665

Closed as duplicate of#146552
@alexandre-leites

Description

@alexandre-leites

The problem

When sending a TTS message in Brazilian Portuguese (pt-BR) using the notify.send_message service (e.g., via alexa_media_player), Alexa mispronounces common accented words like "não", "máquina", and others.

Attempting to wrap the message in SSML with a tag does not correct the pronunciation.

This appears to be an encoding or voice-selection issue in how the TTS engine handles non-English characters when triggered via the notify service.

Minimal example:

- service: notify.send_message
  data:
    message: >-
      <speak><lang xml:lang="pt-BR">Ei! A máquina terminou. Não esqueça de tirar a roupa!</lang></speak>
  target:
    entity_id: notify.alexa_sala

Expected result:
Alexa should pronounce the message naturally in Brazilian Portuguese, including accented characters like "máquina" and "não".

Actual result:
Alexa says the message in Portuguese but fails at accented characters saying something else

What version of Home Assistant Core has the issue?

2025.6.0

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

alexa_devices

Link to integration documentation on our website

https://www.home-assistant.io/integrations/amazon_devices/

Diagnostics information

No response

Example YAML snippet

- service: notify.send_message
  data:
    message: >-
      <speak><lang xml:lang="pt-BR">Ei! A máquina terminou. Não esqueça de tirar a roupa!</lang></speak>
  target:
    entity_id: notify.alexa_sala

Anything in the logs that might be useful for us?

Logger: homeassistant.util.loop
Source: util/loop.py:137
First occurred: 6:22:27 PM (2 occurrences)
Last logged: 6:22:27 PM

    Detected blocking call to listdir with args ('/usr/local/lib/python3.13/site-packages/babel/locale-data',) inside the event loop by integration 'alexa_devices' at homeassistant/components/alexa_devices/notify.py, line 74: await self.entity_description.method(self.coordinator.api, self.device, message) (offender: /usr/local/lib/python3.13/site-packages/babel/localedata.py, line 93: (os.path.splitext(filename) for filename in os.listdir(_dirname))), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+alexa_devices%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 57, in get return await WebSocketHandler(request.app[KEY_HASS], request).async_handle() File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 352, in async_handle await self._async_websocket_command_phase(connection) File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 515, in _async_websocket_command_phase async_handle_str(command_msg_data) File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 237, in async_handle handler(self.hass, self, schema(msg)) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 69, in with_admin func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 47, in schedule_handler hass.async_create_background_task( File "/usr/src/homeassistant/homeassistant/core.py", line 862, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 823, in handle_execute_script script_result = await script_obj.async_run( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1836, in async_run return await asyncio.shield(create_eager_task(run.async_run())) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1013, in _async_step_call_service self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call task = hass.async_run_hass_job(job) File "/usr/src/homeassistant/homeassistant/core.py", line 941, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 756, in _async_add_hass_job task = create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 166, in _async_send_message await self.async_send_message(**kwargs) File "/usr/src/homeassistant/homeassistant/components/alexa_devices/notify.py", line 74, in async_send_message await self.entity_description.method(self.coordinator.api, self.device, message)
    Detected blocking call to open with args ('/usr/local/lib/python3.13/site-packages/babel/global.dat', 'rb') inside the event loop by integration 'alexa_devices' at homeassistant/components/alexa_devices/notify.py, line 74: await self.entity_description.method(self.coordinator.api, self.device, message) (offender: /usr/local/lib/python3.13/site-packages/babel/core.py, line 100: with open(filename, 'rb') as fileobj:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+alexa_devices%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 57, in get return await WebSocketHandler(request.app[KEY_HASS], request).async_handle() File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 352, in async_handle await self._async_websocket_command_phase(connection) File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 515, in _async_websocket_command_phase async_handle_str(command_msg_data) File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 237, in async_handle handler(self.hass, self, schema(msg)) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 69, in with_admin func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 47, in schedule_handler hass.async_create_background_task( File "/usr/src/homeassistant/homeassistant/core.py", line 862, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 823, in handle_execute_script script_result = await script_obj.async_run( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1836, in async_run return await asyncio.shield(create_eager_task(run.async_run())) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1013, in _async_step_call_service self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call task = hass.async_run_hass_job(job) File "/usr/src/homeassistant/homeassistant/core.py", line 941, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 756, in _async_add_hass_job task = create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 166, in _async_send_message await self.async_send_message(**kwargs) File "/usr/src/homeassistant/homeassistant/components/alexa_devices/notify.py", line 74, in async_send_message await self.entity_description.method(self.coordinator.api, self.device, message)

Additional information

Of course, I tried without the tags first, then I tried with the tag to force the language, both have the same output.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions