Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问德业除湿机是怎么接入的? #1

Open
itispip opened this issue Jan 31, 2021 · 8 comments
Open

请问德业除湿机是怎么接入的? #1

itispip opened this issue Jan 31, 2021 · 8 comments

Comments

@itispip
Copy link

itispip commented Jan 31, 2021

是只要把mqtt组件放在custom_components下面吗?

@yongman
Copy link
Owner

yongman commented Jan 31, 2021

是的,但是需要获取到mqtt的相关配置,具体可以参考下:https://xiking.win/2020/11/12/3-deye-dehumidifer-add-to-homeassistant/

@itispip
Copy link
Author

itispip commented Jan 31, 2021

是的,但是需要获取到mqtt的相关配置,具体可以参考下:https://xiking.win/2020/11/12/3-deye-dehumidifer-add-to-homeassistant/

谢谢,我去看了您的博客。其中模拟Post,没提到appid, extend两个关键字是怎么获得的。请问是我必须去自己反编译德业的APP才能获得吗?

@yongman
Copy link
Owner

yongman commented Jan 31, 2021

@itispip pushtype可以填“Ali”,extend字段{"cid":"111111122223333","type":"0"},其中cid应该可以随便填写。

@itispip
Copy link
Author

itispip commented Jan 31, 2021

谢谢,果然可以。想接入德业很久了,全网就只找到你这唯一的一篇。

@yongman
Copy link
Owner

yongman commented Jan 31, 2021

谢谢,果然可以。想接入德业很久了,全网就只找到你这唯一的一篇。

我也尝试看社区有没有现成的方案,奈何德业除湿机可能受众比较小,只能自己动手了。:-)

@itispip
Copy link
Author

itispip commented Jan 31, 2021

修改版的mqtt component无法启动

Logger: homeassistant.core
Source: custom_components/mqtt/init.py:164
First occurred: 下午2:51:49 (1 occurrences)
Last logged: 下午2:51:49

Error executing service: <ServiceCall homeassistant.restart (c:1fa8070b20c5c2fc8f0119f5641bee9d)>
Traceback (most recent call last):
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1461, in catch_exceptions
await coro_or_task
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1480, in _execute_service
await handler.job.target(service_call)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/service.py", line 663, in admin_handler
await result
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/homeassistant/init.py", line 117, in async_handle_core_service
errors = await conf_util.async_check_ha_config_file(hass)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/config.py", line 874, in async_check_ha_config_file
res = await check_config.async_check_ha_config_file(hass)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/check_config.py", line 123, in async_check_ha_config_file
component = integration.get_component()
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 416, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/.homeassistant/custom_components/mqtt/init.py", line 164, in
cv.deprecated(CONF_TLS_VERSION, invalidation_version="0.115"),
TypeError: deprecated() got an unexpected keyword argument 'invalidation_version'

Logger: aiohttp.server
Source: custom_components/mqtt/init.py:164
First occurred: 下午2:50:22 (2 occurrences)
Last logged: 下午2:51:31

Error handling request
Traceback (most recent call last):
File "/root/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
return await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/core.py", line 29, in post
errors = await async_check_ha_config_file(request.app["hass"])
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/config.py", line 874, in async_check_ha_config_file
res = await check_config.async_check_ha_config_file(hass)
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/check_config.py", line 123, in async_check_ha_config_file
component = integration.get_component()
File "/root/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 416, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/.homeassistant/custom_components/mqtt/init.py", line 164, in
cv.deprecated(CONF_TLS_VERSION, invalidation_version="0.115"),
TypeError: deprecated() got an unexpected keyword argument 'invalidation_version'

@yongman
Copy link
Owner

yongman commented Feb 1, 2021

@itispip 估计和homeassistant的版本有关系,你可以直接拷贝你正在运行版本的源码中的mqtt组件,然后根据 https://xiking.win/2020/11/12/3-deye-dehumidifer-add-to-homeassistant/ 修改一下源码

@stackia
Copy link

stackia commented Mar 14, 2023

我把德业除湿机封装了个独立插件,欢迎尝试
https://github.com/stackia/ha-deye-dehumidifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants