abmantis / whirlpool-sixth-sense

Whirlpool unofficial API for 6th Sense appliances
MIT License
13 stars 12 forks source link

Include Maytag in United States #30

Closed perdw closed 1 year ago

perdw commented 1 year ago

It would be great if Maytag washers and dryers located in the United States could be accessed using this. I can access the machines using the Maytag phone app, but not via whirlpool-sixth-sense (I get an "Invalid authentication" error when using the credentials that work for the phone app). I'm not a programmer and can't help programming, but can help as a user for testing.

abmantis commented 1 year ago

Hello. Do you get any error if you use the "maytag" brand with this lib's cli?

mkmer commented 1 year ago

Also did you set region to US (-r "US" -b "maytag")

austinmroczek commented 1 year ago

I have a potentially similar problem trying with cli.py, but a Whirlpool washer.

python cli.py -r "US" -l -b "whirlpool" -e "my@email.com" -p "my_pass" results in

2023-04-07 16:28:17,927 [whirlpool.auth INFO]: Fetching auth with user/pass
2023-04-07 16:28:18,275 [whirlpool.auth DEBUG]: Auth status: 401
2023-04-07 16:28:18,275 [whirlpool.auth ERROR]: Authentication failed
Traceback (most recent call last):
  File "/home/pi/whirlpool-sixth-sense/cli.py", line 92, in <module>
    asyncio.run(start())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/pi/whirlpool-sixth-sense/cli.py", line 62, in start
    if not await appliance_manager.fetch_appliances():
  File "/home/pi/whirlpool-sixth-sense/whirlpool/appliancesmanager.py", line 42, in fetch_appliances
    headers=self._create_headers(),
  File "/home/pi/whirlpool-sixth-sense/whirlpool/appliancesmanager.py", line 29, in _create_headers
    "Authorization": "Bearer " + self._auth.get_access_token(),
TypeError: can only concatenate str (not "NoneType") to str

And I added an extra line in Auth() to print the entire object:

2023-04-07 16:28:18,275 [whirlpool.auth DEBUG]: Auth status: <ClientResponse(https://api.whrcloud.com/oauth/token) [401 Unauthorized]>
<CIMultiDictProxy('Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '71', 'Connection': 'keep-alive', 'Date': 'Fri, 07 Apr 2023 23:28:18 GMT', 'x-amzn-RequestId': '2fb406a8-8cad-4640-9a87-42b2d9fdc7c3', 'X-XSS-Protection': '1; mode=block', 'X-Frame-Options': 'DENY', 'x-amzn-Remapped-Connection': 'keep-alive', 'x-amz-apigw-id': 'DB8K4HpYCYcF6bQ=', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', 'x-amzn-Remapped-WWW-Authenticate': 'Form realm="oauth2/client", error="invalid_client", error_description="Bad client credentials"', 'Pragma': 'no-cache', 'x-amzn-Remapped-Date': 'Fri, 07 Apr 2023 23:28:18 GMT', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 c6c3c6447e7024b0ed2242e7aa9cff6a.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'LAX50-P5', 'X-Amz-Cf-Id': 'huKEVwlQ4ww2-1PKegO2YLOSvep_suZs6aZfZb4ZOycnYHVD8c6ohg==')>

I double checked I'm using the same credential I use for the Whirlpool iOS app and HA integration.

I was trying cli.py to see if I can see any extra info about my new WFW9620HW3 washer.

abmantis commented 1 year ago

I have a potentially similar problem trying with cli.py, but a Whirlpool washer.

python cli.py -r "US" -l -b "whirlpool" -e "my@email.com" -p "my_pass" results in

2023-04-07 16:28:17,927 [whirlpool.auth INFO]: Fetching auth with user/pass
2023-04-07 16:28:18,275 [whirlpool.auth DEBUG]: Auth status: 401
2023-04-07 16:28:18,275 [whirlpool.auth ERROR]: Authentication failed
Traceback (most recent call last):
  File "/home/pi/whirlpool-sixth-sense/cli.py", line 92, in <module>
    asyncio.run(start())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/pi/whirlpool-sixth-sense/cli.py", line 62, in start
    if not await appliance_manager.fetch_appliances():
  File "/home/pi/whirlpool-sixth-sense/whirlpool/appliancesmanager.py", line 42, in fetch_appliances
    headers=self._create_headers(),
  File "/home/pi/whirlpool-sixth-sense/whirlpool/appliancesmanager.py", line 29, in _create_headers
    "Authorization": "Bearer " + self._auth.get_access_token(),
TypeError: can only concatenate str (not "NoneType") to str

And I added an extra line in Auth() to print the entire object:

2023-04-07 16:28:18,275 [whirlpool.auth DEBUG]: Auth status: <ClientResponse(https://api.whrcloud.com/oauth/token) [401 Unauthorized]>
<CIMultiDictProxy('Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '71', 'Connection': 'keep-alive', 'Date': 'Fri, 07 Apr 2023 23:28:18 GMT', 'x-amzn-RequestId': '2fb406a8-8cad-4640-9a87-42b2d9fdc7c3', 'X-XSS-Protection': '1; mode=block', 'X-Frame-Options': 'DENY', 'x-amzn-Remapped-Connection': 'keep-alive', 'x-amz-apigw-id': 'DB8K4HpYCYcF6bQ=', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff', 'x-amzn-Remapped-WWW-Authenticate': 'Form realm="oauth2/client", error="invalid_client", error_description="Bad client credentials"', 'Pragma': 'no-cache', 'x-amzn-Remapped-Date': 'Fri, 07 Apr 2023 23:28:18 GMT', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 c6c3c6447e7024b0ed2242e7aa9cff6a.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'LAX50-P5', 'X-Amz-Cf-Id': 'huKEVwlQ4ww2-1PKegO2YLOSvep_suZs6aZfZb4ZOycnYHVD8c6ohg==')>

I double checked I'm using the same credential I use for the Whirlpool iOS app and HA integration.

I was trying cli.py to see if I can see any extra info about my new WFW9620HW3 washer.

Have you tried using maytag as brand instead?

austinmroczek commented 1 year ago

Using Maytag as brand did it, thanks.