Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
157 stars 38 forks source link

Can't get connected - test_key isn't working - US AAOS API access no longer permitted by Volvo #238

Closed bdwilson closed 1 week ago

bdwilson commented 1 month ago

I have created a key in the developer portal. Tried putting both keys into the vccapikey array, but also tried just one. Same error on both. Any ideas? Thank you in advance!

image
# docker run -d --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale='en_US' -e CONF_mqtt='@json {"broker": "192.168.1.226", "username": "", "password": "", "port": 1883}' -e CONF_volvoData='@json {"username": "xxxx@xx.com",
"password": "xxxxxx", "vin": "YV4EDxxxx", "vccapikey": ["xxxxx"]}' -e TZ='America/New_York' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest
Sep 24 20:56:14 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.10.0
Sep 24 20:56:14 volvo2mqtt [1] - INFO: Starting login with OTP
Sep 24 20:56:15 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 0/24
Sep 24 20:56:20 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 1/24
Sep 24 20:56:25 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 2/24
Sep 24 20:56:30 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 3/24
Sep 24 20:56:35 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 4/24
Sep 24 20:56:40 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 5/24
Sep 24 20:56:45 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 6/24
Traceback (most recent call last):
  File "/volvoAAOS2mqtt/./main.py", line 15, in <module>
    authorize()
  File "/volvoAAOS2mqtt/volvo.py", line 105, in authorize
    get_vcc_api_keys()
  File "/volvoAAOS2mqtt/volvo.py", line 245, in get_vcc_api_keys
    set_key_state(key)
  File "/volvoAAOS2mqtt/volvo.py", line 274, in set_key_state
    extended, extended_until = check_vcc_api_key(key)
  File "/volvoAAOS2mqtt/volvo.py", line 316, in check_vcc_api_key
    logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"])
KeyError: 'error'
Dielee commented 1 month ago

Two things:

  1. You only need the primary key, not the secondary.

  2. If you created the key, you have to wait a few hours, maybe days until the key works.

bdwilson commented 1 month ago

Thanks for the quick response!

1) I did try using just one key, same issue

2) key was created on 9/21.

I tried looking at the code and thought that the error message would print out the actual key that was being tried, but it's printing "test_key". Does that error message look correct?

Thank you!

Dielee commented 1 month ago

"test_key" is only the variable, so this looks good, but... Would you please check this endpoint with Postman and your VCCAPIKEY ?

https://api.volvocars.com/connected-vehicle/v2/vehicles

Dielee commented 1 month ago

Please use v1.10.1 and post the log output here

IceBotYT commented 1 month ago

I've been having the same error for months.


s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Sep 25 10:11:53 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.10.1
Sep 25 10:11:53 volvo2mqtt [106] - INFO: Using login from token file
Sep 25 10:11:53 volvo2mqtt [106] - INFO: Refreshing credentials
Sep 25 10:11:53 volvo2mqtt [106] - WARNING: VCCAPIKEY <redacted> isn't working! Statuscode 404 Message: { "statusCode": 404, "message": "Resource not found" }
Sep 25 10:11:53 volvo2mqtt [106] - WARNING: No working VCCAPIKEY found, waiting 10 minutes. Then trying again!

I am in the US so I believe it's related to the API shut down in the affected countries

bdwilson commented 1 month ago

I am in the US as well. Tried with a new key (created this morning) and 2 old keys (created 9/21).

image
bdwilson commented 1 month ago

Is this because I have a 2023? https://developer.volvocars.com/apis/connected-vehicle/v2/overview/

image
IceBotYT commented 1 month ago

No, API access in the US, Australia, and more countries was shut down around 10 months ago. No estimated return date was ever given. https://github.com/Dielee/volvo2mqtt/issues/136

bdwilson commented 1 month ago

Changing topic to help folks who come here with a similar issue.

github-actions[bot] commented 2 weeks ago

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

IceBotYT commented 2 weeks ago

Good news!! It seems API access has FINALLY been restored to the US!! 🎉🎉

IceBotYT commented 2 weeks ago

image

rsefer commented 2 weeks ago

I've also been able to connect for the last 24 hours! For what it's worth, however, most of the commands don't seem to work at all and the ones that do (door locks) seem to be inconsistent at best

smartelnovo commented 1 week ago

Same here, Canada is back up too, was down for 10 months, yeah! so far so good, stable here.

bdwilson commented 1 week ago

Confirming I can connect in the US!