『瀚思彼岸』» 智能家居技术论坛

标题: 现在还有用小度音箱tts的吗?或者小雅音箱 [打印本页]

作者: norikohxb    时间: 2025-8-12 10:24
标题: 现在还有用小度音箱tts的吗?或者小雅音箱
现在还有用小度音箱tts的吗?或者小雅音箱

官方版本升级以后,小度音箱的tts就不能用,都是结巴的朗读。而且会无限循环重复。
小雅有的版本也是
群里面现在还有在用小度音箱tts+最新版本的home assistant,你们都是怎么解决这个问题的?

作者: Uwen    时间: 2025-8-12 10:51
设置等待时间+停止播放
作者: dscao    时间: 2025-8-12 12:02
本帖最后由 dscao 于 2025-8-12 12:05 编辑

https://bbs.hassbian.com/thread-16562-1-1.html
这个最新版试过了吗?
作者: norikohxb    时间: 2025-8-12 14:11
dscao 发表于 2025-8-12 12:02
https://bbs.hassbian.com/thread-16562-1-1.html
这个最新版试过了吗?

非常感谢你,我还一直以为是官方的问题。我想要再请教你一个问题,如果我不用这个第三方插件,好像用官方原版的tts也是不行的对吧
作者: norikohxb    时间: 2025-8-12 14:59
dscao 发表于 2025-8-12 12:02
https://bbs.hassbian.com/thread-16562-1-1.html
这个最新版试过了吗?

我安装了升级到8.1,但是好像说话还是会结巴。有什么方法可以解决吗?
ha升级到今天的8.1
然后用了你的插件,还是没有声音出来。2025.3.4就可以
作者: norikohxb    时间: 2025-8-12 15:09
norikohxb 发表于 2025-8-12 14:59
我安装了升级到8.1,但是好像说话还是会结巴。有什么方法可以解决吗?
ha升级到今天的8.1
然后用了你的插 ...

好像好了我是在老的版本上先升级插件的。然后再升级ha,
但是有时候好像又无法通过音箱tts出来。请问版主是什么原因
作者: norikohxb    时间: 2025-8-12 15:27
什么错误啊,帮我看看老板

日志记录器: homeassistant.util.loop
来源: util/loop.py:137
首次出现: 15:15:06 (4 次出现)
上次记录: 15:15:48

