sdague / mychevy

Python module to interact with my.chevy website for collecting charge data for chevy bolt
Other
50 stars 8 forks source link

Account does not have a supported vehicle #8

Closed PRabahy closed 5 years ago

PRabahy commented 5 years ago

Description

I am trying to get the info about my Chevy Bolt into Home assistant. I configured Home Assistant by following https://www.home-assistant.io/components/mychevy/. When I boot Home Assistant I get

{'messages': ['Account does not have a supported vehicle.'], 'serverErrorMsgs': ['Account does not have a supported vehicle.'], 'data': 'SERVER ERROR'}, Retrying in 3 seconds...

3 times followed by

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mychevy.py", line 139, in run
    self.update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 324, in wrapper
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mychevy.py", line 121, in update
    self.cars = self._client.update_cars()
  File "/usr/local/lib/python3.6/site-packages/mychevy/mychevy.py", line 229, in update_cars
    self._fetch_car(c)
  File "/usr/local/lib/python3.6/site-packages/mychevy/mychevy.py", line 85, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/mychevy/mychevy.py", line 225, in _fetch_car
    car.from_json(res.content)
  File "/usr/local/lib/python3.6/site-packages/mychevy/mychevy.py", line 136, in from_json
    raise ServerError(res)
mychevy.mychevy.ServerError: {'messages': ['Account does not have a supported vehicle.'], 'serverErrorMsgs': ['Account does not have a supported vehicle.'], 'data': 'SERVER ERROR'}

I'm not sure if it would be better to report this to https://github.com/home-assistant/home-assistant.

What I Did

I double checked that I could log into https://my.chevrolet.com and everything appeared to be working properly.

sdague commented 5 years ago

The onstar link is definitely flakey. There is a mychevy-debug included with the library that provides some more detailed messages of where everything goes wrong.

What kind of vehicle do you have?

PRabahy commented 5 years ago

What kind of vehicle do you have?

Its a 2019 Chevy Bolt EV.

PRabahy commented 5 years ago

I just got this repo working on my local machine, so I was able to do a bit more debugging. I was able to login and get my car, but when I try to update the car, it fails.

>>> str(page.cars[0])
'<EVCar name=2019 Chevrolet Bolt EV, electricRange=0 miles, batteryLevel=%, plugged_in=False, totalMiles=0 miles, chargeState=, chargeMode=, estimatedFullChargeBy=>'

page.cars[0].vin and page.cars[0].vid also return correct values.

Any other ideas of things I can do/check?

sdague commented 5 years ago

Anything useful from: mychevy-debug -v ?

PRabahy commented 5 years ago

It doesn't look like it.

Edit: I redacted the VIN and OnstarAccount number in notepad before posting. They looked correct before I posted them.

C:\Users\PRabahy>mychevy-debug -v -c config.ini
Logging in... this takes a bit
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): my.chevrolet.com:443
DEBUG:urllib3.connectionpool:https://my.chevrolet.com:443 "GET /login HTTP/1.1" 302 657
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): accounts.gm.com:443
DEBUG:urllib3.connectionpool:https://accounts.gm.com:443 "GET /gmappcloud/gmoc/sso.do?returnUrl=https%3A%2F%2Fmy.chevrolet.com%3A443%2Flogin&entityID=my.chevrolet.com.v2&TARGET=https%3A%2F%2Fmy.chevrolet.com%3A443%2Flogin HTTP/1.1" 302 0

