wuwentao / midea_ac_lan

Auto-configure and then control your Midea M-Smart devices (Air conditioner, Fan, Water heater, Washer, etc) via local area network.
MIT License
367 stars 17 forks source link

安装过程中缺少midea-local模块导致无法进行配置 #359

Closed 0pera closed 1 month ago

0pera commented 1 month ago

HA版本

2024.10.1

集成版本

0.6.7

之前可正常使用的集成版本

??

设备类型及型号

208907214560561 (Air Conditioner)

使用的App

美的美居

问题详细描述

目前是使用容器来安装的,主机环境是TrueNAS Scale,容器环境是k8s。 在安装之后,尝试进行配置,但是提示{"message":"Invalid handler specified"},查看日志,提示缺少模块”midealocal“。

通过手动安装midea-local之后,可以跳转到配置页面。 pip install midea-local

但是容器化的环境里面,pip安装的模块会在重启后丢失,能不能重新整合进去这个包里面?

另外一个问题,可以搜索设备,输入ip之后能正确发现设备的部分信息,但是尝试提交的时候提示”Unknown error occurred“。 屏幕截图 2024-10-10 153756

日志里面提示错误是”Error handling request“,来自于”/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448“

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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 85, 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 32, 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/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 128, in post
    result = self._prepare_result_json(result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 228, in _prepare_result_json
    return _prepare_config_flow_result_json(result, super()._prepare_result_json)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 135, in _prepare_config_flow_result_json
    return prepare_result_json(result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 52, in _prepare_result_json
    data["data_schema"] = voluptuous_serialize.convert(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous_serialize/__init__.py", line 40, in convert
    pval = convert(value, custom_serializer=custom_serializer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous_serialize/__init__.py", line 91, in convert
    "options": [(item, item) for item in schema.container],
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'int' object is not iterable

The logs

No response

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: The midea-local module is missing during the installation process, resulting in the inability to configure it.

wuwentao commented 1 month ago

和 #355 相同的问题。 可以参考解决办法试试。 随后PR merge完,会发布新版解决这个问题

手工修改测试流程:

  1. ssh 登录HA设备

  2. 执行以下命令

    cd /config/custom_components/midea_ac_lan/
    wget https://raw.githubusercontent.com/wuwentao/midea_ac_lan/b7a7f6e1ffcbcdba13d0890b4d547b7b32e403b3/custom_components/midea_ac_lan/config_flow.py -O config_flow.py
  3. 重启HA 重试

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Same issue as #355. You can try the solutions as a reference. After the PR merge is completed, a new version will be released to solve this problem.

chemelli74 commented 1 month ago

Please update to v0.6.4 (just released) and report back if it fixes the issue

0pera commented 1 month ago

problem 2 had beed fixed, but problem 1 is still there.

My home assistant is installed via container, after every restart of the container, python package 'midea-local' is missing and cause this add-on not working. Is it possisable to include the python package in this add-on?

chemelli74 commented 1 month ago

problem 2 had beed fixed, but problem 1 is still there.

My home assistant is installed via container, after every restart of the container, python package 'midea-local' is missing and cause this add-on not working. Is it possisable to include the python package in this add-on?

The package is included so there is something wrong on your specific scenario. Please open a new issue with all details and debug log attached (not pasted!).