Detected blocking call to open with args ('/config/tts/ed6ac686915addd24df7fab5c8a6a0c875c714f1_zh-cn_-_edge_tts.mp3', 'rb') inside the event loop by custom integration 'dlna_dmr_xiaodu' at custom_components/dlna_dmr_xiaodu/media_player.py, line 721: shutil.copy(source_path, dest_path) (offender: /usr/local/lib/python3.13/shutil.py, line 260: with open(src, 'rb') as fsrc, please report it to the author of the 'dlna_dmr_xiaodu' custom integration 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 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 156, 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 "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 91, in wrapper return await func(self, *args, **kwargs) File "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 721, in async_play_media shutil.copy(source_path, dest_path)
Detected blocking call to open with args ('/config/www/tts/ed6ac686915addd24df7fab5c8a6a0c875c714f1_zh-cn_-_edge_tts.mp3', 'wb') inside the event loop by custom integration 'dlna_dmr_xiaodu' at custom_components/dlna_dmr_xiaodu/media_player.py, line 721: shutil.copy(source_path, dest_path) (offender: /usr/local/lib/python3.13/shutil.py, line 262: with open(dst, 'wb') as fdst, please report it to the author of the 'dlna_dmr_xiaodu' custom integration 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 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 156, 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 "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 91, in wrapper return await func(self, *args, **kwargs) File "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 721, in async_play_media shutil.copy(source_path, dest_path)
Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f1874cebad0>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'edge_tts' at custom_components/edge_tts/tts.py, line 408: async for chunk in tts.stream(): (offender: /usr/local/lib/python3.13/ssl.py, line 717: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/hasscc/hass-edge-tts/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations 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 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 156, 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/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 719, in _async_step_choose await self._async_run_script(script) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 637, in _async_run_script self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 829, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) 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 44, 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 719, in _async_step_choose await self._async_run_script(script) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 637, in _async_run_script self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 829, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) 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 44, 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 829, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2835, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2878, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 155, in async_say_handle await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 2835, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2878, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 850, in entity_service_call single_response = await _handle_entity_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 914, in _handle_entity_call task = hass.async_run_hass_job(job) File "/usr/src/homeassistant/homeassistant/core.py", line 940, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 755, in _async_add_hass_job task = create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/group/media_player.py", line 373, in async_play_media await self.hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 2828, in async_call self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 829, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2855, in _run_service_call_catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 2878, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 850, in entity_service_call single_response = await _handle_entity_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 914, in _handle_entity_call task = hass.async_run_hass_job(job) File "/usr/src/homeassistant/homeassistant/core.py", line 940, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 755, in _async_add_hass_job task = create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 91, in wrapper return await func(self, *args, **kwargs) File "/config/custom_components/dlna_dmr_xiaodu/media_player.py", line 622, in async_play_media sourced_media = await media_source.async_resolve_media(self.hass, media_id) File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 189, in async_resolve_media return await item.async_resolve() File "/usr/src/homeassistant/homeassistant/components/media_source/models.py", line 97, in async_resolve return await self.async_media_source().async_resolve_media(self) File "/usr/src/homeassistant/homeassistant/components/tts/media_source.py", line 146, in async_resolve_media stream.async_set_message(parsed["message"]) File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 513, in async_set_message self._manager.async_cache_message_in_memory( File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 866, in async_cache_message_in_memory self.hass.async_create_background_task( File "/usr/src/homeassistant/homeassistant/core.py", line 861, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 886, in _load_data_into_cache data = await cache.async_load_data() File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 165, in async_load_data async for chunk in self._data_gen: File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 984, in _async_generate_tts_audio extension, data = await engine_instance.async_internal_get_tts_audio( File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 266, in async_internal_get_tts_audio return await self.async_get_tts_audio(message, language, options) File "/config/custom_components/edge_tts/tts.py", line 408, in async_get_tts_audio async for chunk in tts.stream():
Detected blocking call to open with args ('/root/.netrc',) inside the event loop by integration 'tts' at homeassistant/components/tts/legacy.py, line 266: return await self.async_get_tts_audio(message, language, options) (offender: /usr/local/lib/python3.13/netrc.py, line 74: with open(file, encoding="utf-8") as fp, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+tts%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 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 156, 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/src/homeassistant/homeassistant/components/tts/__init__.py", line 886, in _load_data_into_cache data = await cache.async_load_data() File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 984, in _async_generate_tts_audio extension, data = await engine_instance.async_internal_get_tts_audio( File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 266, in async_internal_get_tts_audio return await self.async_get_tts_audio(message, language, options)


作者: norikohxb    时间: 2025-8-12 15:48
Detected that custom integration 'localtuya' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at custom_components/localtuya/common.py, line 351: async_dispatcher_send(self._hass, signal, self._status). Please create a bug report at https://github.com/rospogrigio/localtuya/issues
Detected that custom integration 'hass_agent' calls device_registry.async_update_device from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#device_registryasync_update_device at custom_components/hass_agent/__init__.py, line 29: device_registry.async_get_or_create(. Please create a bug report at https://github.com/LAB02-Research/HASS.Agent-Integration/issues
Detected that custom integration 'dlna_dmr_xiaodu' calls media_source.async_resolve_media without passing an entity_id at custom_components/dlna_dmr_xiaodu/media_player.py, line 622: sourced_media = await media_source.async_resolve_media(self.hass, media_id). Please report it to the author of the 'dlna_dmr_xiaodu' custom integration

作者: norikohxb    时间: 2025-8-12 16:28
好像是edge的tts不能用了。需要用谷歌的tts,我一直觉得edge tts(微软的tts速度比较好听)
作者: norikohxb    时间: 2025-8-12 16:30
dscao 发表于 2025-8-12 12:02
https://bbs.hassbian.com/thread-16562-1-1.html
这个最新版试过了吗?

请教一下版主,是不是改版了以后message就无法用长的变量了,这个命令好像已经无法tts出来了

action: tts.speak
metadata: {}
data:
  cache: false
  media_player_entity_id: media_player.gong_shu_fang_yin_xiang
  message: >-
    {% set east1_power = states('sensor.cmpower_7ab772_24') | float %} {% set
    west1_power = states('sensor.cmpower_7ab8cc_24') | float %} {% set
    east2_power = states('sensor.cmpower_270071_24') | float %} {% set
    west2_power = states('sensor.cmpower_7aaf91_24') | float %} {% set
    west3_power = states('sensor.cmpower_26fe4d_24') | float %} {% set fo1_power
    = states('sensor.cmpower_26fa3b_24') | float %} {% set fo2_power =
    states('sensor.cmpower_7aaf94_24') | float %} {% set messages = [] %} {% if
    east1_power < 0.2 %}{% set messages = messages + ['东光伏1路异常'] %}{% endif %}
    {% if west1_power < 0.2 %}{% set messages = messages + ['西光伏1路异常'] %}{%
    endif %} {% if east2_power < 0.2 %}{% set messages = messages + ['东光伏2路异常']
    %}{% endif %} {% if west2_power < 0.2 %}{% set messages = messages +
    ['西光伏2路异常'] %}{% endif %} {% if west3_power < 0.2 %}{% set messages =
    messages + ['西光伏3路异常'] %}{% endif %} {% if fo1_power < 0.2 %}{% set messages
    = messages + ['光伏佛1路异常'] %}{% endif %} {% if fo2_power < 0.2 %}{% set
    messages = messages + ['光伏佛2路异常'] %}{% endif %} {% if messages %} {{
    messages | join(';') }},请检查光伏逆变器 {% else %} {% endif %}
  language: zh-CN
target:
  entity_id: tts.google_en_com



是不是message里面的信息太长了?

作者: dscao    时间: 2025-8-12 17:24
norikohxb 发表于 2025-8-12 16:30
请教一下版主,是不是改版了以后message就无法用长的变量了,这个命令好像已经无法tts出来了

action: tts ...

对,新修改后,为了避免超长时间卡住,设置了30秒内能下载完语音,再将文件转成普通链接发给小度播放。超时将放弃。 新版官方系统的tts链接小度没法正常播放。
作者: norikohxb    时间: 2025-8-12 20:59
还有我也找到我的问题了和edge tts搭配不好是因为edge tts我用的是老版本,因为不是官方的插件我没有去升级导致
作者: norikohxb    时间: 2025-8-12 21:00
dscao 发表于 2025-8-12 17:24
对,新修改后,为了避免超长时间卡住,设置了30秒内能下载完语音,再将文件转成普通链接发给小度播放。超 ...

感谢楼主的插件,这个问题困扰我好几个版本了,从2025.3.4就不行了,具体原因你能不能说详细一点,我翻译成为中文的反映到国外的论坛去,我还专门开了一个帖子。但是国外好像不重视。你说国外这个更新是进步了还是退步了?
作者: dscao    时间: 2025-8-12 21:44
norikohxb 发表于 2025-8-12 21:00
感谢楼主的插件,这个问题困扰我好几个版本了,从2025.3.4就不行了,具体原因你能不能说详细一点,我翻译 ...

个人认为,不一定准确: 新版ha应该是更先进,生成的链接带权限认证且支持流式输出。但小度可能太老了对这种流式输出支持不好,现象就是一卡一卡重复播放开头几个字,永远结束不了。
作者: norikohxb    时间: 2025-8-12 23:18
那么什么dlna的音箱是可以跟得上ha的最新版本的节奏的?就是和home assistant最适配的。
作者: xieahui    时间: 2025-8-14 10:50
Uwen 发表于 2025-8-12 10:51
设置等待时间+停止播放

尝试过 这样设置 反正最后用着用着没声音了……  懒得管了
作者: Uwen    时间: 2025-8-15 09:56
xieahui 发表于 2025-8-14 10:50
尝试过 这样设置 反正最后用着用着没声音了……  懒得管了

是的,凑合着用算是,确实效果不好
作者: norikohxb    时间: 2025-8-16 12:46
本帖最后由 norikohxb 于 2025-8-16 21:25 编辑

用了新版的好了,你们的还没有好吗?然后我之前反映到官方一直不被重视,现在up主提供了原因,我给反映到github了希望下个版本能改正
https://github.com/issues/created?issue=home-assistant%7Ccore%7C150500

作者: dscao    时间: 2025-8-16 15:43
本帖最后由 dscao 于 2025-8-16 21:59 编辑

https://github.com/home-assistant/core/pull/150218

Ha2025.8.2这个修复好像是解决了这个问题。晚些时间回家测试一下。


测试了一下,还是一样,没有解决这个问题。


作者: aksx    时间: 2025-8-22 09:26
测试一下,标记
作者: norikohxb    时间: 2025-8-22 09:55
dscao 发表于 2025-8-16 15:43
https://github.com/home-assistant/core/pull/150218

Ha2025.8.2这个修复好像是解决了这个问题。晚些时间 ...

我用的是哪个nodered的比如一些突发的地震,天气异常提醒通知,
好像还是会循环播放!能否再精进一下。,
比如这种信息就播报循环前面的几个字 sender: 福建省地震局
  title: 中国地震台网自动测定:08月21日16时37分在台湾台南市附近(北纬23.28度,东经120.49度)发生4.3左右地震。
  text: 中国地震台网自动测定:08月21日16时37分在台湾台南市附近(北纬23.28度,东经120.49度)发生4.3左右地震,最终结果以正式速报为准。




欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5