Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVA II PRO WiFi support #1

Closed
skovacev opened this issue Dec 17, 2021 · 10 comments
Closed

EVA II PRO WiFi support #1

skovacev opened this issue Dec 17, 2021 · 10 comments

Comments

@skovacev
Copy link

Hi Nenad

Would it be possible to extend this library to manage EVA II PRO WiFi Smart Dehumidifier appliance?
It is similar to midea.
Midea apk is also capable to control it as well as its own Invmade || apk.

There is a library to control it via cloud, but would be great if it could be managed over LAN.

I did some port scanning and seams that it is listenig on port 6444.
https://github.com/barban-dev/midea_inventor_dehumidifier

@nbogojevic
Copy link
Owner

Hi Sinisa,

It should work with EVA II Pro - I have IONversion that is works. Anything that works with https://github.com/barban-dev/midea_inventor_dehumidifier and uses V3 Midea protocol should work fine.

Did you try running the discovery command?

@skovacev
Copy link
Author

skovacev commented Dec 21, 2021

Hi

I tried by using this (appkey is from midea.py )
python midea_beautiful_dehumidifier/cli.py --log DEBUG discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --appkey ff0cf6f5f0c3471de36341cab3f7a9af --credentials

It is throwing me an error
midea_beautiful_dehumidifier.exceptions.CloudAuthenticationError: CloudAuthenticationError 3301 Sign illegal.

I am sure that my credentials are ok as I use them to login when using my MideaAir app or Invmate || app.

If I try without appkey than I get following error
midea_beautiful_dehumidifier.exceptions.AuthenticationError: AuthenticationError missing token/key pair

Also to mention, when I use msmart lib to discover I get following output
{'type': 'a1', 'support': False, 'version': 2, 'ip': 'XXX.XXX.XXX.XXX', 'id': 1234567891234, 'port': 6444, 'token': None, 'key': None, 'ssid': 'net_a1_XXXX'}

@nbogojevic
Copy link
Owner

nbogojevic commented Dec 21, 2021

Can you try one of the following:

Using MideaAir app you'd need to provide appid as it is different from default one 1017:

python midea_beautiful_dehumidifier/cli.py --log DEBUG discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --credentials --appkey ff0cf6f5f0c3471de36341cab3f7a9af --appid 1117

Using default NetHome Plus app should work also:

python midea_beautiful_dehumidifier/cli.py --log DEBUG discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --credentials

@skovacev
Copy link
Author

Hi,

When running commands I get following.
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/lan.py", line 165, in init
if reply[55 + ssid_len] != 0:
IndexError: index out of range

I see you are expecting # ssid like midea_xx_xxxx net_xx_xxxx
but from my previous post you can see that 'ssid': 'net_a1_XXXX' where X is some number.

@skovacev
Copy link
Author

Hi again,

I did a change to print out replay and got this

Some appliance(s) where not discovered on local network(s): 0 discovered out of 1
Unable to discover registered appliance name=Living Room, id=XXXXXXXXXXXXXXX, type=0xA1
addr=None:6444
id = XXXXXXXXXXXXXXX
s/n = None
model = Dehumidifier
ssid = None
online = True
name = Living Room
humid% = 45
target% = 50
fan = 40
tank = False
mode = 0
ion = False
token =
key =

@nbogojevic
Copy link
Owner

nbogojevic commented Dec 21, 2021

I've just published version 0.1.1. Can you try that one and use option --log NOTSET to get highest level of logs.

E.g.

python midea_beautiful_dehumidifier/cli.py --log NOTSET discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --credentials --appkey ff0cf6f5f0c3471de36341cab3f7a9af --appid 1117

Can you attach your logs after - (check to remove personal information like email/token/password).

BTW on what OS do you run the discovery. I had it working on Linux and Windows, but not in WSL.

@skovacev
Copy link
Author

Hi,

I am running it on Debian Linux.
Command executed-> python midea_beautiful_dehumidifier/cli.py --log NOTSET discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --credentials

