mac-zhou / midea-msmart

This is a library to allow communicating to a Midea AC via the Local area network.
MIT License
147 stars 40 forks source link

Example does not work #37

Closed chicxurug closed 3 years ago

chicxurug commented 3 years ago

In the example.py the port parameter is missing:

c = midea_device('YOUR_AC_IP', YOUR_AC_ID)

The port has no default value thus needs to be provided. Would be nice to see an actually working example or the port initialized with adefault one. What is the most common port for Midea AC?

zvldz commented 3 years ago

default port 6444

chicxurug commented 3 years ago

Thanks. It seems to send something on port 6444, but still get an error: INFO:msmart.lan:Couldn't connect with Device 192.168.0.173:6444 Is it due to the AC is not supported (Midea Extreme Save)? Mobile app works fine.

zxq432 commented 3 years ago

c = midea_device('YOUR_AC_IP', YOUR_A_ID, YOUR_AC_PORT)

mac-zhou commented 3 years ago

you can use command midea-discover to find YOUR_AC_PORT. not surprisingly, it should be 6444. if you see Found a unsupported device, you can't use this example.py

zxq432 commented 3 years ago

midea_device fuction needs 3 args: midea_device(device_ip, device_id, device_port), the 3rd arg is needed.

, but the example.py only supplied 2 args: midea_device('YOUR_AC_IP', YOUR_AC_ID)

it is needed to make change to example.py from midea_device('YOUR_AC_IP', YOUR_AC_ID) to midea_device('YOUR_AC_IP', YOUR_AC_ID, 6444)

please check cli.py to verify it:

cli.py:from msmart.device import device as midea_device

cli.py: _device = midea_device(device_ip, device_id, device_port)


------------------ 原始邮件 ------------------

发件人: Mac_Zhou @.***>

发送时间: 2021-07-12 11:17:25

收件人:mac-zhou/midea-msmart @.***>

抄送:zxq432 @.>,Comment @.>

主题: Re: [mac-zhou/midea-msmart] Example does not work (#37)

you can use command midea-discover to find YOUR_AC_PORT. not surprisingly, it should be 6444. if you see Found a unsupported device, you can't use this example.py

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

mac-zhou commented 3 years ago

try new version

mac-zhou commented 3 years ago

https://github.com/mac-zhou/midea-msmart/commit/48bd5b1c309a8eda7940f82c3e2840ffa9c757db