mac-zhou / midea-msmart

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

Cant get python scripts to work. #27

Closed Marctraider closed 4 years ago

Marctraider commented 4 years ago

Traceback (most recent call last): File "example.py", line 2, in <module> from msmart.device import device as midea_device File "/root/midea-msmart/msmart/device.py", line 17 def convert_device_id_hex(device_id: int):

Not sure ... midea-ac-py works fine with Home Assistant locally.

Also media-discover is unable to find any device at all when used on my x86 router

Marctraider commented 4 years ago

I got further now:

Traceback (most recent call last): File "example.py", line 9, in <module> c = midea_device('192.168.1.104', 18691697708402) TypeError: __init__() missing 1 required positional argument: 'device_port'

Marctraider commented 4 years ago

root@debian:~/midea-msmart# midea-discover INFO:msmart.cli:msmart version: 0.1.23 INFO:msmart.cli:Sending Device Scan Broadcast... INFO:msmart.cli:Midea Local Data 192.168.1.154 5a5a011178007a80000000000000000000000000728d000000110000000000000000000001000000cdb6d3b9fbd1fe506e477034e9a958a5b1863e6faa5a893bdea81be9f0ff60e803c53332297a943807ac997b43ddf54f2edd7fe2fc8ffb10d8a6df305a549c90224ee42dd1884cc1880381cbe4a806ad INFO:msmart.cli:Decrypt Reply: 192.168.1.154 9a01a8c02c19000030303030303050303030303030305131463043394431314141333242303030300b6e65745f61635f41333242 INFO:msmart.cli:*** Found a supported device - type: '0xac' - version: V2 - ip: 192.168.1.154 - port: 6444 - id: 18691697708402 - sn: 000000P0000000Q1F0C9D11AA32B0000 - ssid: net_ac_A32B

Still have the above port issue though.

kueblc commented 4 years ago

TypeError: init() missing 1 required positional argument: 'device_port'

You must specify the device_port as the third argument on line 9.

Marctraider commented 4 years ago

Heh, yeah, just figured it out. I tried it as x.x.x.x:6444 first and as second argument, and I just tried it your way just before you replied.

Thanks anyhow though, in case I didn't figure it out! Amazing work! Thanks!