2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Library version=0.1.1
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG Starting new HTTPS connection (1): mapp.appsmb.com:443
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG https://mapp.appsmb.com:443 "POST /v1/user/login/id/get HTTP/1.1" 200 None
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG Starting new HTTPS connection (1): mapp.appsmb.com:443
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG https://mapp.appsmb.com:443 "POST /v1/user/login HTTP/1.1" 200 None
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Scanning for midea dehumidifier appliances
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Starting LAN discovery
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP request homegroup/list/get: {'appId': 1017, 'format': 2, 'clientType': 1, 'language': 'en_US', 'src': 17, 'stamp': '20211222092941', 'sessionId': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'sign': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG Starting new HTTPS connection (1): mapp.appsmb.com:443
2021-12-22 09:29:41 openhab urllib3.connectionpool[8158] DEBUG https://mapp.appsmb.com:443 "POST /v1/homegroup/list/get HTTP/1.1" 200 None
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP response text: {"msg":"ok","result":{"list":[{"number":"XXXXXXX","isDefault":"1","createUserId":"XXXXXXX","des":"","address":"","coordinate":"","createTime":"2020-01-15 19:17:39","roleId":"1001","name":"","nickname":"","id":"XXXXXXX"}]},"errorCode":"0"}
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP response: {'msg': 'ok', 'result': {'list': [{'number': 'XXXXXXX', 'isDefault': '1', 'createUserId': 'XXXXXXX', 'des': '', 'address': '', 'coordinate': '', 'createTime': '2020-01-15 19:17:39', 'roleId': '1001', 'name': '', 'nickname': '', 'id': 'XXXXXXX'}]}, 'errorCode': '0'}
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.cloud[8158] DEBUG Midea home group query result={'list': [{'number': 'XXXXXXX', 'isDefault': '1', 'createUserId': 'XXXXXXX', 'des': '', 'address': '', 'coordinate': '', 'createTime': '2020-01-15 19:17:39', 'roleId': '1001', 'name': '', 'nickname': '', 'id': 'XXXXXXX'}]}
2021-12-22 09:29:41 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP request appliance/list/get: {'appId': 1017, 'format': 2, 'clientType': 1, 'language': 'en_US', 'src': 17, 'stamp': '20211222092941', 'homegroupId': 'XXXXXXX', 'sessionId': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'sign': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}
2021-12-22 09:29:42 openhab urllib3.connectionpool[8158] DEBUG Starting new HTTPS connection (1): mapp.appsmb.com:443
2021-12-22 09:29:42 openhab urllib3.connectionpool[8158] DEBUG https://mapp.appsmb.com:443 "POST /v1/appliance/list/get HTTP/1.1" 200 None
2021-12-22 09:29:42 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP response text: {"msg":"ok","result":{"list":[{"masterId":"","des":"","activeStatus":"1","onlineStatus":"1","name":"Living Room","modelNumber":"0","id":"XXXXXXXXXXXXXX","sn":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","type":"0xA1","tsn":"","mac":""}]},"errorCode":"0"}
2021-12-22 09:29:42 openhab midea_beautiful_dehumidifier.cloud[8158] Level 5 HTTP response: {'msg': 'ok', 'result': {'list': [{'masterId': '', 'des': '', 'activeStatus': '1', 'onlineStatus': '1', 'name': 'Living Room', 'modelNumber': '0', 'id': 'XXXXXXXXXXXXXX', 'sn': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'type': '0xA1', 'tsn': '', 'mac': ''}]}, 'errorCode': '0'}
2021-12-22 09:29:42 openhab midea_beautiful_dehumidifier.cloud[8158] DEBUG Midea appliance list results=[{'masterId': '', 'des': '', 'activeStatus': '1', 'onlineStatus': '1', 'name': 'Living Room', 'modelNumber': '0', 'id': 'XXXXXXXXXXXXXX', 'sn': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'type': '0xA1', 'tsn': '', 'mac': ''}]
2021-12-22 09:29:42 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Broadcast attempt 1 of max 2
2021-12-22 09:29:42 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Network XXX.XXX.XXX.XXX, broadcast address XXX.XXX.XXX.XXX
2021-12-22 09:29:45 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Finished broadcast collection
2021-12-22 09:29:45 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Broadcast attempt 2 of max 2
2021-12-22 09:29:48 openhab midea_beautiful_dehumidifier.scanner[8158] DEBUG Finished broadcast collection
2021-12-22 09:29:48 openhab midea_beautiful_dehumidifier.scanner[8158] WARNING Some appliance(s) where not discovered on local network(s): 0 discovered out of 1
2021-12-22 09:29:48 openhab midea_beautiful_dehumidifier.scanner[8158] WARNING Unable to discover registered appliance name=Living Room, id=XXXXXXXXXXXXXX, type=0xA1
addr=None:6444
id = XXXXXXXXXXXXXX
s/n = None
model = Dehumidifier
ssid = None
online = True
name = Living Room
humid% = 45
target% = 50
fan = 40
tank = False
mode = 0
ion = False
token =
key =

#############################################################

When running command-> python midea_beautiful_dehumidifier/cli.py --log NOTSET discover --account xxxxxxxx@xxxxxx.xxx --password xxxxxxxxxx --credentials --appkey ff0cf6f5f0c3471de36341cab3f7a9af --appid 1117

I get same first part of logs, however I can see also following:

--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.8/logging/init.py", line 1081, in emit
msg = self.format(record)
File "/usr/local/lib/python3.8/logging/init.py", line 925, in format
return fmt.format(record)
File "/home/pi/.local/lib/python3.8/site-packages/coloredlogs/init.py", line 1140, in format
return logging.Formatter.format(self, record)
File "/usr/local/lib/python3.8/logging/init.py", line 664, in format
record.message = record.getMessage()
File "/usr/local/lib/python3.8/logging/init.py", line 369, in getMessage
msg = msg % self.args
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/lan.py", line 609, in repr
self.udp_version,
AttributeError: 'LanDevice' object has no attribute 'udp_version'
Call stack:
File "midea_beautiful_dehumidifier/cli.py", line 143, in
cli()
File "midea_beautiful_dehumidifier/cli.py", line 115, in cli
appliances = find_appliances(
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/scanner.py", line 192, in find_appliances
_find_appliances_on_lan(cloud, appliances)
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/scanner.py", line 148, in _find_appliances_on_lan
scanned_appliances = list(discovery.collect_appliances())
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/scanner.py", line 45, in collect_appliances
appliance = LanDevice(data=data)
File "/home/pi/.local/lib/python3.8/site-packages/midea_beautiful_dehumidifier/lan.py", line 212, in init
_LOGGER.debug("Descriptor data from %s: %r", self, self)
Unable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.
2021-12-22 09:36:54 openhab midea_beautiful_dehumidifier.scanner[8504] ERROR Unable to load data for appliance id=XXXXXXXXXXXXXXX ip=XXX.XXX.XXX.XXX:6444 version=2
2021-12-22 09:36:57 openhab midea_beautiful_dehumidifier.scanner[8504] DEBUG Finished broadcast collection
2021-12-22 09:36:57 openhab midea_beautiful_dehumidifier.scanner[8504] DEBUG Broadcast attempt 2 of max 2
2021-12-22 09:37:00 openhab midea_beautiful_dehumidifier.scanner[8504] DEBUG Finished broadcast collection
2021-12-22 09:37:00 openhab midea_beautiful_dehumidifier.scanner[8504] WARNING Some appliance(s) where not discovered on local network(s): 0 discovered out of 1
2021-12-22 09:37:00 openhab midea_beautiful_dehumidifier.scanner[8504] WARNING Unable to discover registered appliance name=Living Room, id=XXXXXXXXXXXXXXX, type=0xA1
addr=None:6444
id = XXXXXXXXXXXXXXX
s/n = None
model = Dehumidifier
ssid = None
online = True
name = Living Room
humid% = 45
target% = 50
fan = 40
tank = False
mode = 0
ion = False
token =
key =

@nbogojevic
Copy link
Owner

nbogojevic commented Dec 22, 2021

There is some reason why your dehumidifier doesn't respond to broadcast packet. Is it on the same subnet as your openhab server?
Meanwhile I have published version 0.3.0 which has support for targeting appliance directly if you know its address.

midea_beautiful_dehumidifier-cli discover --account ACCOUNT_EMAIL --password PASSWORD --network 192.0.1.3 --credentials

@kskarlatos
Copy link

kskarlatos commented Dec 26, 2021

Hello, i have the same problem. Discovery give empty token and key.
I should note that the dehumidifier works with barban-dev .
The device also works with
midea-beautiful-dehumidifier-cli set --ip 192.168.101.13 --account xxx --password xxx --on ON

addr=192.168.101.13:6444
id = xxxx
s/n = xxx
model = Dehumidifier
ssid = net_a1_15AF
online = True
name = Dehumidifier15AF
running = False
humid% = 0
target% = 0
fan = 0
tank = False
mode = 1
ion = False
filter = False
pump = False
defrost = False
error = 0
version = 2
token =
key =

@nbogojevic
Copy link
Owner

V2 of protocol is working since version 0.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants