skodaconnect / homeassistant-skodaconnect

Skoda Connect - A home assistant plugin to add integration with your car
Apache License 2.0
217 stars 28 forks source link

Error: Invalid flow specified on adding a car #293

Open sanchosk opened 2 weeks ago

sanchosk commented 2 weeks ago

Describe the bug I had two accounts - one for skoda and one for powerpass. To allow powerpass automatically authenticate on my car, I logged in to the car using the powerpass account. Same for skoda app. Afterwards, the car stop reporting the charging data etc. under the old skoda account. I therefore removed the skoda account from the integration and tried to add the new powerpass account. Provided login name and password, got a screen "Loading next steps for skoda connect" and received error "Invalid flow specified". Logging back in with the old account also did not work. Reinstalled the integration, tried again (found this on different bug here on github). Did not work. Removed the HACS integration, restarted HA, re-installed integration. Tried again to login using the powerpass, same error. Tried again to login using skoda account works, but does not provide the data again.

**Is this working in MySkoda app?*** Yes, logged out and in on 2 different phones, all works.

Latest working release Working with skoda account using release 1.2.12, same release does not work with powerpass.

Debug logs Found 2 interesting things in logs:

2024-07-04 14:33:33.798 ERROR (MainThread) [skodaconnect.connection] Received unhandled error indicating client-side problem.
Restart or try again later.
2024-07-04 14:33:33.798 ERROR (MainThread) [custom_components.skodaconnect.config_flow] Fetch vehicles failed with error: No vehicles were found for given account!

and another one:

2024-07-04 14:37:00.355 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'skodaconnect' calls async_forward_entry_setup for integration, skodaconnect with title: xxxxxxxxxx and entry_id: xxxxxxxxxxxxxxx, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/skodaconnect/__init__.py, line 256: hass.async_create_task(, please create a bug report at https://github.com/skodaconnect/homeassistant-skodaconnect/issues
2024-07-04 14:37:00.395 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration skodaconnect with title: xxxxxxxxxxxx and entry_id: xxxxxxxxxxxxxxx, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())

Installation:

Additional context N/A

dvx76 commented 2 weeks ago

First thought is that moving to the Powerpass account gets you into the same situation as users with new accounts/cars (e.g. https://github.com/skodaconnect/skodaconnect/issues/126) where the car data is no longer found by the old API (used by HA and MySkoda Essentials App) and only the new API (used by the newer MySkoda App) works.

sanchosk commented 2 weeks ago

Ouch :( One more reason to do my own integration, I guess :( But I'll wait if someone can also modify the integration to the new API, perhaps...

dvx76 commented 2 weeks ago

You are welcome to contribute to this integration.

sanchosk commented 2 weeks ago

Would you be able to guide me to "capture" somehow the API communication, perhaps? I would be glad to contribute, but my python-mojo is microscopic :) My other idea would be to use OBD2 and android phone to report the data to HA using MQTT - that's about as far as my scripting skills go :)