midea-ac-py icon indicating copy to clipboard operation
midea-ac-py copied to clipboard

请求支持“防直吹”功能

Open ha0y opened this issue 2 years ago • 4 comments

Describe the solution you'd like (描述需求) 该功能是空调的一个预设,在APP上也有开关,开启后会将风速和导风板方向调整为特定状态(这些状态无法通过手动设置调出),可显著提高人坐在空调前时的舒适度。

Screenshots / Logs / Pcap File(屏幕截图/日志/抓包文件) If applicable, add screenshots or your home-assistant log file or pcap file to help explain your problem. 请提交相关截图,日志,抓包让开发者能够更快的解决问题

adb logcat 未发现有价值内容:

08-12 22:23:12.860 25995 26083 I jsLog   : log_utils.cpp:43, 防直吹
08-12 22:23:12.889 25995 26083 I jsLog   : log_utils.cpp:43, true
08-12 22:23:12.900 25995 26083 I jsLog   : log_utils.cpp:43, weex-console ---- "deviceStatusChanged"
08-12 22:23:12.936 25922 25922 I MSmartArcSlider:  key is ->data  param is ->{"completedColor":"#ffffff","incompletedCol
or":"#76A4F8","endingSlice":110,"thickness":6,"pointShow":true,"totalCounter":28,"progressCounter":20,"pointRadius":25,"
padding":20,"startingSlice":-110,"pointColor":"","pointImageBase64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAA

是否需要 Wireshark 抓包?因担心隐私问题,如需抓包文件我会单独发给您。

ha0y avatar Aug 12 '21 14:08 ha0y

为测试“防直吹”功能,用下列程序调用msmart

while(True):
    print("turn on: ")
    time.sleep(15)
    for i in range(3):
        device.refresh()
    print("turn off: ")
    time.sleep(15)
    for i in range(3):
        device.refresh()

已将logging级别设为ERROR,并在每次调用refresh()时打印"Appliance response data":

class appliance_response:

    def __init__(self, data: bytearray):
        # The response data from the appliance includes a packet header which we don't want
        self.data = data[0xa:]
        _LOGGER.debug("Appliance response data: {}".format(self.data.hex()))
        print(self.data.hex())

打印"turn on: "时手动打开“防直吹”功能,打印"turn off: "时手动关闭,程序输出:

turn on: 
b50142000102044cf0
c001ad017f7f0000000000707111005100000000000000282331
c001ad017f7f0000000000707111005100000000000000282331
turn off: 
c001ad017f7f0000000000707111005100000000000000297dd6
b5014200010129c751
c001ad017f7f000000000070711100510000000000000038be86
c001ad017f7f000000000070711100510000000000000038be86
turn on: 
c001ad017f7f000000000070711100510000000000000038be86
b501420001023851b7
c001ad017f7f00000000007071110051000000000000000be28f
c001ad017f7f00000000007071110051000000000000000be28f
turn off: 
c001ad017f7f00000000007071110051000000000000000c610f
b501420001010cdb5a
c001ad017f7f00000000007071110051000000000000001b7fe2
c001ad017f7f00000000007071110051000000000000001b7fe2
turn on: 
c001ad017f7f00000000007071110051000000000000001b7fe2
b501420001021b9095
c001ad017f7f00000000007071110051000000000000002a9fb3
c001ad017f7f00000000007071110051000000000000002a9fb3

现在发现的唯一规律是“b501420001021b9095”这个短的response的倒数第7位在打开时是2,关闭时是1。 @mac-zhou

DragonRollGH avatar Oct 04 '21 08:10 DragonRollGH

附Wireshark抓包数据。

防直吹31打开116关闭.zip

操作: 空调ip为192.168.137.60,用手机连接4G,通过APP打开防直吹功能。 在第31行(时间戳约为10s)时打开防直吹。 在第116行(时间戳约为20s)时关闭防直吹。

DragonRollGH avatar Oct 04 '21 08:10 DragonRollGH

防直吹 这个功能并不是所有机型都支持 所以后面是考虑增加自定义控制命令

mac-zhou avatar Jan 10 '22 00:01 mac-zhou

看到msmart-0.2.5 merge了capabilities相关模块,capabilities的定义中包括防直吹等多个功能,并增加了get_capabilities()。 请问是否可以提供set_capabilities()来调用防直吹的功能呢? @mac-zhou

DragonRollGH avatar Jul 17 '22 13:07 DragonRollGH