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

 找回密码
 立即注册
楼主: nuknoop

[插件集成] 已更新10.14 / 国产ChatGPT集成之「智谱清言」 彻底对接Hass

  [复制链接]

0

主题

3

帖子

86

积分

注册会员

Rank: 2

积分
86
金钱
83
HASS币
0
发表于 2 小时前 | 显示全部楼层
学习一下
回复

使用道具 举报

3

主题

20

帖子

162

积分

注册会员

Rank: 2

积分
162
金钱
142
HASS币
0
发表于 1 小时前 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

0

主题

26

帖子

967

积分

高级会员

Rank: 4

积分
967
金钱
941
HASS币
0
发表于 1 小时前 | 显示全部楼层
本帖最后由 Cunlixie 于 2024-10-16 18:52 编辑

添加集成,填入自己申请的api密钥,报:已保存配置,无需二次;
查看日志:
日志记录器: custom_components.zhipuai.const
来源: custom_components/zhipuai/config_flow.py:105
集成: 智谱清言 (文档, 问题)
首次出现: 13:08:57 (4 次总计出现)
上次记录: 18:43:10
发生意外异常: 无法连接到智谱AI API: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1068, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs, sock=sock)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python-3.12.3/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python-3.12.3/lib/python3.12/asyncio/base_events.py", line 1182, in _create_connection_transport
    await waiter
  File "/usr/local/python-3.12.3/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete
    raise handshake_exc
  File "/usr/local/python-3.12.3/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake
    self._sslobj.do_handshake()
  File "/usr/local/python-3.12.3/lib/python3.12/ssl.py", line 917, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 140, in _validate_api_key
    async with session.post(url, headers=headers, json=data) as response:
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/client.py", line 1355, in __aenter__
    self._resp: _RetType = await self._coro
                           ^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/client.py", line 659, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 557, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1002, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1336, in _create_direct_connection
    raise last_exc
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1305, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/aiohttp/connector.py", line 1070, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 105, in async_step_user
    await self._validate_api_key(user_input[CONF_API_KEY])
  File "/root/.homeassistant/custom_components/zhipuai/config_flow.py", line 154, in _validate_api_key
    raise InvalidAPIKey(f"无法连接到智谱AI API: {str(e)}")
custom_components.zhipuai.config_flow.InvalidAPIKey: 无法连接到智谱AI API: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]

请问错误如何解决?HA core 2024.10.2
python 3.12 venv

回复

使用道具 举报

24

主题

177

帖子

1645

积分

论坛技术达人

积分
1645
金钱
1463
HASS币
20
 楼主| 发表于 13 分钟前 | 显示全部楼层
本帖最后由 nuknoop 于 2024-10-16 20:15 编辑
Cunlixie 发表于 2024-10-16 18:48
添加集成,填入自己申请的api密钥,报:已保存配置,无需二次;
查看日志:
日志记录器: custom_components ...

发生意外异常: 无法连接到智谱AI API: Cannot connect to host open.bigmodel.cn:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]

你好,这里很明显,你的网络环境有问题,请检查自己的网络环境是否开代,或者系统时间和SSL是正常的。
如果配置不加验证的话,会导致的问题更多,所以这里就要上验证
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-10-16 20:25 , Processed in 0.064860 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表