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

[插件集成] 国产ChatGPT集成 「 智谱清言 」 / 扩展HomeAssistant LLM

 火... [复制链接]

31

主题

309

回帖

4775

积分

论坛技术达人

积分
4775
金钱
4415
HASS币
80
 楼主| 发表于 2024-10-17 00:46:42 | 显示全部楼层
xxlxmd 发表于 2024-10-16 22:53
设置INPUT数值度时候 直接卡死 是为啥 我设置热水器温度 没反应(最新版本,之前版本会返回python代码)
我在 ...

你好,自动化设备是AI看不懂你的配置,所以请在指令中告诉如何操作热水器温度,所以你要告诉执行一个自动化,也就是说你需要先写好一个自动化,让他去执行是最好的,在指令中直接配置jinja2也有同样效果

这里我设置看不懂直接掐断,马上会更新新版功能,其次ABC也是看不懂的
回复

使用道具 举报

1

主题

49

回帖

489

积分

中级会员

积分
489
金钱
439
HASS币
0
发表于 2024-10-16 23:34:01 | 显示全部楼层
这个模板是往哪里添加了?咋用了?需要修改成自己的实体吗
回复

使用道具 举报

0

主题

2

回帖

26

积分

新手上路

积分
26
金钱
24
HASS币
0
发表于 2024-10-16 23:07:19 | 显示全部楼层
观摩学习一下子~
回复

使用道具 举报

14

主题

180

回帖

1358

积分

论坛技术达人

积分
1358
金钱
1164
HASS币
0
发表于 2024-10-16 22:53:05 | 显示全部楼层
设置INPUT数值度时候 直接卡死 是为啥 我设置热水器温度 没反应(最新版本,之前版本会返回python代码)
我在调试看返回的是这个:
init_options:
  start_stage: intent
  end_stage: intent
  input:
    text: 设置ABC 为50
  pipeline: 01ja0166zps8nh7484sdgrc5b9
  conversation_id: null
stage: done
run:
  pipeline: 01ja0166zps8nh7484sdgrc5b9
  language: zh
  runner_data:
    stt_binary_handler_id: null
    timeout: 300
events:
  - type: run-start
    data:
      pipeline: 01ja0166zps8nh7484sdgrc5b9
      language: zh
      runner_data:
        stt_binary_handler_id: null
        timeout: 300
    timestamp: "2024-10-16T14:51:10.610948+00:00"
  - type: intent-start
    data:
      engine: conversation.zhi_pu_qing_yan
      language: "*"
      intent_input: 设置ABC 为50
      conversation_id: null
      device_id: null
    timestamp: "2024-10-16T14:51:10.610982+00:00"
  - type: intent-end
    data:
      intent_output:
        response:
          speech:
            plain:
              speech: ""
              extra_data: null
          card: {}
          language: "*"
          response_type: action_done
          data:
            targets: []
            success: []
            failed: []
        conversation_id: 01JAAWZDCZWXRQZEDVYR3ZFH6H
    timestamp: "2024-10-16T14:51:14.378128+00:00"
  - type: run-end
    data: null
    timestamp: "2024-10-16T14:51:14.378191+00:00"
intent:
  engine: conversation.zhi_pu_qing_yan
  language: "*"
  intent_input: 设置ABC 为50
  conversation_id: null
  device_id: null
  done: true
  intent_output:
    response:
      speech:
        plain:
          speech: ""
          extra_data: null
      card: {}
      language: "*"
      response_type: action_done
      data:
        targets: []
        success: []
        failed: []
    conversation_id: 01JAAWZDCZWXRQZEDVYR3ZFH6H

界面就返回一个 空(好像是空格似的)
回复

使用道具 举报

jzc 

0

主题

1

回帖

16

积分

新手上路

积分
16
金钱
15
HASS币
0
发表于 2024-10-16 22:36:19 | 显示全部楼层
111看看教程
回复

使用道具 举报

0

主题

8

回帖

80

积分

注册会员

积分
80
金钱
72
HASS币
0
发表于 2024-10-16 21:31:06 | 显示全部楼层
谢谢分享好东西
回复

使用道具 举报

0

主题

7

回帖

78

积分

注册会员

积分
78
金钱
71
HASS币
0
发表于 2024-10-16 20:52:32 | 显示全部楼层
让我看看发育正不正常!
回复

使用道具 举报

31

主题

309

回帖

4775

积分

论坛技术达人

积分
4775
金钱
4415
HASS币
80
 楼主| 发表于 2024-10-16 20:11:26 | 显示全部楼层
本帖最后由 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是正常的。
如果配置不加验证的话,会导致的问题更多,所以这里就要上验证
回复

使用道具 举报

0

主题

28

回帖

1106

积分

金牌会员

积分
1106
金钱
1078
HASS币
0
发表于 2024-10-16 18:48:05 | 显示全部楼层
本帖最后由 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

回复

使用道具 举报

3

主题

28

回帖

263

积分

中级会员

积分
263
金钱
232
HASS币
0
发表于 2024-10-16 18:42:25 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-1 23:59 , Processed in 0.653571 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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