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

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

[插件集成] 美的空调-局域网协议控制[新协议已支持]

  [复制链接]

0

主题

6

帖子

48

积分

新手上路

Rank: 1

积分
48
金钱
42
HASS币
0
发表于 2021-9-3 10:14:51 | 显示全部楼层
magicwolf 发表于 2021-9-3 08:39
我的空调同型号,没有问题

绝了,换了电脑也是一样不行,后面脑洞大开,也许不是电脑问题是空调,毕竟你说你的同型号能用,我把空调拔电了,再插上...midea-discover就好了,感谢老哥!
其他后来的老哥们 也可以试试这个,如果确定有老哥同型号能用,在同一网络下,还是找不到或者不通,可以试试拔电空调哈哈哈

华菱N8HE1 ,可用!
回复

使用道具 举报

5

主题

122

帖子

1041

积分

论坛技术达人

积分
1041
金钱
914
HASS币
40
 楼主| 发表于 2021-9-3 16:24:13 | 显示全部楼层
a602646509 发表于 2021-9-3 08:20
midea-discover -d
INFO:msmart.cliebug mode active
INFO:msmart.cli:msmart version: 0.1.34 Currently ...

这数据有点意思,是192.168.1.4返回的数据
但数据前面4个byte是IP地址 2501a8c0 是 192.168.1.37
看来不能信任数据中返回的IP地址
回复

使用道具 举报

5

主题

122

帖子

1041

积分

论坛技术达人

积分
1041
金钱
914
HASS币
40
 楼主| 发表于 2021-9-3 16:26:25 | 显示全部楼层
wzdldx0420 发表于 2021-8-29 22:48
感谢,家里一个爱青春2已经好用了,但是新买的风观还是不行,具体表现为hassio里面操作时候实体属性正常有 ...

给 midea-discover 的输出,另外新版本已经是 0.1.35了
回复

使用道具 举报

5

主题

122

帖子

1041

积分

论坛技术达人

积分
1041
金钱
914
HASS币
40
 楼主| 发表于 2021-9-3 16:27:37 | 显示全部楼层
chenquanhao 发表于 2021-8-29 22:47
midea-discover -a YOUR_ACCOUNT -p YOUR_PASSWORD

Usage: midea-discover [OPTIONS]

直接使用 midea-discover 即可
回复

使用道具 举报

5

主题

122

帖子

1041

积分

论坛技术达人

积分
1041
金钱
914
HASS币
40
 楼主| 发表于 2021-9-3 16:29:35 | 显示全部楼层
magicwolf 发表于 2021-8-29 22:56
楼主大神,可以这样设置吗?好像没反应

不知道 没用过空调自动化
回复

使用道具 举报

5

主题

122

帖子

1041

积分

论坛技术达人

积分
1041
金钱
914
HASS币
40
 楼主| 发表于 2021-9-3 16:30:52 | 显示全部楼层
sctale 发表于 2021-8-17 07:18
大神,我是美的v2的空调,之前在旧平台上成功了一次就一直不行了。昨天我从Debian+N大一键安装切换到了HASS ...

升级最新版本
回复

使用道具 举报

2

主题

24

帖子

360

积分

中级会员

Rank: 3Rank: 3

积分
360
金钱
336
HASS币
0
发表于 2021-9-7 01:21:29 | 显示全部楼层
活着就要折腾 发表于 2021-8-23 21:03
我按教程安装好插件,实体显示正常,但是各个功能调节都没有反应。我想可能是需要token K1,请教一下是你 ...

我用安卓手机装他推荐那个美居APP,adb连接手机,操作时候进行抓包
回复

使用道具 举报

0

主题

4

帖子

65

积分

注册会员

Rank: 2

