meatball 发表于 2022-6-21 15:58:00

involute 发表于 2022-6-21 15:19
更新了一下,看看是否可以了

试了一下没发现问题,可以直接通过set_temperature服务来开启空调了

jjss520 发表于 2022-6-21 16:03:26

involute 发表于 2022-6-20 18:47
那个是室外机温度,得室外机开机时才有数据,比如制冷模式下

哦哦,那就是要在工作的时候这个才有数据

liujiang567 发表于 2022-6-21 16:48:40

所有型号都能接入么?

luyou 发表于 2022-6-21 17:24:15

下载了LZ的插件,用的docker版的homeassitant版本,空调是美的V3的,不能自动识别,但是用手动模式搞定了!谢谢楼主

gyorai 发表于 2022-6-21 21:30:11

involute 发表于 2022-6-21 15:28
这样, 附件的文件,你拿去替换一下midea_ac_lan/midea/目录下同名文件,重启HA,看看是否可以搜索到你的 ...

虽然能找到设备了,但是接下去就会报这个错:
Can't connect to Midea cloud to take device‘s key-info(Token and Key)

在log中看到这个error:
2022-06-21 21:25:59 ERROR (MainThread) Connection authException error

尝试把const.py中的默认账号信息换了自己的账号也还是不行

involute 发表于 2022-6-21 22:05:52

gyorai 发表于 2022-6-21 21:30
虽然能找到设备了,但是接下去就会报这个错:

在log中看到这个error:

如果是验证错误,下边这个错误会连出两遍,
你看到了几遍?

请打开调试模式,然后启动后添加设备,并且把相关日志都提供给我,这个错误可能不是你想象的那样,而是设备类型的问题。

involute 发表于 2022-6-21 22:07:28

