Invalid authentication

Version: 0.1.0
When attempting to connect the integration to my 2024 Porsche 911 with an active Porsche Connect account, I consistently receive an "Invalid authentication" error. The username and password are correct, and I’ve confirmed I can successfully log in to Porsche’s website with these credentials. I retried multiple times, but the error persists.

Add me to having the same issue, I can log in everywhere else, App works as well.
Thanks !

I have the same issue.

Same for me.  Thanks for all your hard work.

Same here unfortunately. Excited to see it back again though.

Same issue here. Simply states “Invalid authentication” error message.

I have the same, I tried deleting the integration and then reinstalling after a reboot but have invalid authentication

I suspect there may be some leftovers if you have had the previous version installed. Could you please post log output (preferably with debug enabled)?

This is what the log show on DEBUG mode, not too much ...
2024-11-28 09:33:14.050 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-11-28 09:33:14.050 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-11-28 09:33:14.480 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed,

I suspect there may be some leftovers if you have had the previous version installed. Could you please post log output (preferably with debug enabled)?

I had the old version but removed it and the new version was a fresh download and install via hacs.

Can you enable debugging also of the library, something like this is configuration.yaml:
logger:
  default: info
  logs:
    homeassistant.components.cloud: debug
    custom_components.porscheconnect: debug
    pyporscheconnectapi: debug

2024-11-28 10:42:55.236 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-11-28 10:42:55.237 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-11-28 10:42:55.718 DEBUG (MainThread) [pyporscheconnectapi.oauth2]

  <meta name="ulp-version" content="1.23.4">

<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="https://assets.identity.porsche.com/img/favicon.png">

<link rel="stylesheet" href="https://cdn.auth0.com/ulp/react-components/1.100.4/css/main.cdn.min.css">
<style id="custom-styles-container">

      :root, .af-custom-form-container .af-form {
--primary-color: #010205;

}
      :root, .af-custom-form-container .af-form {
--button-font-color: #f7f7f7;

}
      :root {
--secondary-button-border-color: #010205;
--social-button-border-color: #010205;
--radio-button-border-color: #010205;

}
      :root {
--secondary-button-text-color: #010205;

}
      :root {
--link-color: #000000;

}
      :root {
--title-font-color: #000000;

}
      :root {
--font-default-color: #000000;

}
      :root {
--widget-background-color: #ffffff;

}
      :root {
--box-border-color: #FFFFFF;

}
      :root {
--font-light-color: #000000;

}
      :root {
--input-text-color: #000000;

}
      :root {
--input-border-color: #6B6D70;
--border-default-color: #6B6D70;

}
      :root {
--input-background-color: #ffffff;

}
      :root {
--icon-default-color: #010205;

}
      :root {
--error-color: #CC1922;
--error-text-color: #ffffff;

}
      :root {
--success-color: #197E10;

}
      :root {
--base-focus-color: #010205;
--transparency-focus-color: rgba(1,2,5, 0.15);

}
      :root {
--base-hover-color: #535457;
--transparency-hover-color: rgba(83,84,87, var(--hover-transparency-value));

}
      html, :root, .af-custom-form-container .af-form {
font-size: 16px;
--default-font-size: 16px;

}
      body {
--title-font-size: 1.5rem;
--title-font-weight: var(--font-bold-weight);

}
      .c25bda683 {
font-size: 0.875rem;
font-weight: var(--font-default-weight);

}
      .ce564c2b0 {
font-size: 0.875rem;
font-weight: var(--font-default-weight);

}
.ulp-passkey-benefit-heading {
font-size: 1.025rem;
}
      .c0a486a03, .c1f22a554 {
font-size: 1rem;
font-weight: var(--font-default-weight);

}
      body {
--ulp-label-font-size: 1rem;
--ulp-label-font-weight: var(--font-default-weight);

}
      .cf2834942, .c3a1f08a1, [id^='ulp-container-'] a {
font-size: 0.875rem;
font-weight: var(--font-default-weight) !important;

}
      .c3a1f08a1, .cf2834942 {
  text-decoration: underline;
}

      :root {
--button-border-width: 2px;
--social-button-border-width: 2px;
--radio-border-width: 2px;

}
      body {
--button-border-radius: 4px;
--radio-border-radius: 4px;

}
      :root {
--input-border-width: 2px;

}
      body {
--input-border-radius: 4px;

}
.af-custom-form-container .af-form {
--border-radius: 4px;
}
      :root {
--border-radius-outer: 8px;

}
      :root {
--box-border-width: 0px;

}
      body {
--shadow-component-outer: none;

}
body {
  --logo-alignment: 0 auto;
}