DEBUG:urllib3.connectionpool:https://my.chevrolet.com:443 "GET /login HTTP/1.1" 200 2219
DEBUG:urllib3.connectionpool:https://my.chevrolet.com:443 "POST /oc_login HTTP/1.1" 200 2050
DEBUG:mychevy.mychevy:Vehicles: {'11586561': {'vehicle_id': '11586561', 'vin': 'VINREDACTED', 'year': '2019', 'make': 'Chevrolet', 'model': 'Bolt EV', 'modelCode': 'Bolt EV', 'images': None, 'registerType': None, 'registerDate': No
ne, 'options': {'navigation': None, 'bluetooth': 'bluetooth'}, 'radio_id': None, 'xm_radio_id': None, 'xmEnabled': True, 'xm_expiration_date': None, 'onstarAccountNumber': 'ONSTARACCOUNTREDACTED', 'onstarEnabled': True, 'onstarSubscriptionServicesNa
me': 'OnStar Safety and Security Plan', 'onstarSubscriptionServicesExpirationDate': None, 'preferredDealer': None, 'preferredSalesDealer': None, 'sellingDealer': None, 'odometer': '1536', 'odometerLastUpdated': 1545109200000, 'imageUrl':
 'https://cgi.chevrolet.com/mmgprod-us/dynres/prove/image.gen?i=2019/1FB48/1FB48__2LT/GD1_FE9_EN0_MMF_2LT_RNW_QBM_AR7_HO2_IOB_WPU_WPR_NT7_CBT_SFE_TUS_KA1_VAV_N34_KI3_DD8_W2D_UD7_UFG_UKC/gmds2.png&v=deg01&std=true&country=US', 'displaySDP
ageFlag': 'N', 'renderImageUrl': 'https://cgi.chevrolet.com/mmgprod-us/dynres/prove/image.gen?i=2019/1FB48/1FB48__2LT/GD1_FE9_EN0_MMF_2LT_RNW_QBM_AR7_HO2_IOB_WPU_WPR_NT7_CBT_SFE_TUS_KA1_VAV_N34_KI3_DD8_W2D_UD7_UFG_UKC/gmds2.png&v=deg01&s
td=true&country=US', 'fuelType': 'Electric Fuel System', 'bluetooth': 'bluetooth', 'embeddedNav': None, 'oemCode': 'IOB', 'trim': 'LT', 'electricMotor': None, 'source': None, 'wifiEnabled': True, 'bluetoothEnabled': None, 'navigationEnab
led': None, 'personalizationEnabled': False, 'appShopEnabled': False, 'radioTCPSEnabled': False, 'directWIFIEnabled': False, 'stationId': '160221637', 'onStarActive': True, 'dataPlan': {'segmentCode': 'E', 'planName': None, 'qtyRemaining
': '0', 'exprDate': None, 'initialQty': None, 'uom': None, 'hotSpotSsId': None, 'hotSpotPassword': None, 'vin': None, 'onStarAccountNumber': None, 'changeStatusCode': None, 'changeStatusDescription': None, 'referenceId': None, 'endpointE
nvUrl': None, 'stationId': None, 'callbackResponse': None, 'numberOfAttempts': 0, 'goodThruDate': None, 'trial': False, 'status': None}, 'mmc': None, 'peg': None, 'factoryOptions': None, 'cgiImageUrl': None, 'optionCodes': 'GD1,FE9,EN0,M
MF,2LT,RNW,QBM,AR7,HO2,IOB,WPU,WPR,NT7,CBT,SFE,TUS,KA1,VAV,N34,KI3,DD8,W2D,UD7,UFG,UKC', 'personalizationStatus': None, 'personalizationName': None, 'serviceRenewedMonthly': True, 'removedOnStarAssoc': None, 'subscriptionType': 'NBM', 'e
xpirationDate': None, 'planName': 'OnStar Safety and Security Plan'}}
Displaying found cars
<EVCar name=2019 Chevrolet Bolt EV, electricRange=0 miles, batteryLevel=%, plugged_in=False, totalMiles=0 miles, chargeState=, chargeMode=, estimatedFullChargeBy=>
Updating cars with data
DEBUG:mychevy.mychevy:Fetching car...
DEBUG:urllib3.connectionpool:https://my.chevrolet.com:443 "GET /vehicleProfile/VINREDACTED/ONSTARACCOUNTREDACTED/createAppSessionKey?cb=1546808020332.15258643512041 HTTP/1.1" 500 146
DEBUG:urllib3.connectionpool:https://my.chevrolet.com:443 "GET /api/vehicleProfile/VINREDACTED/ONSTARACCOUNTREDACTED/evstats/false?cb=1546808020913.15258643512041 HTTP/1.1" 500 146
DEBUG:mychevy.mychevy:Vehicle data: b'{"messages":["Account does not have a supported vehicle."],"serverErrorMsgs":["Account does not have a supported vehicle."],"data":"SERVER ERROR"}'
OnStar Network Failure: {'messages': ['Account does not have a supported vehicle.'], 'serverErrorMsgs': ['Account does not have a supported vehicle.'], 'data': 'SERVER ERROR'}
PRabahy commented 5 years ago

I didn't change anything, but its working now... I had the config in my home assistant all along and it never worked until a day or 2 ago, but now it is working fairly reliably. So weird.

sdague commented 5 years ago

The OnStar network is really flakey. So it doesn't completely surprise me that the vehicle comes and goes. I'd love it if they had a more reliable network for these requests.