nbogojevic / midea-beautiful-air

Python client for accessing Midea air conditioners and dehumidifiers (Midea, Comfee, Inventor EVO) via local network
MIT License
116 stars 19 forks source link

"status" raises midea_beautiful.exceptions.MideaError: Missing cloud credentials; "discover" works #36

Closed cdzombak closed 1 month ago

cdzombak commented 3 months ago

Version of the library

midea-beautiful-air==0.10.5

Logs

$ midea-beautiful-air-cli discover --account 'XXX' --password 'XXX' --app MSmartHome
id 000000P0000000Q1C43960B52DDC0000/150633093523978
  id      = 150633093523978
  addr    = 192.168.202.43
  s/n     = 000000P0000000Q1C43960B52DDC0000
  model   = Dehumidifier
  ssid    = net_a1_2DDC
  online  = True
  name    = Basement Dehumidifier
  running = True
  humid%  = 81
  target% = 45
  temp    = 23.0
  fan     = 40
  tank    = True
  mode    = 1
  ion     = False
  filter  = False
  pump    = False
  defrost = False
  sleep   = False
  error   = 38
  supports= {'fan_speed': 3, 'filter': 2, 'dry_clothes': 1, 'water_level': 4}
  version = 3

$ midea-beautiful-air-cli --log DEBUG --verbose status --account 'XXX' --password 'XXX' --app MSmartHome --id 150633093523978
DEBUG:midea_beautiful.cloud:HTTP request /v1/multicloud/platform/user/route: {'x-recipe-app': '1010', 'Authorization': 'Basic ********************************************************', 'sign': 'XXX', 'secretVersion': '1', 'random': 'XXX', 'version': '2.22.0', 'systemVersion': '8.1.0', 'platform': '0', 'Accept-Encoding': 'identity', 'Content-Type': 'application/json'} {'appId': 1010, 'format': 2, 'clientType': 1, 'language': 'en_US', 'src': 1010, 'stamp': '20240805114625', 'deviceId': 'c1acad8939ac0d7d', 'userName': 'XXX********', 'appVNum': '2.22.0', 'appVersion': '2.22.0', 'clientVersion': '2.22.0', 'platformId': '1', 'reqId': 'a1b67468b455908141768499a463e896', 'retryCount': '3', 'uid': '', 'userType': '0'}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mp-prod.appsmb.com:443
DEBUG:urllib3.connectionpool:https://mp-prod.appsmb.com:443 "POST /mas/v5/app/proxy?alias=/v1/multicloud/platform/user/route HTTP/11" 200 190
DEBUG:midea_beautiful.cloud:HTTP response text: {"msg":"ok","code":0,"data":{"masUrl":"https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=","sseUrl":"https://sse.msmartlife.net","idAdapt":"131329","countryCode":"HK","emsIdAdapt":"132097"}}
DEBUG:midea_beautiful.cloud:HTTP response: {'msg': 'ok', 'code': 0, 'data': {'masUrl': 'https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=', 'sseUrl': 'https://sse.msmartlife.net', 'idAdapt': '131329', 'countryCode': 'HK', 'emsIdAdapt': '132097'}}
DEBUG:midea_beautiful.cloud:using key='data', result={'masUrl': 'https://mp-prod.appsmb.com/mas/v5/app/proxy?alias=', 'sseUrl': 'https://sse.msmartlife.net', 'idAdapt': '131329', 'countryCode': 'HK', 'emsIdAdapt': '132097'}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mp-prod.appsmb.com:443
DEBUG:urllib3.connectionpool:https://mp-prod.appsmb.com:443 "POST /mas/v5/app/proxy?alias=/v1/user/login/id/get HTTP/11" 200 77
DEBUG:midea_beautiful.cloud:HTTP response: *** REDACTED ***
DEBUG:midea_beautiful.cloud:using key='data', result=*** REDACTED ***
DEBUG:midea_beautiful.cloud:HTTP request /mj/user/login: {'x-recipe-app': '1010', 'Authorization': 'Basic ********************************************************', 'sign': 'XXX', 'secretVersion': '1', 'random': 'XXX', 'version': '2.22.0', 'systemVersion': '8.1.0', 'platform': '0', 'Accept-Encoding': 'identity', 'Content-Type': 'application/json'} {'data': {'appKey': 'ac21b9f9cbfe4ca5a88562ef25e2b768', 'appVersion': '2.22.0', 'osVersion': '8.1.0', 'deviceId': 'c1acad8939ac0d7d', 'platform': '2'}, 'iotData': {'appId': '1010', 'appVNum': '2.22.0', 'appVersion': '2.22.0', 'clientType': 1, 'clientVersion': '2.22.0', 'format': 2, 'language': 'en_US', 'iampwd': '****************************************************************', 'loginAccount': 'XXX********', 'password': '****************************************************************', 'pushToken': 'CK-XXX', 'pushType': '4', 'reqId': '0c128d4b80ba79dcbfb5cbfbf5004643', 'retryCount': '3', 'src': '10', 'stamp': '20240805114625'}, 'reqId': '09ee0d3528411eac9d7d4da8ee914265', 'stamp': '20240805114625'}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mp-prod.appsmb.com:443
DEBUG:urllib3.connectionpool:https://mp-prod.appsmb.com:443 "POST /mas/v5/app/proxy?alias=/mj/user/login HTTP/11" 200 843
DEBUG:midea_beautiful.cloud:HTTP response: *** REDACTED ***
DEBUG:midea_beautiful.cloud:using key='data', result=*** REDACTED ***
DEBUG:midea_beautiful.cloud:UID=b76f54355ce3e6c13e9052dbeff44302
Traceback (most recent call last):
  File "/Users/cdzombak/code/midea-influx-connector/venv/bin/midea-beautiful-air-cli", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/cdzombak/code/midea-influx-connector/venv/lib/python3.12/site-packages/midea_beautiful/cli.py", line 342, in cli
    return function(args)
           ^^^^^^^^^^^^^^
  File "/Users/cdzombak/code/midea-influx-connector/venv/lib/python3.12/site-packages/midea_beautiful/cli.py", line 145, in _run_status_command
    appliance = appliance_state(
                ^^^^^^^^^^^^^^^^
  File "/Users/cdzombak/code/midea-influx-connector/venv/lib/python3.12/site-packages/midea_beautiful/lan.py", line 1040, in appliance_state
    raise MideaError("Missing cloud credentials")
midea_beautiful.exceptions.MideaError: Missing cloud credentials

Model of appliance where problem occurs

Midea Cube Dehumidifier

Describe the bug

midea-beautiful-air-cli discover finds the dehumidifier and reads its details as expected (see first part of the log above), but midea-beautiful-air-cli status raises the exception midea_beautiful.exceptions.MideaError: Missing cloud credentials (see the second part of the log above).

VladislavEkimtcov commented 3 months ago

Don't forget to use --cloud when connecting over cloud

VladislavEkimtcov commented 3 months ago

Also, the MSmartHome app suport is broken. Re-register your appliance in Midea Air instead

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.