积分
65
金钱
61
HASS币
0
发表于 2021-9-13 02:54:20 | 显示全部楼层
找到了一个token 可以控制,但是奇怪的是还有两台一样规格型号的空调搜不到,现在用midea-discover搜索不到任何设备,midea-discover直接报错
root@smarthomefansbox: ~aroot@smarthomefansbox:~# midea-discover
INFO:msmart.cli:msmart version: 0.1.35 Currently only supports ac devices.
INFO:msmart.cli:Sending Device Scan Broadcast…
Traceback (most recent call last):
File “/usr/local/bin/midea-discover”, line 10, in
sys.exit(discover())
File “/usr/local/lib/python3.7/dist-packages/click/core.py”, line 1137, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/click/core.py”, line 1062, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.7/dist-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.7/dist-packages/click/core.py”, line 763, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/msmart/cli.py”, line 43, in discover
found_devices = loop.run_until_complete(discovery.get_all())
File “/usr/lib/python3.7/asyncio/base_events.py”, line 584, in run_until_complete
return future.result()
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 179, in get_all
[self.result.add(task.result()) for task in tasks]
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 179, in
[self.result.add(task.result()) for task in tasks]
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 42, in support_test
_device = await self.support_testv3(account, password)
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 57, in support_testv3
token, key = await loop.run_in_executor(None, gettoken, udpid, account, password)
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 234, in gettoken
Client.login()
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 120, in login
‘password’: self.security.encryptPassword(self.login_id, self.password)
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 86, in api_request
self.handle_api_error(int(response[‘errorCode’]), response[‘msg’])
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 233, in handle_api_error
handler()
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 219, in throw
raise ValueError(error_code, message)
ValueError: (3101, ‘password error,please enter again.’)
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<scandevice.support_test() done, defined at /usr/local/lib/python3.7/dist-packages/msmart/scanner.py:40> exception=RecursionError(‘maximum recursion depth exceeded while calling a Python object’)>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 42, in support_test
_device = await self.support_testv3(account, password)
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 57, in support_testv3
token, key = await loop.run_in_executor(None, gettoken, udpid, account, password)
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/dist-packages/msmart/scanner.py”, line 234, in gettoken
Client.login()
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 120, in login
‘password’: self.security.encryptPassword(self.login_id, self.password)
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 91, in api_request
return self.api_request(endpoint, args)
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 91, in api_request
return self.api_request(endpoint, args)
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 91, in api_request
return self.api_request(endpoint, args)
[Previous line repeated 959 more times]
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 86, in api_request
self.handle_api_error(int(response[‘errorCode’]), response[‘msg’])
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 233, in handle_api_error
handler()
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 210, in restart_full
self.get_login_id()
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 103, in get_login_id
‘loginAccount’: self.login_account
File “/usr/local/lib/python3.7/dist-packages/msmart/cloud.py”, line 78, in api_request
r = requests.post(url=url, data=data)
File “/usr/local/lib/python3.7/dist-packages/requests/api.py”, line 117, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/requests/api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/requests/sessions.py”, line 542, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/dist-packages/requests/sessions.py”, line 655, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py”, line 706, in urlopen
chunked=chunked,
File “/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py”, line 445, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py”, line 440, in _make_request
httplib_response = conn.getresponse()
File “/usr/lib/python3.7/http/client.py”, line 1336, in getresponse
response.begin()
File “/usr/lib/python3.7/http/client.py”, line 330, in begin
self.headers = self.msg = parse_headers(self.fp)
File “/usr/lib/python3.7/http/client.py”, line 224, in parse_headers
return email.parser.Parser(_class=_class).parsestr(hstring)
File “/usr/lib/python3.7/email/parser.py”, line 68, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
File “/usr/lib/python3.7/email/parser.py”, line 57, in parse
feedparser.feed(data)
File “/usr/lib/python3.7/email/feedparser.py”, line 176, in feed
self._call_parse()
File “/usr/lib/python3.7/email/feedparser.py”, line 180, in _call_parse
self._parse()
File “/usr/lib/python3.7/email/feedparser.py”, line 295, in _parsegen
if self._cur.get_content_maintype() == ‘message’:
File “/usr/lib/python3.7/email/message.py”, line 594, in get_content_maintype
ctype = self.get_content_type()
File “/usr/lib/python3.7/email/message.py”, line 578, in get_content_type
value = self.get(‘content-type’, missing)
File “/usr/lib/python3.7/email/message.py”, line 471, in get
return self.policy.header_fetch_parse(k, v)
File “/usr/lib/python3.7/email/_policybase.py”, line 316, in header_fetch_parse
return self._sanitize_header(name, value)
File “/usr/lib/python3.7/email/_policybase.py”, line 287, in _sanitize_header
if _has_surrogates(value):
File “/usr/lib/python3.7/email/utils.py”, line 57, in _has_surrogates
s.encode()
RecursionError: maximum recursion depth exceeded while calling a Python object
回复

使用道具 举报

0

主题

27

帖子

325

积分

中级会员

Rank: 3Rank: 3

积分
325
金钱
298
HASS币
0
发表于 2021-9-17 18:49:29 | 显示全部楼层
可以用在洗衣机上吗。小天鹅的应该也是同样的协议
回复

使用道具 举报

1

主题

34

帖子

189

积分

注册会员

Rank: 2

积分
189
金钱
155
HASS币
0
发表于 2021-9-17 19:26:32 | 显示全部楼层
美的风管机,一直报这个错误。请教是什么问题
此错误来自自定义集成。

Logger: homeassistant.helpers.entity
Source: custom_components/midea_ac/climate.py:133
Integration: midea_ac (documentation)
First occurred: 19:15:10 (118 occurrences)
Last logged: 19:29:41

Update for climate.midea_ac_160528702769480 fails
Update for climate.midea_ac_162727726127980 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 641, in async_device_update
    raise exc
  File "/config/custom_components/midea_ac/climate.py", line 133, in async_update
    await self.hass.async_add_executor_job(self._device.refresh)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/msmart/device.py", line 198, in refresh
    self._send_cmd(cmd)
  File "/usr/local/lib/python3.9/site-packages/msmart/device.py", line 208, in _send_cmd
    responses = self._lan_service.appliance_transparent_send_8370(data)
  File "/usr/local/lib/python3.9/site-packages/msmart/lan.py", line 136, in appliance_transparent_send_8370
    data = self.security.encode_8370(data, msgtype)
  File "/usr/local/lib/python3.9/site-packages/msmart/security.py", line 117, in encode_8370
    data = self.aes_cbc_encrypt(data, self._tcp_key) + sign
  File "/usr/local/lib/python3.9/site-packages/msmart/security.py", line 57, in aes_cbc_encrypt
    return AES.new(key, AES.MODE_CBC, iv=self.iv).encrypt(raw)
  File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/AES.py", line 232, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/_mode_cbc.py", line 274, in _create_cbc_cipher
    cipher_state = factory._create_base_cipher(kwargs)
  File "/usr/local/lib/python3.9/site-packages/Cryptodome/Cipher/AES.py", line 92, in _create_base_cipher
    if len(key) not in key_size:
TypeError: object of type 'NoneType' has no len()
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-9 00:44 , Processed in 0.063396 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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