gyorai 发表于 2022-6-21 14:58
INFO:msmart.cli:*** Found a device: {'name': 'midea_cc_0260', 'ssid': 'midea_cc_0260', 'ip': '192.1 ...

对了,你用msmart的token和key,可以正常接入吗?

gyorai 发表于 2022-6-21 22:21:21

involute 发表于 2022-6-21 22:07
对了,你用msmart的token和key,可以正常接入吗?

不行,之前用msmart就不成功
添加设备的日志在这里:
2022-06-21 22:03:35 DEBUG (MainThread) Devices found: {160528703186992: {'id': 160528703186992, 'ip': '192.168.51.210', 'port': 6444, 'model': 'K86EB', 'protocol': 3}, 164926749962169: {'id': 164926749962169, 'ip': '192.168.51.238', 'port': 6444, 'model': 'K86EB', 'protocol': 3}, 196812581471476: {'id': 196812581471476, 'ip': '192.168.51.121', 'port': 6444, 'model': '02BWF', 'protocol': 3}}
2022-06-21 22:04:34 DEBUG (MainThread) Now config device {'id': 160528703186992, 'ip': '192.168.51.210', 'port': 6444, 'model': 'K86EB', 'protocol': 3}
2022-06-21 22:04:35 DEBUG (MainThread) Response: b'{"code":"0","msg":"ok","data":{"loginId":"896d66a7-ff49-4ee1-8994-5fe6eca2"}}'
2022-06-21 22:04:36 DEBUG (MainThread) Response: b'{"code":0,"msg":"\xe6\x88\x90\xe5\x8a\x9f","data":{"randomData":"cdd0c20be6a9e8b0733b445548114c937bc5c231706f0e9841eff5fe799e51e1","uid":"22dab43d5953a003ccc5a9871dc70416","accountId":"5817794331","nickname":"***@gmail.com","mdata":{"tokenPwdInfo":{"tokenPwd":"31f02f46bd1447f4b78b0e9993a37297","expiredDate":1658412276102,"createDate":1655820276102},"userInfo":{"sourceId":"mj_12345","empId":"4817945442915328","address":"","gender":"0","mobile":"***@gmail.com","userDeptInfoList":null,"extras":null,"nameEn":null,"employeeNumber":null,"headPhoto":null,"uid":"22dab43d5953a003ccc5a9871dc70416","name":"***@gmail.com","email":null},"doDeviceBind":null,"accessToken":"T1bfu098uy2o3lbbf","signUnlockEnabled":null},"accessToken":"b770d484011d6fbcfaa695907c823b48afdcb89aab60e5d1d3eb9e143e5cf098","userId":"7286770415617","email":"***@gmail.com"}}'
2022-06-21 22:04:36 DEBUG (MainThread) Response: b'{"msg":"ok","code":"0","data":{"tokenlist":[{"udpId":"24de86420a894e22c782fa8c14eed1fd","key":"29CAD3BE476640C7BD139A2052F6E851457F185B1D4042E7AA9EDDB61A9933C8","token":"7B919C8D5D67F5E413C0168A283F0CD8AE31B4C158A0265DA33E1B3F4D43A3D5563B526CFB926E8DDB1715448EB250C2F44E38EBCF34F57493B29D1062AE5748"}]}}'
2022-06-21 22:04:36 DEBUG (MainThread) Successful to take token and key, token = 7B919C8D5D67F5E413C0168A283F0CD8AE31B4C158A0265DA33E1B3F4D43A3D5563B526CFB926E8DDB1715448EB250C2F44E38EBCF34F57493B29D1062AE5748, key = 29CAD3BE476640C7BD139A2052F6E851457F185B1D4042E7AA9EDDB61A9933C8, byte_order_big = True
2022-06-21 22:04:36 DEBUG (MainThread) Try to connect to device 160528703186992
2022-06-21 22:04:36 DEBUG (MainThread) Device 160528703186992 connected at socket <socket.socket fd=21, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.51.125', 50514), raddr=('192.168.51.210', 6444)>
2022-06-21 22:04:37 DEBUG (MainThread) Authenticated
2022-06-21 22:04:37 DEBUG (MainThread) Send message: {'header': 'aa23ac00000000000003', 'body': '418100ff03ff0002000000000000000000000000000000db', 'type': 833}
2022-06-21 22:05:07 DEBUG (MainThread) Socket connect timed out
2022-06-21 22:05:08 DEBUG (MainThread) Response: b'{"msg":"ok","code":"0","data":{"tokenlist":[{"udpId":"dd062f489e1674695e18ea5cd1911da2","key":"105EE541B89E4879B846A92D66B529BF8D3A3B22FBA9424FB6E5F23DAEA5255B","token":"77D54E7D43CBA256763D615A174227F27E0E7EDECEDD99E46800A3F601000D0780F401840DEE884A1DE1B70A93F243FD0E2D43231C24F8E0AE0C66168EB87078"}]}}'
2022-06-21 22:05:08 DEBUG (MainThread) Successful to take token and key, token = 77D54E7D43CBA256763D615A174227F27E0E7EDECEDD99E46800A3F601000D0780F401840DEE884A1DE1B70A93F243FD0E2D43231C24F8E0AE0C66168EB87078, key = 105EE541B89E4879B846A92D66B529BF8D3A3B22FBA9424FB6E5F23DAEA5255B, byte_order_big = False
2022-06-21 22:05:08 DEBUG (MainThread) Try to connect to device 160528703186992
2022-06-21 22:05:08 DEBUG (MainThread) Device 160528703186992 connected at socket <socket.socket fd=21, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.51.125', 50516), raddr=('192.168.51.210', 6444)>
2022-06-21 22:05:08 ERROR (MainThread) Connection authException error

involute 发表于 2022-6-21 22:33:11

gyorai 发表于 2022-6-21 22:21
不行,之前用msmart就不成功
添加设备的日志在这里:

果如我估计,不是验证授权的事,第一次已经显示Authenticated了,不过是发的消息没回复。

我给你发个文件,你替换原midea_ac_lan/midea/目录下同名文件,然后重启,添加设备,看看有什么区别吗?

gyorai 发表于 2022-6-21 23:23:19

involute 发表于 2022-6-21 22:33
果如我估计,不是验证授权的事,第一次已经显示Authenticated了,不过是发的消息没回复。

我给你发个文 ...

这次能添加设备进去了,但是控制不了,开机什么都不行,操作一次就显示以下的信息
2022-06-21 23:21:14 DEBUG (SyncWorker_3) Send message: {'header': 'aa23cc00000000000002', 'body': '40c0046602ff02300000000000000000000000000000008e', 'type': 576}
2022-06-21 23:21:14 DEBUG (Thread-14) Message parsing header:aa22cc00000000000002, body:d0000000000000000000000000000000000000000000
2022-06-21 23:21:14 DEBUG (Thread-14) Unknown message {'header': 'aa22cc00000000000002', 'body': 'None', 'type': 0}
2022-06-21 23:21:14 DEBUG (Thread-14) Received message: {'header': 'aa22cc00000000000002', 'body': 'None', 'type': 0}
2022-06-21 23:21:14 DEBUG (Thread-14) {}
2022-06-21 23:21:44 DEBUG (Thread-14) Except socket.error <class 'OSError'> raised in socket.recv()
2022-06-21 23:21:44 DEBUG (Thread-14) Receive loop existed
2022-06-21 23:21:44 DEBUG (Thread-14) Ready to re-open device
2022-06-21 23:21:44 DEBUG (Thread-14) Try to connect to device 160528703186992
2022-06-21 23:21:44 DEBUG (Thread-14) Device 160528703186992 connected at socket <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.51.125', 50570), raddr=('192.168.51.210', 6444)>
2022-06-21 23:21:44 DEBUG (Thread-14) Authenticated
2022-06-21 23:21:44 DEBUG (Thread-14) Send message: {'header': 'aa23cc00000000000003', 'body': '418100ff03ff0002000000000000000000000000000000bd', 'type': 833}
2022-06-21 23:21:44 DEBUG (Thread-14) Message parsing header:aa22cc00000000000003, body:d0000000000000000000000000000000000000000000
2022-06-21 23:21:44 DEBUG (Thread-14) Unknown message {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:21:44 DEBUG (Thread-14) Received message: {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:21:44 DEBUG (Thread-14) {}
2022-06-21 23:21:44 DEBUG (Thread-14) Ready to receive loop
2022-06-21 23:22:14 DEBUG (Thread-14) Except socket.error <class 'OSError'> raised in socket.recv()
2022-06-21 23:22:14 DEBUG (Thread-14) Receive loop existed
2022-06-21 23:22:14 DEBUG (Thread-14) Ready to re-open device
2022-06-21 23:22:14 DEBUG (Thread-14) Try to connect to device 160528703186992
2022-06-21 23:22:14 DEBUG (Thread-14) Device 160528703186992 connected at socket <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.51.125', 50572), raddr=('192.168.51.210', 6444)>
2022-06-21 23:22:14 DEBUG (Thread-14) Authenticated
2022-06-21 23:22:14 DEBUG (Thread-14) Send message: {'header': 'aa23cc00000000000003', 'body': '418100ff03ff00020000000000000000000000000000003f', 'type': 833}
2022-06-21 23:22:15 DEBUG (Thread-14) Message parsing header:aa22cc00000000000003, body:d0000000000000000000000000000000000000000000
2022-06-21 23:22:15 DEBUG (Thread-14) Unknown message {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:22:15 DEBUG (Thread-14) Received message: {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:22:15 DEBUG (Thread-14) {}
2022-06-21 23:22:15 DEBUG (Thread-14) Ready to receive loop
2022-06-21 23:22:44 DEBUG (Thread-14) Except socket.error <class 'OSError'> raised in socket.recv()
2022-06-21 23:22:44 DEBUG (Thread-14) Receive loop existed
2022-06-21 23:22:44 DEBUG (Thread-14) Ready to re-open device
2022-06-21 23:22:44 DEBUG (Thread-14) Try to connect to device 160528703186992
2022-06-21 23:22:44 DEBUG (Thread-14) Device 160528703186992 connected at socket <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.51.125', 50574), raddr=('192.168.51.210', 6444)>
2022-06-21 23:22:44 DEBUG (Thread-14) Authenticated
2022-06-21 23:22:44 DEBUG (Thread-14) Send message: {'header': 'aa23cc00000000000003', 'body': '418100ff03ff0002000000000000000000000000000000d9', 'type': 833}
2022-06-21 23:22:45 DEBUG (Thread-14) Message parsing header:aa22cc00000000000003, body:d0000000000000000000000000000000000000000000
2022-06-21 23:22:45 DEBUG (Thread-14) Unknown message {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:22:45 DEBUG (Thread-14) Received message: {'header': 'aa22cc00000000000003', 'body': 'None', 'type': 0}
2022-06-21 23:22:45 DEBUG (Thread-14) {}
2022-06-21 23:22:45 DEBUG (Thread-14) Ready to receive loop
页: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15
查看完整版本: 跟美的死磕-美的局域网集成-2023.9.2-v0.3.19