.c78470c63 {
  content: url('https://assets.identity.porsche.com/img/logo.png');
}

      body {
--logo-height: 12px;

}
.c78470c63 {
height: var(--logo-height);
}
body {
  --header-alignment: left;
}

      .c0b448354 {
--page-background-alignment: center;

}
      body {
--page-background-color: #ffffff;

}
</style>
<style>
/* By default, hide features for javascript-disabled browsing */
/* We use !important to override any css with higher specificity */
/* It is also overriden by the styles in <noscript> in the header file */
.no-js {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

Log in

2024-11-28 10:42:55.718 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed,

You have hit the captcha for some reason. Personally I have not seen it for months, so I wonder what could have triggered it. Could you disable the integration and wait for a few hours, and see if it gets released?
Another option may be to log on to the web portal (https://my.porsche.com) using the same ip adress as hass, and if you hit the captcha solve it.
I'll try to add some better error handling for this, so it is detected why authentication fails.

I went to the portal, login and logout  2-3 times and did not see any captcha. Mi Hass and portal access comes from my home Ip.
Will wait a few hours and let's see what happen, it looks like may people is getting this error though.
Porsche endpoint does not look very friendly ....

Same issue and no captcha on the website https://my.porsche.com/ when logging in.

My comment on the endpoint was generic :)
Nothing should be hammering the auth service as I remove the integration and it is now when i cannot set-up it again. I made the same as @vvhillo and still does not work for me. I will allow sometime and see what happen
What i have just seen in the app is that if I close the session and try to login again, it always ask now for a captcha.
I looked to the  .storage/core.config_entries but no idea what i should removec in there, i did not see anything referring to porsche :(

Like @vvhillo, my integration works now! I uninstalled the integration via HACS then went to terminal to remove any traces of the integration in ~/homeassistant/custom_components, restarted, reinstalled the integration, restarted, logged out then back in on the Porsche website (though it did not require CAPTCHA this time, it had previously), then logged in to the integration with username/password.

No way :(
I have done everything i can imagine and it does not work for me. I have even created a secondary user but still getting the same error. Will re-try tomorrow.

@barto64 I'd recommend to leave everything logged out overnight, and try again tomorrow. I have occasionally hit the captcha, and just backing off for a short while has made it go away.

@barto64 I'd recommend to leave everything logged out overnight, and try again tomorrow. I have occasionally hit the captcha, and just backing off for a short while has made it go away.

ok, I will try. But I removed the old version of this integration about 2-3 weeks ago and today installed the fresh new version, so there was no data from the previous build.

Eureka !!!!!!
It has worked this morning. Not sure if it has also helped but I reboot my router to change my external Ip address just in case.

Same here I think. Is the captcha a standard image or something more advanced?

Hey,
Even though I managed to make it work in my DEV instance, when I moved to PRD it stop working and continued with the "invalid login" error.
Since then I have removed, installed, reboot, change ip, login and logout in the web and in the app and no way. I have been trying during a couple of days but the issue continues.
I do not know honestly what else I could try. I ensured also the app was logout in my iPhone and IPad.
Maybe a naive question, but, would it be possible to pop up the captcha and allow to enter the value whenever it is required?

Guys, I finally figured out the "Invalid authentication" issue. What worked for me:

delete the Porsche Integration from HA
wait few hours, install again (maybe this is not necessary and you can try to install again without waiting)
use VPN and anonymous mode and go to my.porsche.com (if you don't have any VPN app, just try the anonymous mode)
you can see captcha on my.porsche.cm page, so log in
on the same device (with same IP - this is necessary) open HA and log in with your Porsche ID into the Porsche integration
it works!

Thanks for all who are working and developing this amazing integration 😉

Guys, I finally figured out the "Invalid authentication" issue. What worked for me:

delete the Porsche Integration from HA
wait few hours, install again (maybe this is not necessary and you can try to install again without waiting)
use VPN and anonymous mode and go to my.porsche.com (if you don't have any VPN app, just try the anonymous mode)
you can see captcha on my.porsche.cm page, so log in
on the same device (with same IP - this is necessary) open HA and log in with your Porsche ID into the Porsche integration
it works!

Thanks for all who are working and developing this amazing integration 😉

Finally this works for me. Although I did not encounter any captcha.
Good to see it back again!

so how do you do this on a device like HAOS that I'm not sure has a browser that is accessable?

Maybe a naive question, but, would it be possible to pop up the captcha and allow to enter the value whenever it is required?

We're looking into doing exactly this. One challenge is that it is hard to test, since I (for some reason) seem to escape the captcha.
It is a simple SVG image, so it should not be hard to accomplish.

@fredriklj cont on me for testing, I maybe consistently getting the captcha as I have not been able to connect for quite a few days already.
I am out of home this week again but should be able to remotely connect and make some testing.

Maybe a naive question, but, would it be possible to pop up the captcha and allow to enter the value whenever it is required?

We're looking into doing exactly this. One challenge is that it is hard to test, since I (for some reason) seem to escape the captcha.
It is a simple SVG image, so it should not be hard to accomplish.

Happy to provide some sample HTML pages
It's a simple base64 inline SVG, I decoded one manually (from the HA debug logs) and it's just a regular captcha (slightly squiggly alphanumerical text)

I have seen the same issue (captcha) and still do at home - here are my observations
I have tried all of the suggestions on here at home (using a browser etc).

At Work on the same Rogers (mobile hotspot) it works - same lib versions and python code;
At home (on a different PI) on the same rogers mobile hotspot and same lib/script - it does NOT work (get the captcha issue).

At home I tried to not issue any API requests for 24 hours and it is still blocked. I have tried multiple compute devices and networks (at home).
I really want it to work at home. I have the exact IP address at work and will compare it at home (to see how it differs) on the Rogers hot spot.
Things I will try later this week:
I will try a specific  PI from my home and see if it works at work (on the same hotspot) - if it does then it is something very specific to Rogers (depending on cell towers). ChatGPT actually has some points on this (which is why I suggest it here).
I will try 48 hours at home to see if that resets things (due to my planned tests I likely won't have this till this upcoming weekend).
I wanted to share this info as Porsche changed something in the past week (it seems more aggressive). I think it is coincidental to the release of these libs (unfortunately).
I hope the fix is as easy as just waiting long enough, but I don't know what this time period is.
thanks

FWIW, there is a branch here were I have started with an attempt to parse out the svg image:
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow
If you could try it out to see if the svg image is printed in your debug log, that would be helpful. As a first step.

FWIW, there is a branch here were I have started with an attempt to parse out the svg image:
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow
If you could try it out to see if the svg image is printed in your debug log, that would be helpful. As a first step.

I will try to do this when I am home later today as it always happens on my PIs (at home).

I made the install of the API from here "better_error_handling_in_auth_flow", I enabled the DEBUG from the 3 components. It did not work and only could see this in the log
2024-12-02 22:34:17.118 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-02 22:34:17.119 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-02 22:34:17.762 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed,
As opposed as the "main" API version where i could see lot of lines in the log file.

pycache_ contained only 3 files

Not sure if there should be more than those

Here is output when using the branch and porschecli -d list
Note I am on 3.7 python and had to modify vehicles.py to import Tuple and use Tuple in the location function to get it to run.
I tired to convert the SVG to PNG but it didn't quite work - happy to help debug further.
Also I did confirm my rogers mobile Hotspot does give a different IP address at home vs work - so I suspect I need to look at VPN worse case.
I will take this failing PI to my work tomorrow and I expect it to work with the exact same mobile hotspot.
Will update also.
DEBUG:pyporscheconnectapi.account:Retrieving vehicle list
DEBUG:pyporscheconnectapi.account:Building vehicle list
DEBUG:httpcore.connection:connect_tcp.started host='identity.porsche.com' port=443 local_address=None timeout=90 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7349b350>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7359e870> server_hostname='identity.porsche.com' timeout=90
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7352f610>
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 302, b'Moved Temporarily', [(b'Content-Type', b'text/plain; charset=utf-8'), (b'Content-Length', b'223'), (b'Connection', b'keep-alive'), (b'Date', b'Mon, 02 Dec 2024 23:02:36 GMT'), (b'Location', b'/u/login/identifier?state=hKFo2SBuMTlpeWdNc21LYTQyTXlGMTRPUlBwaG9nWDJ6SnBRQ6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIHBpUFRRcmxJOFZVbVo1Nm5GSHJrSmxBNUVuYUJfcDg3o2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'), (b'Cf-Ray', b'8ebef20f4c0336d6-YYZ'), (b'Cf-Cache-Status', b'DYNAMIC'), (b'Cache-Control', b'no-store, max-age=0, no-transform'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'Pragma', b'no-cache'), (b'X-Auth0-L', b'0.050'), (b'X-Auth0-Requestid', b'e2d06360022379177aef'), (b'X-Content-Type-Options', b'nosniff'), (b'X-Ratelimit-Limit', b'1500'), (b'X-Ratelimit-Remaining', b'1459'), (b'X-Ratelimit-Reset', b'1733180558'), (b'Server', b'cloudflare'), (b'Vary', b'Accept,Accept-Encoding'), (b'Via', b'1.1 aaba6cbb29b8ee11a630e2a990704d30.cloudfront.net (CloudFront)'), (b'Content-Security-Policy', b"default-src https: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; style-src 'self' 'unsafe-inline' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; object-src 'self' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com;"), (b'Set-Cookie', b'did=s%3Av0%3A08051a05-eb59-4741-9b21-454c9441008a.0PwZimBVIRAnHVxs%2Bu6l8B%2Bxpb1EXHQ%2BY3cNY0oy1o8; Max-Age=31557600; Path=/; Expires=Wed, 03 Dec 2025 05:02:36 GMT; HttpOnly; Secure; SameSite=None'), (b'Set-Cookie', b'auth0=s%3Av1.gadzZXNzaW9ugqZoYW5kbGXEQLJdMMAlzqy4YG-wStynQEBiQnC-LkgIclfPttfXMRXQ5JliuxPueR8XMJvgazFDo7LK5mOghoTHvCqAeW5QyIamY29va2llg6dleHBpcmVz1__IRYgAZ1IxDK5vcmlnaW5hbE1heEFnZc4PcxQAqHNhbWVTaXRlpG5vbmU.va3x%2BMS2FTH42BnZvIvfTKJdpRMMMBTrYIi5q%2FhNaVw; Path=/; Expires=Thu, 05 Dec 2024 23:02:36 GMT; HttpOnly; Secure; SameSite=None'), (b'Set-Cookie', b'did_compat=s%3Av0%3A08051a05-eb59-4741-9b21-454c9441008a.0PwZimBVIRAnHVxs%2Bu6l8B%2Bxpb1EXHQ%2BY3cNY0oy1o8; Max-Age=31557600; Path=/; Expires=Wed, 03 Dec 2025 05:02:36 GMT; HttpOnly; Secure'), (b'Set-Cookie', b'auth0_compat=s%3Av1.gadzZXNzaW9ugqZoYW5kbGXEQLJdMMAlzqy4YG-wStynQEBiQnC-LkgIclfPttfXMRXQ5JliuxPueR8XMJvgazFDo7LK5mOghoTHvCqAeW5QyIamY29va2llg6dleHBpcmVz1__IRYgAZ1IxDK5vcmlnaW5hbE1heEFnZc4PcxQAqHNhbWVTaXRlpG5vbmU.va3x%2BMS2FTH42BnZvIvfTKJdpRMMMBTrYIi5q%2FhNaVw; Path=/; Expires=Thu, 05 Dec 2024 23:02:36 GMT; HttpOnly; Secure'), (b'Set-Cookie', b'auth_params=response_type=code&client_id=XhygisuebbrqQ80byOuU5VncxLIm8E6H&redirect_uri=my-porsche-app%3A//auth0/callback&audience=https%3A//api.porsche.com&scope=openid%20profile%20email%20offline_access%20mbb%20ssodb%20badge%20vin%20dealers%20cars%20charging%20manageCharging%20plugAndCharge%20climatisation%20manageClimatisation%20pid%3Auser_profile.porscheid%3Aread%20pid%3Auser_profile.name%3Aread%20pid%3Auser_profile.vehicles%3Aread%20pid%3Auser_profile.dealers%3Aread%20pid%3Auser_profile.emails%3Aread%20pid%3Auser_profile.phones%3Aread%20pid%3Auser_profile.addresses%3Aread%20pid%3Auser_profile.birthdate%3Aread%20pid%3Auser_profile.locale%3Aread%20pid%3Auser_profile.legal%3Aread&state=pyporscheconnectapi; Secure; Path=/u; Max-Age=259200; SameSite=Strict'), (b'X-Cache', b'Miss from cloudfront'), (b'X-Amz-Cf-Pop', b'YTO53-P1'), (b'X-Amz-Cf-Id', b'ahFZilT9gP5t4R7msWkT069bI04n2qAzI-AXzmDvL-AW7TkUoA6M5Q==')])
INFO:httpx:HTTP Request: GET https://identity.porsche.com/authorize?response_type=code&client_id=XhygisuebbrqQ80byOuU5VncxLIm8E6H&redirect_uri=my-porsche-app%3A//auth0/callback&audience=https%3A//api.porsche.com&scope=openid profile email offline_access mbb ssodb badge vin dealers cars charging manageCharging plugAndCharge climatisation manageClimatisation pid%3Auser_profile.porscheid%3Aread pid%3Auser_profile.name%3Aread pid%3Auser_profile.vehicles%3Aread pid%3Auser_profile.dealers%3Aread pid%3Auser_profile.emails%3Aread pid%3Auser_profile.phones%3Aread pid%3Auser_profile.addresses%3Aread pid%3Auser_profile.birthdate%3Aread pid%3Auser_profile.locale%3Aread pid%3Auser_profile.legal%3Aread&state=pyporscheconnectapi "HTTP/1.1 302 Moved Temporarily"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 400, b'Bad Request', [(b'Content-Type', b'text/html; charset=utf-8'), (b'Content-Length', b'93965'), (b'Connection', b'keep-alive'), (b'Date', b'Mon, 02 Dec 2024 23:02:37 GMT'), (b'CF-Ray', b'8ebef211d94939fc-YYZ'), (b'CF-Cache-Status', b'DYNAMIC'), (b'Cache-Control', b'no-store, max-age=0, no-transform'), (b'Content-Language', b'en'), (b'ETag', b'W/"16f0d-tn2c0f6z5gQAO+1egOvlW7Xy6T0"'), (b'Expires', b'Mon, 02 Dec 2024 23:02:37 GMT'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'Pragma', b'no-cache'), (b'Content-Security-Policy', b"default-src https: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; style-src 'self' 'unsafe-inline' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; object-src 'self' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com;"), (b'Referrer-Policy', b'same-origin'), (b'X-Auth0-DL', b'24'), (b'X-Auth0-L', b'0.064'), (b'X-Auth0-RequestId', b'296c6849d5bb63b9e17b'), (b'X-Content-Type-Options', b'nosniff'), (b'X-Frame-Options', b'deny'), (b'X-RateLimit-Limit', b'10'), (b'X-RateLimit-Remaining', b'9'), (b'X-RateLimit-Reset', b'1733180570'), (b'X-Robots-Tag', b'noindex, nofollow'), (b'X-XSS-Protection', b'1; mode=block'), (b'Vary', b'Accept-Encoding'), (b'Server', b'cloudflare'), (b'X-Cache', b'Error from cloudfront'), (b'Via', b'1.1 aaba6cbb29b8ee11a630e2a990704d30.cloudfront.net (CloudFront)'), (b'X-Amz-Cf-Pop', b'YTO53-P1'), (b'X-Amz-Cf-Id', b'a3bHZJ4kyKuYBgE_P6ovxTOMwkjioqzuwvSLXkNM0MvEQ_uEumXv0A==')])
INFO:httpx:HTTP Request: POST https://identity.porsche.com/u/login/identifier?state=hKFo2SBuMTlpeWdNc21LYTQyTXlGMTRPUlBwaG9nWDJ6SnBRQ6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIHBpUFRRcmxJOFZVbVo1Nm5GSHJrSmxBNUVuYUJfcDg3o2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg "HTTP/1.1 400 Bad Request"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
--- Logging error ---
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/init.py", line 1034, in emit
msg = self.format(record)
File "/usr/lib/python3.7/logging/init.py", line 880, in format
return fmt.format(record)
File "/usr/lib/python3.7/logging/init.py", line 619, in format
record.message = record.getMessage()
File "/usr/lib/python3.7/logging/init.py", line 380, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/home/pi/.local/bin/porschecli", line 10, in
sys.exit(cli())
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 248, in cli
loop.run_until_complete(main(args))
File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
self.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
handle._run()
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 71, in main
vehicles = await controller.get_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 52, in get_vehicles
await self._init_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 32, in _init_vehicles
vehicle_list = await self.connection.get("/connect/v1/vehicles")
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 64, in get
return await self.request("GET", url, params=params)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 78, in request
await self.oauth2_client.ensure_valid_token(self.token)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 107, in ensure_valid_token
auth_code = await self.fetch_authorization_code()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 148, in fetch_authorization_code
resume_path = await self.login_with_identifier(params["state"][0])
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 230, in login_with_identifier
_LOGGER.debug(f"Got SVG captcha", svg)
Message: 'Got SVG captcha'
Arguments: (b'',)
Traceback (most recent call last):
File "/home/pi/.local/bin/porschecli", line 10, in
sys.exit(cli())
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 248, in cli
loop.run_until_complete(main(args))
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 71, in main
vehicles = await controller.get_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 52, in get_vehicles
await self._init_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 32, in _init_vehicles
vehicle_list = await self.connection.get("/connect/v1/vehicles")
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 64, in get
return await self.request("GET", url, params=params)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 78, in request
await self.oauth2_client.ensure_valid_token(self.token)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 107, in ensure_valid_token
auth_code = await self.fetch_authorization_code()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 148, in fetch_authorization_code
resume_path = await self.login_with_identifier(params["state"][0])
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 231, in login_with_identifier
raise PorscheCaptchaRequired("Captcha required")
pyporscheconnectapi.exceptions.PorscheCaptchaRequired

The integration works for me except for the device tracker. Logs:
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/porscheconnect/device_tracker.py:71
integration: Porsche Connect (documentation, issues)
First occurred: 3:38:39 PM (1 occurrences)
Last logged: 3:38:39 PM
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 266, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 481, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 176, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 561, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1073, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/device_tracker.py", line 71, in extra_state_attributes
data = {"updated_at": self.vehicle.location_updated_at}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/vehicle.py", line 202, in location_updated_at
datetime_object = datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%SZ')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: strptime() argument 1 must be str, not None

Thanks @augmentedtraffic, I made a typo in the log output line. Could you update and give it another try, so I can see it if parses out the captcha from the html?

Thanks @augmentedtraffic, I made a typo in the log output line. Could you update and give it another try, so I can see it if parses out the captcha from the html?

I took the PI not working at my home and it still does NOT work at my WORK! - not what I expected. So i have one PI that does work, but at my work with my Rogers mobile hotspot  (I am hesitant to use it at my home). There must be something about the config that is different.
I just checked the one that WORKS is running Version 3.9.2 (Python3), the ones at home I think are all at 3.7 (I need to triple check this) - I wonder if there is something specific about this. I will try to update my other PI that is failing to the latest and check.
Regardless here is the updated output for Captcha
DEBUG:pyporscheconnectapi.account:Retrieving vehicle list
DEBUG:pyporscheconnectapi.account:Building vehicle list
DEBUG:httpcore.connection:connect_tcp.started host='identity.porsche.com' port=443 local_address=None timeout=90 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore.backends.anyio.AnyIOStream object at 0x734f2270>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x735b2870> server_hostname='identity.porsche.com' timeout=90
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore.backends.anyio.AnyIOStream object at 0x734e7f90>
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 302, b'Moved Temporarily', [(b'Content-Type', b'text/plain; charset=utf-8'), (b'Content-Length', b'223'), (b'Connection', b'keep-alive'), (b'Date', b'Tue, 03 Dec 2024 12:04:01 GMT'), (b'Location', b'/u/login/identifier?state=hKFo2SAyU0p1Nmd6bHVKR0hlWWhmNG9TcG00djJpMDFwSzdaN6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEd1LVNIRXdHcUxjQWEtYWEzc29MUHpHZVpaUnduVmtmo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'), (b'Cf-Ray', b'8ec36ab62e19ef83-PDX'), (b'Cf-Cache-Status', b'DYNAMIC'), (b'Cache-Control', b'no-store, max-age=0, no-transform'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'Pragma', b'no-cache'), (b'X-Auth0-L', b'0.056'), (b'X-Auth0-Requestid', b'8d1221d2d42b3d9c6c20'), (b'X-Content-Type-Options', b'nosniff'), (b'X-Ratelimit-Limit', b'1500'), (b'X-Ratelimit-Remaining', b'1460'), (b'X-Ratelimit-Reset', b'1733227443'), (b'Server', b'cloudflare'), (b'Vary', b'Accept,Accept-Encoding'), (b'Via', b'1.1 f0fd475ee39ced21db4c99c5a3fdb1b2.cloudfront.net (CloudFront)'), (b'Content-Security-Policy', b"default-src https: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; style-src 'self' 'unsafe-inline' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; object-src 'self' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com;"), (b'Set-Cookie', b'did=s%3Av0%3A3b696581-f803-43bf-ae39-05288305120e.ONzj6REJcRt3Q2fyKRGB5KZRR%2BKBFAqCyqV7mwrXk1E; Max-Age=31557600; Path=/; Expires=Wed, 03 Dec 2025 18:04:01 GMT; HttpOnly; Secure; SameSite=None'), (b'Set-Cookie', b'auth0=s%3Av1.gadzZXNzaW9ugqZoYW5kbGXEQP3_Ew_2_H-QR34IpRRgDZ7b1Y9MjPa0FYiZgWiB5O9yHHec9uz3Id_ovgGuNvACH6sRgEniCNLgu-4DRtrJvlWmY29va2llg6dleHBpcmVz1-9ivMAZ1LoMa5vcmlnaW5hbE1heEFnZc4PcxQAqHNhbWVTaXRlpG5vbmU.oQYv6WTtUZsTOxcfJB9rsze5om8hBp2%2F3vzgIFjSWAY; Path=/; Expires=Fri, 06 Dec 2024 12:04:01 GMT; HttpOnly; Secure; SameSite=None'), (b'Set-Cookie', b'did_compat=s%3Av0%3A3b696581-f803-43bf-ae39-05288305120e.ONzj6REJcRt3Q2fyKRGB5KZRR%2BKBFAqCyqV7mwrXk1E; Max-Age=31557600; Path=/; Expires=Wed, 03 Dec 2025 18:04:01 GMT; HttpOnly; Secure'), (b'Set-Cookie', b'auth0_compat=s%3Av1.gadzZXNzaW9ugqZoYW5kbGXEQP3_Ew_2_H-QR34IpRRgDZ7b1Y9MjPa0FYiZgWiB5O9yHHec9uz3Id_ovgGuNvACH6sRgEniCNLgu-4DRtrJvlWmY29va2llg6dleHBpcmVz1-9ivMAZ1LoMa5vcmlnaW5hbE1heEFnZc4PcxQAqHNhbWVTaXRlpG5vbmU.oQYv6WTtUZsTOxcfJB9rsze5om8hBp2%2F3vzgIFjSWAY; Path=/; Expires=Fri, 06 Dec 2024 12:04:01 GMT; HttpOnly; Secure'), (b'Set-Cookie', b'auth_params=response_type=code&client_id=XhygisuebbrqQ80byOuU5VncxLIm8E6H&redirect_uri=my-porsche-app%3A//auth0/callback&audience=https%3A//api.porsche.com&scope=openid%20profile%20email%20offline_access%20mbb%20ssodb%20badge%20vin%20dealers%20cars%20charging%20manageCharging%20plugAndCharge%20climatisation%20manageClimatisation%20pid%3Auser_profile.porscheid%3Aread%20pid%3Auser_profile.name%3Aread%20pid%3Auser_profile.vehicles%3Aread%20pid%3Auser_profile.dealers%3Aread%20pid%3Auser_profile.emails%3Aread%20pid%3Auser_profile.phones%3Aread%20pid%3Auser_profile.addresses%3Aread%20pid%3Auser_profile.birthdate%3Aread%20pid%3Auser_profile.locale%3Aread%20pid%3Auser_profile.legal%3Aread&state=pyporscheconnectapi; Secure; Path=/u; Max-Age=259200; SameSite=Strict'), (b'X-Cache', b'Miss from cloudfront'), (b'X-Amz-Cf-Pop', b'DEN52-P1'), (b'X-Amz-Cf-Id', b'plYdczBAW2SANIuJBYknSydVt1ieZNFhl9mjGWELJYKahOeS1Fn3cQ==')])
INFO:httpx:HTTP Request: GET https://identity.porsche.com/authorize?response_type=code&client_id=XhygisuebbrqQ80byOuU5VncxLIm8E6H&redirect_uri=my-porsche-app%3A//auth0/callback&audience=https%3A//api.porsche.com&scope=openid profile email offline_access mbb ssodb badge vin dealers cars charging manageCharging plugAndCharge climatisation manageClimatisation pid%3Auser_profile.porscheid%3Aread pid%3Auser_profile.name%3Aread pid%3Auser_profile.vehicles%3Aread pid%3Auser_profile.dealers%3Aread pid%3Auser_profile.emails%3Aread pid%3Auser_profile.phones%3Aread pid%3Auser_profile.addresses%3Aread pid%3Auser_profile.birthdate%3Aread pid%3Auser_profile.locale%3Aread pid%3Auser_profile.legal%3Aread&state=pyporscheconnectapi "HTTP/1.1 302 Moved Temporarily"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 400, b'Bad Request', [(b'Content-Type', b'text/html; charset=utf-8'), (b'Content-Length', b'100365'), (b'Connection', b'keep-alive'), (b'Date', b'Tue, 03 Dec 2024 12:04:02 GMT'), (b'CF-Ray', b'8ec36ab98aac5ee6-PDX'), (b'CF-Cache-Status', b'DYNAMIC'), (b'Cache-Control', b'no-store, max-age=0, no-transform'), (b'Content-Language', b'en'), (b'ETag', b'W/"1880d-o/G/CN/e3CVA0wvQx8VwIdeUaac"'), (b'Expires', b'Tue, 03 Dec 2024 12:04:02 GMT'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'Pragma', b'no-cache'), (b'Content-Security-Policy', b"default-src https: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; style-src 'self' 'unsafe-inline' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; object-src 'self' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com;"), (b'Referrer-Policy', b'same-origin'), (b'X-Auth0-DL', b'20'), (b'X-Auth0-L', b'0.060'), (b'X-Auth0-RequestId', b'3a3ab5906acee3d476b1'), (b'X-Content-Type-Options', b'nosniff'), (b'X-Frame-Options', b'deny'), (b'X-RateLimit-Limit', b'10'), (b'X-RateLimit-Remaining', b'9'), (b'X-RateLimit-Reset', b'1733227455'), (b'X-Robots-Tag', b'noindex, nofollow'), (b'X-XSS-Protection', b'1; mode=block'), (b'Vary', b'Accept-Encoding'), (b'Server', b'cloudflare'), (b'X-Cache', b'Error from cloudfront'), (b'Via', b'1.1 f0fd475ee39ced21db4c99c5a3fdb1b2.cloudfront.net (CloudFront)'), (b'X-Amz-Cf-Pop', b'DEN52-P1'), (b'X-Amz-Cf-Id', b'b3OPOLPxtsotSOc9RJAtGawc21NSQNZkUSikRF259R49NcQ8Qyda8w==')])
INFO:httpx:HTTP Request: POST https://identity.porsche.com/u/login/identifier?state=hKFo2SAyU0p1Nmd6bHVKR0hlWWhmNG9TcG00djJpMDFwSzdaN6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEd1LVNIRXdHcUxjQWEtYWEzc29MUHpHZVpaUnduVmtmo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg "HTTP/1.1 400 Bad Request"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:pyporscheconnectapi.oauth2:Got SVG captcha: b''
Traceback (most recent call last):
File "/home/pi/.local/bin/porschecli", line 10, in
sys.exit(cli())
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 248, in cli
loop.run_until_complete(main(args))
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/cli.py", line 71, in main
vehicles = await controller.get_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 52, in get_vehicles
await self._init_vehicles()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/account.py", line 32, in _init_vehicles
vehicle_list = await self.connection.get("/connect/v1/vehicles")
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 64, in get
return await self.request("GET", url, params=params)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/connection.py", line 78, in request
await self.oauth2_client.ensure_valid_token(self.token)
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 107, in ensure_valid_token
auth_code = await self.fetch_authorization_code()
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 148, in fetch_authorization_code
resume_path = await self.login_with_identifier(params["state"][0])
File "/home/pi/.local/lib/python3.7/site-packages/pyporscheconnectapi/oauth2.py", line 231, in login_with_identifier
raise PorscheCaptchaRequired("Captcha required")
pyporscheconnectapi.exceptions.PorscheCaptchaRequired
thanks

@augmentedtraffic Thanks. Still didn't got the output I wanted, and made another update to the branch. Can you check out and run that as well. You only  need to output the line that begins with "DEBUG:pyporscheconnectapi.oauth2:Got SVG captcha:". I want to see if the svg image is in that variable.
I have only tried the library with python 3.12. Python 3.7 is about 6 years old by now, could be worth a try upgrade it. Also make sure you do not have any old stale .session files lying around.

I got just one more line on DEBUG after the latest change
2024-12-03 17:25:35.734 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-03 17:25:35.734 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-03 17:25:36.262 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Got SVG captcha:
2024-12-03 17:25:36.262 INFO (MainThread) [custom_components.porscheconnect.config_flow] Authentication flow error:

img alt="captcha" src="data:image/svg+xml;base64,[encoded data, 18072 characters]"/

I removed the "<" and ">" for @fredriklj to see the DEBUG content

@barto64 Nice, thanks. The svg image is in there.
It shouldn't be too hard to display it in the config flow dialogue of hass, take the captcha code as interpreted by the user and post it to the authentication endpoint. The tricky part for me will be to do that without having the ability to test it reliably. I'll try to think of something.

@augmentedtraffic Thanks. Still didn't got the output I wanted, and made another update to the branch. Can you check out and run that as well. You only need to output the line that begins with "DEBUG:pyporscheconnectapi.oauth2:Got SVG captcha:". I want to see if the svg image is in that variable.
I have only tried the library with python 3.12. Python 3.7 is about 6 years old by now, could be worth a try upgrade it. Also make sure you do not have any old stale .session files lying around.

Looks like you got it from others. thanks to your hint I took the .session file from the working one to the non-working one and with python 3.9 (on the non-working one) it works!
SO anything < 3.9 is likely having some issues and the .session info must be somehow messed up on my other PIs
will try at home to confirm - but this is great progress - thanks

For those of you who are still having problems with the captcha, it would be interesting to know if deleting all session information (.session file in the case of using the cli, or the corresponding data stored by hass in .storage/core.config_entries) would solve the issues. Possibly waiting a few hours after the last attempt.
It could be that using an old refresh token gets you in trouble.

For those of you who are still having problems with the captcha, it would be interesting to know if deleting all session information (.session file in the case of using the cli, or the corresponding data stored by hass in .storage/core.config_entries) would solve the issues. Possibly waiting a few hours after the last attempt.
It could be that using an old refresh token gets you in trouble.

I look to the core.config_entries and could not related any line in there with our integration, so I do not know what I should remove. I may be missing something though. I am in Haas, obviously 😃

I look to the core.config_entries and could not related any line in there with our integration, so I do not know what I should remove. I may be missing something though. I am in Haas, obviously 😃

You should have an entry in there with your access token (among other things). Search for the string "porscheconnect" and you should be able to locate it (if it exists).

Dear @fredriklj 😄
That was the obvious first thing I looked for and did not see any . Could that be a root cause for the problem?
Additionally I did not see that under my user in HA especifícalos on the security tab where you can see short and long term tokens. In there there is an option to update some of those.

You will not find these tokens under the security tab, they are only in the core.config_entities file. But if it is not there, it can't be the source of the problem. You would get that entry after a successful authentication.

Noted. I do not get a successful login since 5d ago.

For those of you who are still having problems with the captcha, it would be interesting to know if deleting all session information (.session file in the case of using the cli, or the corresponding data stored by hass in .storage/core.config_entries) would solve the issues. Possibly waiting a few hours after the last attempt.
It could be that using an old refresh token gets you in trouble.

I don't find anything in core.config_entries and I'm still having problems after almost a week of trying.

So I have pushed a first attempt to catch the captcha and add it to the verification step in the oauth2 flow. It is completely untested, so I'm fairly confident i won't work yet. But anyone keen to try it out and to report where it breaks can pull the 'throw_captcha_exception" branch of this repo:
https://github.com/CJNE/ha-porscheconnect/tree/throw_captcha_exception
AND, equally important, have the 'better_error_handling_in_auth_flow' branch of pyporscheapi installed as well:
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow

So I have pushed a first attempt to catch the captcha and add it to the verification step in the oauth2 flow. It is completely untested, so I'm fairly confident i won't work yet. But anyone keen to try it out and to report where it breaks can pull the 'throw_captcha_exception" branch of this repo:
https://github.com/CJNE/ha-porscheconnect/tree/throw_captcha_exception
AND, equally important, have the 'better_error_handling_in_auth_flow' branch of pyporscheapi installed as well:
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow

I can try either later tonight my time or tomorrow. I don't have my "faulty" PI with me at work. Will let you know.

First attempt :), see below DEBIG info:
2024-12-05 13:49:42.395 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-05 13:49:42.395 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code None
2024-12-05 13:49:42.396 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Exception Connection.init() got an unexpected keyword argument 'captcha_code'
2024-12-05 13:49:42.396 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-05 13:49:42.396 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed, cannot access local variable 'conn' where it is not associated with a value
Let's continue refining ....

Thanks! Are you absolutely sure you got the branch from pyporscheconnectapi installed (and restarted hass)?
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow

If you look here:
https://github.com/CJNE/pyporscheconnectapi/blob/75cc9e98b5960b590c6c107bcd29a68f0152ba2e/pyporscheconnectapi/connection.py#L43
..you can see that 'captcha_code' is indeed a valid keyword argument to Connection.init(). Might it be that you rebooted your PI, rather than just restarted hass? A reboot will typically pull the version from pypi.
(You could log into your PI and through the shell and verify that the connection.py installed in your system is indeed the version from the branch in question, I suspect not.)

Hey, I validated the connection.py content and it was not the right one as you said. I repeated the same steps as before but this time I removed the "requirements" line from the manifest. Not sure if this line was refreshing the version of the api.
So, another baby step on the right direction and I managed to see this pop-up

Problem though is that i was not seeing what to type in , so I entered "aaaaaaaaaaa" and got this

Here you go - not sure I did it right.
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 401, b'Unauthorized', [(b'Content-Type', b'text/html; charset=utf-8'), (b'Content-Length', b'947'), (b'Connection', b'keep-alive'), (b'Date', b'Thu, 05 Dec 2024 22:56:32 GMT'), (b'CF-Ray', b'8ed7a14a798661cc-ORD'), (b'CF-Cache-Status', b'DYNAMIC'), (b'Cache-Control', b'no-store, max-age=0, no-transform'), (b'ETag', b'W/"3b3-Po33xK7yz3gyNBT9mbwyV53Crpc"'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'Pragma', b'no-cache'), (b'X-Auth0-L', b'0.022'), (b'X-Auth0-RequestId', b'bff92af09314e95e982f'), (b'X-Content-Type-Options', b'nosniff'), (b'X-RateLimit-Limit', b'1500'), (b'X-RateLimit-Remaining', b'1465'), (b'X-RateLimit-Reset', b'1733439394'), (b'Server', b'cloudflare'), (b'Vary', b'Accept-Encoding'), (b'X-Cache', b'Error from cloudfront'), (b'Via', b'1.1 c190ce170e05da28bd90b53935036346.cloudfront.net (CloudFront)'), (b'X-Amz-Cf-Pop', b'YTO53-P1'), (b'X-Amz-Cf-Id', b'ScU1ft23mBFE5KCyIJvjqkqxaZ1n2-anOQSKSRy_zc4Sw3IguBzCGw=='), (b'Content-Security-Policy', b"default-src https: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; style-src 'self' 'unsafe-inline' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com; object-src 'self' www.porsche.com cdn.auth0.com identity.porsche.com identity.porsche.cn assets.identity.porsche.com assets.identity.porsche.cn cdn.ui.porsche.com;")])
INFO:httpx:HTTP Request: GET https://identity.porsche.com/authorize/resume "HTTP/1.1 401 Unauthorized"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
Traceback (most recent call last):
File "/home/pi/.local/bin/./porschecli", line 33, in
sys.exit(load_entry_point('pyporscheconnectapi==0.2.0', 'console_scripts', 'porschecli')())
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/cli.py", line 248, in cli
loop.run_until_complete(main(args))
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/cli.py", line 71, in main
vehicles = await controller.get_vehicles()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/account.py", line 52, in get_vehicles
await self._init_vehicles()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/account.py", line 32, in _init_vehicles
vehicle_list = await self.connection.get("/connect/v1/vehicles")
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 69, in get
return await self.request("GET", url, params=params)
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 83, in request
await self.oauth2_client.ensure_valid_token(self.token)
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/oauth2.py", line 114, in ensure_valid_token
auth_code = await self.fetch_authorization_code()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/oauth2.py", line 159, in fetch_authorization_code
params = await self.get_and_extract_location_params(
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/oauth2.py", line 195, in get_and_extract_location_params
raise PorscheException("Could not fetch authorization code")
pyporscheconnectapi.exceptions.PorscheException

Hey, I validated the connection.py content and it was not the right one as you said. I repeated the same steps as before but this time I removed the "requirements" line from the manifest. Not sure if this line was refreshing the version of the api.

Can you also post the debug output from the logs? It seems it did not get hold of the captcha image.

@augmentedtraffic Ah, should have been more clear. At this point I have only implemented the captcha verification through the HA configuration flow. The cli does not support this (yet).

Sorry, i forgot to paste the DEBUG info and just realized this morning, here you have. This the log when the prompt appears and after entering "Abcdef"
2024-12-06 07:56:05.326 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-12-06 07:57:32.383 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-06 07:57:32.383 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code None
2024-12-06 07:57:32.383 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-06 07:57:32.931 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Got SVG captcha:
2024-12-06 07:57:32.932 INFO (MainThread) [pyporscheconnectapi.exceptions] Initialising captcha exception: , hKFo2SB0d2stbEtGTjVkV0pBYzVpaXdvdFdtZVljd0lhTHNSbKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEVOWFlHUUxoXzZic3hoUXJDNGNreGNnOXBvbGM3VGZao2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg
2024-12-06 07:57:32.932 INFO (MainThread) [custom_components.porscheconnect.config_flow] Captcha required to log in;
2024-12-06 07:57:32.933 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Info, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha': , 'state': 'hKFo2SB0d2stbEtGTjVkV0pBYzVpaXdvdFdtZVljd0lhTHNSbKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEVOWFlHUUxoXzZic3hoUXJDNGNreGNnOXBvbGM3VGZao2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-06 07:58:15.131 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] User input, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha_code': 'Abcdef', 'state': 'hKFo2SB0d2stbEtGTjVkV0pBYzVpaXdvdFdtZVljd0lhTHNSbKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEVOWFlHUUxoXzZic3hoUXJDNGNreGNnOXBvbGM3VGZao2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-06 07:58:15.132 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code Abcdef
2024-12-06 07:58:15.132 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-06 07:58:15.449 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Got SVG captcha:
2024-12-06 07:58:15.450 INFO (MainThread) [pyporscheconnectapi.exceptions] Initialising captcha exception: , hKFo2SB0d2stbEtGTjVkV0pBYzVpaXdvdFdtZVljd0lhTHNSbKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEVOWFlHUUxoXzZic3hoUXJDNGNreGNnOXBvbGM3VGZao2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg
2024-12-06 07:58:15.450 INFO (MainThread) [custom_components.porscheconnect.config_flow] Captcha required to log in;
2024-12-06 07:58:15.450 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed, 'title'
2024-12-06 07:58:15.451 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/config/custom_components/porscheconnect/config_flow.py", line 148, in async_step_captcha
title=info["title"],
~~~~^^^^^^^^^
KeyError: 'title'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flow, cur_step["step_id"], user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/config_flow.py", line 154, in async_step_captcha
raise InvalidAuth
custom_components.porscheconnect.config_flow.InvalidAuth

@augmentedtraffic Ah, should have been more clear. At this point I have only implemented the captcha verification through the HA configuration flow. The cli does not support this (yet).

No worries - I have it working with the APIs on my PI at work but I still need to getting it working at my home in the long run. I also use HA but not for this, so I will try this over the weekend and let you know.

@barto64 I can't figure out why the svg doesn't render in the captcha dialogue for you. It should have looked like this:

I see you have the language set to spanish, could you try to set it to english? Can you try another web browser? Have you by any chance put custom localisation files in the translations/ folder?

@fredriklj Sorry to hear that. I have done all the above and same result, i am not able to see the captcha. I flipped to english, tried with 3 browsers (Edge, Chrome & Firefox) and do not have anything at all in the "translation" folder.
Maybe someone else can help you with the testing. So far, i cannot go beyond this point :(

Only maybe different thing, but not sure if that could have any impact is the fact that I am connected remotely to my home, where the PI is, using a VPN as I cannot access my DEV PI from the internet.

Ok, I think I got it. Could you please pull the latest commit from the branch and try again? To see if we can get one step further.

Good, i see now the captcha

but now we have the following error :), moving forward
2024-12-07 10:30:11.338 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-07 10:30:11.339 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code None
2024-12-07 10:30:11.339 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-07 10:30:11.339 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Fetching authorization code.
2024-12-07 10:30:11.758 DEBUG (MainThread) [pyporscheconnectapi.oauth2] No existing auth0 session, running through identifier first flow.
2024-12-07 10:30:11.759 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Submitting e-mail address to auth endpoint.
2024-12-07 10:30:11.961 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Captcha required.
2024-12-07 10:30:11.987 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Parsed out SVG captcha:
2024-12-07 10:30:11.987 INFO (MainThread) [pyporscheconnectapi.exceptions] Initialising captcha exception: , hKFo2SBDWnROc2VndmpNaDNIS3V5Ty1ETHo4SGtXa0hnSlQxRKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIFNXdzhaRlFsdE5fQXlTNjZ6NWVtaDFORnR5ODdidWRzo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg
2024-12-07 10:30:11.987 INFO (MainThread) [custom_components.porscheconnect.config_flow] Captcha required to log in;
2024-12-07 10:30:11.988 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Info, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha': '', 'state': 'hKFo2SBDWnROc2VndmpNaDNIS3V5Ty1ETHo4SGtXa0hnSlQxRKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIFNXdzhaRlFsdE5fQXlTNjZ6NWVtaDFORnR5ODdidWRzo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-07 10:30:23.532 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] User input, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha_code': 'gAAjFt', 'state': 'hKFo2SBDWnROc2VndmpNaDNIS3V5Ty1ETHo4SGtXa0hnSlQxRKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIFNXdzhaRlFsdE5fQXlTNjZ6NWVtaDFORnR5ODdidWRzo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-07 10:30:23.533 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code gAAjFt
2024-12-07 10:30:23.533 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-07 10:30:23.533 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed, cannot access local variable 'captcha' where it is not associated with a value
2024-12-07 10:30:23.534 INFO (MainThread) [custom_components.porscheconnect.config_flow] Login failed,
2024-12-07 10:30:23.534 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/config/custom_components/porscheconnect/config_flow.py", line 52, in validate_input
token = await conn.get_token()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyporscheconnectapi/connection.py", line 65, in get_token
await self.oauth2_client.ensure_valid_token(self.token)
File "/usr/local/lib/python3.13/site-packages/pyporscheconnectapi/oauth2.py", line 113, in ensure_valid_token
auth_code = await self.fetch_authorization_code()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyporscheconnectapi/oauth2.py", line 176, in fetch_authorization_code
resume_path = await self.login_with_identifier(self.captcha.state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyporscheconnectapi/oauth2.py", line 265, in login_with_identifier
f"Submitting e-mail address and captcha code {captcha} to auth endpoint."
^^^^^^^
UnboundLocalError: cannot access local variable 'captcha' where it is not associated with a value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/porscheconnect/config_flow.py", line 142, in async_step_captcha
info = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/config_flow.py", line 69, in validate_input
raise InvalidAuth
custom_components.porscheconnect.config_flow.InvalidAuth
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flow, cur_step["step_id"], user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/config_flow.py", line 154, in async_step_captcha
raise InvalidAuth
custom_components.porscheconnect.config_flow.InvalidAuth

🙈 .. my bad. Can you update and try again?

Mine works with the new commit, though it didn't ask me to solve a captcha, and the device tracker doesn't work.

Believe or not i was allowed to connect w/o captcha, but with a few reboot, connection, disconnections and integration entry removal and addition and I managed to get the captcha requirement again and worked like a sharm. Congratulations @fredriklj
I am pasting below the debug, just in case,  the result of the successful connection with the cpatcha requirement:
2024-12-07 15:51:42.104 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Validating input.
2024-12-07 15:51:42.104 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code None
2024-12-07 15:51:42.104 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-07 15:51:42.105 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Fetching authorization code.
2024-12-07 15:51:42.503 DEBUG (MainThread) [pyporscheconnectapi.oauth2] No existing auth0 session, running through identifier first flow.
2024-12-07 15:51:42.503 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Submitting e-mail address to auth endpoint.
2024-12-07 15:51:42.772 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Captcha required.
2024-12-07 15:51:42.800 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Parsed out SVG captcha:
2024-12-07 15:51:42.800 INFO (MainThread) [pyporscheconnectapi.exceptions] Initialising captcha exception: , hKFo2SBMNURtWXZYNHFKSkpWb3dCN3RUOHJiXzFrT0VySWc0eaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIGJIc3VmUFFNdHI2SG1XYWpvOGRmem1ZbTR1cXE0Wi1Jo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg
2024-12-07 15:51:42.800 INFO (MainThread) [custom_components.porscheconnect.config_flow] Captcha required to log in;
2024-12-07 15:51:42.801 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Info, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha': '', 'state': 'hKFo2SBMNURtWXZYNHFKSkpWb3dCN3RUOHJiXzFrT0VySWc0eaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIGJIc3VmUFFNdHI2SG1XYWpvOGRmem1ZbTR1cXE0Wi1Jo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-07 15:51:55.411 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] User input, {'email'<EMAIL_ADDRESS>'password': 'MyPassword', 'captcha_code': 'n9tnen', 'state': 'hKFo2SBMNURtWXZYNHFKSkpWb3dCN3RUOHJiXzFrT0VySWc0eaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIGJIc3VmUFFNdHI2SG1XYWpvOGRmem1ZbTR1cXE0Wi1Jo2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg'}
2024-12-07 15:51:55.411 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Opening connection with captcha_code n9tnen
2024-12-07 15:51:55.411 DEBUG (MainThread) [custom_components.porscheconnect.config_flow] Attempting login
2024-12-07 15:51:55.412 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Submitting e-mail address and captcha code n9tnen to auth endpoint.
2024-12-07 15:51:55.569 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Submitting password to auth endpoint.
2024-12-07 15:51:55.849 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Resume at /authorize/resume?state=bHsufPQMtr6HmWajo8dfzmYm4uqq4Z-I
2024-12-07 15:51:55.849 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Sleeping 2.5s...
2024-12-07 15:51:58.599 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Authorization code: 4OQ41YxgSiUTU_Vs8WIphdp4S6nnc-1hhSstM-oBsO3KO
2024-12-07 15:51:58.599 DEBUG (MainThread) [pyporscheconnectapi.oauth2] Exchanging the authorization code for an access token.
2024-12-07 15:51:58.762 DEBUG (MainThread) [pyporscheconnectapi.oauth2] New Access Token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkxiUXY4ckhMSVluMTZDSUNXbFFWTiJ9.eyJjaWFtSWQiOiJrZnVwbGFxZmlzN2o4dGVsIiwicG9yc2NoZV9qdGkiOiI5MDYyOGRmNDYzNGNkZTM2N2I2YTkwNGNhMTc2NWYwOSIsImlzcyI6Imh0dHBzOi8vaWRlbnRpdHkucG9yc2NoZS5jb20vIiwic3ViIjoiYXV0aDB8NjQxMzAzNDA1NGVhMmNjN2JkMTRlOGQ2IiwiYXVkIjpbImh0dHBzOi8vYXBpLnBvcnNjaGUuY29tIiwiaHR0cHM6Ly9wb3JzY2hlLXByb2R1Y3Rpb24ucG9yc2NoZS1wcm9kdWN0aW9uLmF1dGgwYXBwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE3MzM1ODMxMTgsImV4cCI6MTczMzU4NjcxOCwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCBiYWRnZSBjYXJzIGNoYXJnaW5nIGNsaW1hdGlzYXRpb24gZGVhbGVycyBtYW5hZ2VDaGFyZ2luZyBtYW5hZ2VDbGltYXRpc2F0aW9uIG1iYiBwaWQ6dXNlcl9wcm9maWxlLmFkZHJlc3NlczpyZWFkIHBpZDp1c2VyX3Byb2ZpbGUuYmlydGhkYXRlOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5kZWFsZXJzOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5lbWFpbHM6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLmxlZ2FsOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5sb2NhbGU6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLm5hbWU6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLnBob25lczpyZWFkIHBpZDp1c2VyX3Byb2ZpbGUucG9yc2NoZWlkOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS52ZWhpY2xlczpyZWFkIHBsdWdBbmRDaGFyZ2Ugc3NvZGIgdmluIG9mZmxpbmVfYWNjZXNzIiwiYXpwIjoiWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkgifQ.D16I9o6RrzCfoiQiMqOUPc6ROxRsKsfbJhAlLuXrZ2uwyo7UL3fkuVdVIwnqNY2VHNuJ5P4iokrXny5D-jPNXLbEvomKFOztiaIG9knBIvmVBkg13SoJG-gdlNAouCj76aVvI26XyAlI6_3Q0xQOsc-R9DLPAsvF7xmMVoQDjD88eTlCtzy0F1szxNbksQXT6OSNQ4bwQS-FQOTzcTNjrr6wiIqGqxifU__ETLR2KML1Cf6HXHE-TUfxfFt-yL-YQfu4qNu_d0MtYZK3FUXEfbsJ_7oisr_BMVpIuYX5JJJkb6bZ8MhfAboABogfrpjqKt28BGlcQQJk1l4inQ_HeQ
2024-12-07 15:51:58.771 DEBUG (MainThread) [pyporscheconnectapi.account] Retrieving vehicle list
2024-12-07 15:51:58.771 DEBUG (MainThread) [pyporscheconnectapi.account] Building vehicle list
2024-12-07 15:51:59.779 DEBUG (MainThread) [pyporscheconnectapi.account] Got vehicle {'vin': 'WP1ZZZ9YZKDA46755', 'modelName': 'Cayenne E-Hybrid', 'customName': 'Cayenne E-Hybrid Barto', 'modelType': {'code': '9YAAE1', 'year': '2019', 'steeringPosition': 'LEFT_HAND_DRIVE', 'body': 'SUV', 'generation': 'E3', 'revision': 1, 'model': 'CAYENNE', 'engine': 'PHEV'}, 'systemInfo': {'driverExperience': '0.5', 'privacyStyle': 1, 'cluster': '24'}, 'exteriorColorName': 'Azul Vizcaya Metalizado/Azul Vizcaya Metalizado', 'color': {'primaryExteriorColor': '4F758B'}, 'connect': True, 'greyConnectStoreURL': 'https://connect-store.porsche.com', 'timestamp': '2024-12-07T14:51:59Z', 'commands': [], 'measurements': []}
2024-12-07 15:51:59.780 DEBUG (MainThread) [pyporscheconnectapi.vehicle] Getting stored status for vehicle WP1ZZZ9YZKDA46755
2024-12-07 15:52:00.274 DEBUG (MainThread) [pyporscheconnectapi.vehicle] Vehicle status dict for WP1ZZZ9YZKDA46755 is now: {
"vin": "WP1ZZZ9YZKDA46755",
"modelName": "Cayenne E-Hybrid",
"customName": "Cayenne E-Hybrid Barto",
"modelType": {

Thanks for all the testing! I'll clean up the code and create a PR for this.

@jwinston100 Did you get any errors in the log?

Thanks

Thanks to you for the DEV effort 😄

Thanks for all the testing! I'll clean up the code and create a PR for this.

Great progress and thank you for everything that you do.

If/when either of you encounter the captcha again, could you please test entering the wrong captcha code, and see if you get another attempt?

Done !!!!
Component and API refreshed and all works fine. If I fail the catchap it ask again and again and when  entered correctly it set-up well the integration.
Only minor thing is that the captcha does not change after the failure, but you can cancel, try again and the captcha will change. So that is not a problem.

@fredriklj No, there are no errors at all in the log. I can see the location in the Porsche app.

@jwinston100 There has been two updates to the device tracker lately, and I'm curious if you actually have those installed. In particular this one:
https://github.com/CJNE/pyporscheconnectapi/commit/1fb372561b3c840190923f301d5c5f0a675fa4e4
Can you verify that you in fact have that installed into your system running hass?

@barto64 Excellent, thanks!

Only minor thing is that the captcha does not change after the failure, but you can cancel, try again and the captcha will change. So that is not a problem.

I believe the captcha is per state, so it is per design of the authentication api.

I've found another bug in the device tracker around the last updated timestamp parsing. Just getting to the bottom of it

Just want to confirm the pyporscheconnectAPI works independently of HA - here is some code that now works  on a PI based on the HA version of the branch, in case anyone is interested. my home PI is now working thanks! --------
async def validate_input(data):
"""Validate user input for connecting."""
token = {}
try:
conn = Connection(
email=data["email"],
password=data["password"],
captcha_code=data.get("captcha_code"),
state=data.get("state"),
token=token,
)
except Exception as e:
logger.debug(f"Exception during connection initialization: {e}")
logger.debug("Attempting login...")
try:
    token = await conn.get_token()
except PorscheCaptchaRequired as e:
    logger.info(f"CAPTCHA required to log in. CAPTCHA: {e.captcha}")
    return {
        "email": data["email"],
        "password": data["password"],
        "captcha": e.captcha,
        "state": e.state,
    }
except PorscheWrongCredentials:
    logger.error("Wrong credentials.")
    raise InvalidAuth("Invalid credentials provided.")
except PorscheException as e:
    logger.error(f"Authentication flow error: {e}")
    raise InvalidAuth("Authentication flow failed.")
except Exception as e:
    logger.error(f"Unexpected error during login: {e}")
    raise InvalidAuth("Unexpected login error.")

return {"title": data["email"], "access_token": token}

async def vehicles():
token = {}
try:
if os.path.exists(".session"):
with open(".session", "r") as json_file:
token = json.load(json_file) or {}
except json.decoder.JSONDecodeError:
logger.error("Error loading the token, starting with an empty token.")
token = {}
email_input = email
password_input = password

data = {"email": email_input, "password": password_input}

try:
    # Validate input and handle CAPTCHA if required
    validation_result = await validate_input(data)

    if "captcha" in validation_result and "state" in validation_result:
        logger.info("CAPTCHA required. Saving CAPTCHA image and asking for input.")

        captcha_img = validation_result["captcha"]
        state = validation_result["state"]

        # Save CAPTCHA image or SVG
        src_data = captcha_img.split(",")[1]
        if "data:image/svg+xml;base64" in captcha_img:
            captcha_image_path = "/tmp/captcha.svg"
            logger.info("Detected CAPTCHA format as SVG.")
        else:
            captcha_image_path = "/tmp/captcha.jpg"
            logger.info("Detected CAPTCHA format as a standard image.")

        # Fix Base64 padding
        missing_padding = len(src_data) % 4
        if missing_padding:
            src_data += "=" * (4 - missing_padding)

        try:
            with open(captcha_image_path, "wb") as file:
                file.write(base64.b64decode(src_data))
            logger.info(f"CAPTCHA saved to {captcha_image_path}")

            # Open the CAPTCHA file using the appropriate viewer
            if captcha_image_path.endswith(".svg"):
                logger.info("Please open the SVG CAPTCHA file in a browser or an SVG viewer.")
                subprocess.run(["xdg-open", captcha_image_path])  # Opens the SVG in the default browser
            else:
                subprocess.run(["feh", captcha_image_path])  # Replace 'feh' with another viewer if needed
        except Exception as decode_error:
            logger.error(f"Failed to decode and save CAPTCHA file: {decode_error}")
            return

        # Ask user for CAPTCHA input
        captcha_code = input("Please enter the CAPTCHA code displayed in the image or file: ")

        # Retry login with CAPTCHA
        data["captcha_code"] = captcha_code
        data["state"] = state
        validation_result = await validate_input(data)

    logger.info("Login successful!")
    logger.info(f"Access Token: {validation_result['access_token']}")

    # Save the session token
    with open(".session", "w", encoding="utf-8") as json_file:
        json.dump(validation_result["access_token"], json_file, ensure_ascii=False, indent=2)

    # Create connection with validated token and fetch vehicle data
    conn = Connection(email=email_input, password=password_input, token=validation_result["access_token"])
    client = conn.create_client()
    vehicles = await client.get_vehicles()
    for vehicle_obj in vehicles:
        vehicle = vehicle_obj.data
        logger.info(
            f"VIN: {vehicle['vin']}, Model: {vehicle['modelName']}, Year: {vehicle['modelType']['year']}"
        )
        print(json.dumps(vehicle, indent=2))

except InvalidAuth as e:
    logger.error(f"Authentication failed: {e}")
except Exception as e:
    logger.error(f"Unexpected error: {e}")

class InvalidAuth(Exception):
"""Error to indicate invalid authentication."""
Run the event loop
loop = asyncio.get_event_loop()
loop.run_until_complete(vehicles())

@megakid I think it may be addressed here:
https://github.com/CJNE/pyporscheconnectapi/commit/0e1dc6c5133c2e3da018903fa56911bb88bfcfdf

@fredriklj I updated manifest,json to include:
"requirements": ["git+https://github.com/CJNE/pyporscheconnectapi.git@1fb3725"]
and then restarted, but now logs show:
Logger: homeassistant.util.package
Source: util/package.py:56
First occurred: 3:07:15 PM (2 occurrences)
Last logged: 3:07:22 PM
Invalid requirement 'git+https://github.com/CJNE/pyporscheconnectapi.git@1fb3725'
Am I not doing this correctly? Thanks

@jwinston100 You may need to add project name to that string, e.g.
"requirements": ["pyporscheconnectapi @ git+https://github.com/CJNE/pyporscheconnectapi.git@1fb3725"]

https://pip.pypa.io/en/stable/topics/vcs-support/#git

I've merged the two repos within my custom_components folder to make testing easier.
If anyone is interested in this, and it might violate the original intention of the deliberate split (which is ofcourse the 'right' way of doing things but impedes quick iteration currently), then I can provide details.

 Would be good to identify some test users with different models so we can ensure we can regression test it!

@fredriklj Thanks, I updated as you said and no longer get the error, just back to "Invalid authentication" again.

@jwinston100 Yes, since the captcha flow as not been merged yet. But that fix is also in the better_error_handling_in_auth_flow branch as well, so if you make sure to check out the lastest version from that it should work?

Guys, I finally figured out the "Invalid authentication" issue. What worked for me:

delete the Porsche Integration from HA
wait few hours, install again (maybe this is not necessary and you can try to install again without waiting)
use VPN and anonymous mode and go to my.porsche.com (if you don't have any VPN app, just try the anonymous mode)
you can see captcha on my.porsche.cm page, so log in
on the same device (with same IP - this is necessary) open HA and log in with your Porsche ID into the Porsche integration
it works!

Thanks for all who are working and developing this amazing integration 😉

Finally this works for me. Although I did not encounter any captcha.
Good to see it back again!

Ac

Guys, I finally figured out the "Invalid authentication" issue. What worked for me:

delete the Porsche Integration from HA
wait few hours, install again (maybe this is not necessary and you can try to install again without waiting)
use VPN and anonymous mode and go to my.porsche.com (if you don't have any VPN app, just try the anonymous mode)
you can see captcha on my.porsche.cm page, so log in
on the same device (with same IP - this is necessary) open HA and log in with your Porsche ID into the Porsche integration
it works!

Thanks for all who are working and developing this amazing integration 😉

Finally this works for me. Although I did not encounter any captcha.
Good to see it back again!

Actually, this only worked the first time I tried it. It no longer works at all now and I also never seem to see the captcha.

@fredriklj I don't see the better_error_handling_in_auth_flow branch in https://github.com/CJNE/ha-porscheconnect/branches/all.

@jwinston100 It is in pyporscheconnectapi:
https://github.com/CJNE/pyporscheconnectapi/tree/better_error_handling_in_auth_flow

Hey,
I have moved the custom component and the API to my PRD HA and I have realised that each time I reboot it I need to remove the entry in the integration and add it again passing through the Captcha. It is unable to relogin because of the captcha I guess.
I am not an expert at all but I wonder if the token is not persisted or something like that requiring the component to re-authenticate after a HA reboot. I do many reboots to keep up to date the big bunch of integrations I run in my install.

Hey,
I have moved the custom component and the API to my PRD HA and I have realised that each time I reboot it I need to remove the entry in the integration and add it again passing through the Captcha. It is unable to relogin because of the captcha I guess.
I am not an expert at all but I wonder if the token is not persisted or something like that requiring the component to re-authenticate after a HA reboot. I do many reboots to keep up to date the big bunch of integrations I run in my install.

I don't use HA but I do use the pyporscheconnectapi lib that supports captcha, and I have rebooted my PI without any issue - i.e. I didn't have to reenter any captcha info after the very first time.

I am not an expert at all but I wonder if the token is not persisted or something like that requiring the component to re-authenticate after a HA reboot. I do many reboots to keep up to date the big bunch of integrations I run in my install.

You should have got a refresh token which will be used instead of going through the initial login procedure. After you have gone through the login procedure you should find both access token and refresh token in .storage/core.config_entries. This should be persistent across restarts.
Is there any difference between restarting hass and rebooting the platform? If it is only the latter, there is some issue with the installation.

Hmmmmm !!!!!
I can only see one line in "core.config_entries" related to Porsche, not sure if it contains 1 or 2 tokens. Curious enough, it contains this value "expires_in":3600.
Within the hour of creation either reboting HA or the Hw it remains in the "core.config_entries" and the integration works like a charm. I will need to wait for an hour and see if after a reboot of HA or the Hw the integration failed to login and need to enter the credentials and the catchap again, which is the observed behaviour today.
I have pasted "core.config_entries" entry below:
{"created_at":"2024-12-09T19:46:22.428886+00:00","data":{"access_token":{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkxiUXY4ckhMSVluMTZDSUNXbFFWTiJ9.eyJjaWFtSWQiOiJrZnVwbGFxZmlzN2o4dGVsIiwicG9yc2NoZV9qdGkiOiJlODk3ODRlOTc0ODQwYWMyYTRkMTIzNTY2Y2FlMTA1NyIsImlzcyI6Imh0dHBzOi8vaWRlbnRpdHkucG9yc2NoZS5jb20vIiwic3ViIjoiYXV0aDB8NjQxMzAzNDA1NGVhMmNjN2JkMTRlOGQ2IiwiYXVkIjpbImh0dHBzOi8vYXBpLnBvcnNjaGUuY29tIiwiaHR0cHM6Ly9wb3JzY2hlLXByb2R1Y3Rpb24ucG9yc2NoZS1wcm9kdWN0aW9uLmF1dGgwYXBwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE3MzM3NzM1ODIsImV4cCI6MTczMzc3NzE4Miwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCBiYWRnZSBjYXJzIGNoYXJnaW5nIGNsaW1hdGlzYXRpb24gZGVhbGVycyBtYW5hZ2VDaGFyZ2luZyBtYW5hZ2VDbGltYXRpc2F0aW9uIG1iYiBwaWQ6dXNlcl9wcm9maWxlLmFkZHJlc3NlczpyZWFkIHBpZDp1c2VyX3Byb2ZpbGUuYmlydGhkYXRlOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5kZWFsZXJzOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5lbWFpbHM6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLmxlZ2FsOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS5sb2NhbGU6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLm5hbWU6cmVhZCBwaWQ6dXNlcl9wcm9maWxlLnBob25lczpyZWFkIHBpZDp1c2VyX3Byb2ZpbGUucG9yc2NoZWlkOnJlYWQgcGlkOnVzZXJfcHJvZmlsZS52ZWhpY2xlczpyZWFkIHBsdWdBbmRDaGFyZ2Ugc3NvZGIgdmluIG9mZmxpbmVfYWNjZXNzIiwiYXpwIjoiWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkgifQ.NuQne243fXclWnmBH_aixqB8QCTcpdTrnWwp9SIpFOWJKXB1sDwffRW-Qzf7-QsjJba_lW0TlLG5GUkexykYdPsh-4v6wgx2KXJSVy6qNgNhsKQg8In5dBp6fvvguEbaJS0kZQbG4to2KjV8MGArDJb92K9Pmok9V-8f4sLxWCA9xKyNjtsYqMJxBzX6JWC63ZHDhJQncofxV7JrwHMgzFORzD5fU44g8KKsuCDEr4eMQLhPrQVgbtkSiDKNVz7kmk65XU3AHkLZ73AAuIMHRs3GMqbU8rLZZUVwizGyKaCGdPfAXn0H_C3gS9KgAFDiwUliwRbnjsGX04Wo4WFiMg","expires_at":1733777182,"expires_in":3600,"id_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkxiUXY4ckhMSVluMTZDSUNXbFFWTiJ9.eyJjaWFtSWQiOiJrZnVwbGFxZmlzN2o4dGVsIiwibmlja25hbWUiOiJqaW1lbmJhciIsIm5hbWUiOiJqaW1lbmJhckBnbWFpbC5jb20iLCJwaWN0dXJlIjoiaHR0cHM6Ly9zZWN1cmUuZ3JhdmF0YXIuY29tL2F2YXRhci84ZjMwNjMwMzZlZTAxMjk4NWNhY2NjNGFkNzU1YzVmNj9zPTQ4MCZyPXBnJmQ9aHR0cHMlM0ElMkYlMkZjZG4uYXV0aDAuY29tJTJGYXZhdGFycyUyRmppLnBuZyIsInVwZGF0ZWRfYXQiOiIyMDI0LTEyLTA5VDE5OjQ2OjE5LjQ4N1oiLCJlbWFpbCI6ImppbWVuYmFyQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczovL2lkZW50aXR5LnBvcnNjaGUuY29tLyIsImF1ZCI6IlhoeWdpc3VlYmJycVE4MGJ5T3VVNVZuY3hMSW04RTZIIiwiaWF0IjoxNzMzNzczNTgyLCJleHAiOjE3MzM3NzM4ODIsInN1YiI6ImF1dGgwfDY0MTMwMzQwNTRlYTJjYzdiZDE0ZThkNiIsInNpZCI6Im4tNmpfbFhVcXhEZ1B3Nl9EeFh0cFJOYUVERzJEYXZHIn0.qluPe6AJz_1jLIkbCU7S57XFXKjVQ9YCGEDerCQCeaf9DSAQOSRoABgR1X2jvjei_zddew4WjAY6po6_qOQAQ_xq186OdOCEW4kHwmkz26Nlbn7hxsILer_FPVbSelw2CrfZmiYeAd8rTLE9i3Ghr3tFJ4MONmNZdqy89-2Th2mS0klDjgAZaI0VaX3hkEzOEp7ZNCBdgXcnPhF9M-6B8Gnm02SHExGkPzCrsdbV5t84RtIj7N25fMlrHIigSFVBrxPIhHrQARvgD18Zf3bZS8gKi16ER7qYMuns0AvuTQ2-WF7W_auq0Pc3auu8sFUWR_LjkG80FwBwRHJmWXfX-A","refresh_token":"v1.MQFw-AK-XxbhNYEqIGcO-K-DjTvIqnubVGO26UWV5_-mUmShPmgoZ5JG3S4_NLACbZPoMEBaXTMsCLJqCoxGm_4","scope":"openid profile email badge cars charging climatisation dealers manageCharging manageClimatisation mbb pid:user_profile.addresses:read pid:user_profile.birthdate:read pid:user_profile.dealers:read pid:user_profile.emails:read pid:user_profile.legal:read pid:user_profile.locale:read pid:user_profile.name:read pid:user_profile.phones:read pid:user_profile.porscheid:read pid:user_profile.vehicles:read plugAndCharge ssodb vin offline_access","token_type":"Bearer"},"captcha_code":"DBEjqj","email":"MyPorscheID@gmail.com","password":"MyPassword","state":"hKFo2SB5TFpVMHlSREVxRnNPbHZzcXRwa1ZvZHhkWk5DZ3owV6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIElYb3ZfTzhkckJkQXFPZGFOQ01SMTZKeno0bWRhVW8to2NpZNkgWGh5Z2lzdWViYnJxUTgwYnlPdVU1Vm5jeExJbThFNkg"},"disabled_by":null,"discovery_keys":{},"domain":"porscheconnect","entry_id":"01JEPFAR2WDGY7C0XYHTZ486T6","minor_version":1,"modified_at":"2024-12-09T19:46:22.428900+00:00","options":{},"pref_disable_new_entities":false,"pref_disable_polling":false,"source":"user","title":"MyPorscheID@gmail.com","unique_id":null,"version":1}

Yeah, there were both a refresh and an access token there. Careful, these are used to get access to your account.
At restart, hass should grab the refresh token and try that first before going into initial login procedure. You should be able to see what is going on in the debug output.

Hi
Firstly thanks to all of you who work so hard so that normal people like myself get to benefit from these awesome integrations.
Just hoping this will be put together as a package to install through hacs at sometime as I can’t get my head around the manual method and don’t want to make more of a mess than I usually do.
Thanks again everyone.

Thanks! We will do another release soonish, I have some more cleanups I would like to add as well. But should be out in the next few days.

Just for information this when I could authenticate for a day worked for 2024 year Macan. My account has been logged in for ages but no devices in the account then after this update when it logged in there it was.


openstack-status does not support OpenStack Client CLI commands

On a Mitaka cluster with Identity API v3 configured, we use OpenStack Client CLI commands. Thus, the openstack-status script fails when it uses the service-specific CLIs. Here is an example of the failure output
== Keystone users ==
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:64: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
WARNING: unsupported identity-api-version 3, falling back to 2.0
/usr/lib/python2.7/site-packages/keystoneclient/v2_0/client.py:145: DeprecationWarning: Constructing an instance of the keystoneclient.v2_0.client.Client class without a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
  'the 2.0.0 release.', DeprecationWarning)
/usr/lib/python2.7/site-packages/keystoneclient/v2_0/client.py:147: DeprecationWarning: Using the 'tenant_name' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_name' argument instead
  super(Client, self).__init__(**kwargs)
/usr/lib/python2.7/site-packages/debtcollector/renames.py:45: DeprecationWarning: Using the 'tenant_id' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_id' argument instead
  return f(*args, **kwargs)
/usr/lib/python2.7/site-packages/keystoneclient/httpclient.py:371: DeprecationWarning: Constructing an HTTPClient instance without using a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
  'the 2.0.0 release.', DeprecationWarning)
/usr/lib/python2.7/site-packages/keystoneclient/session.py:140: DeprecationWarning: keystoneclient.session.Session is deprecated as of the 2.1.0 release in favor of keystoneauth1.session.Session. It will be removed in future releases.
  DeprecationWarning)
/usr/lib/python2.7/site-packages/keystoneclient/auth/identity/base.py:56: DeprecationWarning: keystoneclient auth plugins are deprecated as of the 2.1.0 release in favor of keystoneauth1 plugins. They will be removed in future releases.
  'in future releases.', DeprecationWarning)
Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-7950d040-f06e-4ca7-bf0d-31d5861b5767)
== Glance images ==
Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-0c9e6599-203a-4382-9930-e88e4f8f2472)
== Nova managed services ==
ERROR (BadRequest): Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-e200c61d-01ce-4c10-910a-5f94b4bd1c55)
== Nova networks ==
ERROR (BadRequest): Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-0cf5b7e7-eab4-4fab-b78c-b262e508e5d3)
== Nova instance flavors ==
ERROR (BadRequest): Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-248a0a13-43af-4af1-a394-53d0b82e1f6f)
== Nova instances ==
ERROR (BadRequest): Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-8ccd5ec0-ba69-4339-81c8-727579d306b3)```

Is there any way to offer an option to run `openstack-status` with OpenStack Client commands instead?

Thanks @apevec! Do you know when this change might be included in a new build of openstack-utils?


Delete button and list of tasks

It is very easy to press the massive delete button by mistake and in doing so deleting a task, for double pressing it deleting two tasks in this way.
In addition, the tasks should have a multi lines drop down, so it would be easy to see all tasks created and select accordingly

Hi @ivan1d ,
We would happy bring the new changes suggested by you. But can you provide more details with screen shot.

Refer #118 - this feature is already implemented and available in Beta version


Question about the class mapping

Hi, Aoran Xiao.
Firstly, thank you for your brilliant work! I see that you have given an example of class mapping from synlidar to semantickitti. And could you share the YAML file of semanticPOSS with me too? Please help.

Hi Kongxin, I have updated the 'annotations.yaml' file, you can find the mapping from synlidar to semanticposs now.


update types into Uppercases

Right now we use lowercase to 1) Cairo type representation in Rust 2) Original Rust type in uint, int, bool. But I think it's not good practice to have exact same name with original rust type. Maybe we can use remco/uint to Cairo type in Rust as uppercase struct ( Alloy did same approach ).
reference
https://github.com/alloy-rs/core/blob/main/crates/dyn-abi/src/resolve.rs

Sounds like a nice idea @rkdud007! Let's get this then. :)