n71154plus / Hitachi_smart_app

MIT License
46 stars 16 forks source link

certificate.crt No such file or directory #5

Closed J1A-T13N closed 3 months ago

J1A-T13N commented 3 years ago

您好,首先感謝您的開發,讓我們可以有更好的智慧居家可以使用, 我在安裝您開發的自訂整合時,發生以下錯誤,看 log 可能是 certificate.crt 路徑參照有跑掉,再麻煩您協助排除。

System Health

configuration.yaml Path: /home/homeassistant/.homeassistant version core-2021.8.3
installation_type Home Assistant Core
dev false
hassio false
docker false
user homeassistant
virtualenv true
python_version 3.8.5
os_name Linux
os_version 5.4.0-1028-raspi
arch aarch64
timezone Asia/Taipei
錯誤訊息 Logger: aiohttp.server Source: custom_components/Hitachi_smart_app/smarthome/__init__.py:52 Integration: Hitachi Smart App (documentation, issues) First occurred: 18:07:44 (4 occurrences) Last logged: 18:07:55 Error handling request Traceback (most recent call last): File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 24, in request_context_middleware return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 144, in auth_middleware return await handler(request) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 135, in handle result = await result File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/config_entries.py", line 155, in post return await super().post(request, flow_id) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/data_validator.py", line 63, in wrapper result = await method(view, request, *args, **kwargs) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/data_entry_flow.py", line 109, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 202, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 260, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/home/homeassistant/.homeassistant/custom_components/Hitachi_smart_app/config_flow.py", line 39, in async_step_user client = smarthome( File "/home/homeassistant/.homeassistant/custom_components/Hitachi_smart_app/smarthome/__init__.py", line 52, in __init__ self.sslcontext = ssl.create_default_context(cafile="/config/custom_components/Hitachi_smart_app/smarthome/certificate.crt") File "/usr/lib/python3.8/ssl.py", line 745, in create_default_context context.load_verify_locations(cafile, capath, cadata) FileNotFoundError: [Errno 2] No such file or directory
J1A-T13N commented 3 years ago

HA 安裝方式:Python 3.8 virtual environment (pip 版本: 3)

J1A-T13N commented 3 years ago

目前先建立 /config 並透過 ln -s /home/homeassistant/.homeassistant/custom_components /config/custom_components 連結目錄,並從 /config 開始,往下設定 chmod 755 一直到 certificate.crt 所在位置,目前已經可以連線