Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth breaks down mutiple times per day #251

Closed
petrsimunek opened this issue Oct 26, 2024 · 15 comments
Closed

Auth breaks down mutiple times per day #251

petrsimunek opened this issue Oct 26, 2024 · 15 comments

Comments

@petrsimunek
Copy link

I have been using the volvo2mqtt for some time, and it worked flawlessly. But today the plugin get unauthorized every couple hours, and I have to reenter the OTP over and over again.

Logs below.

Oct 26 16:47:28 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:47:29 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:49:29 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:49:30 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:51:30 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:51:32 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:53:32 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:53:34 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:55:34 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:55:42 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:57:42 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:57:43 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 16:59:43 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 16:59:45 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:01:45 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:01:46 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:03:46 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:03:47 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:05:47 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:05:49 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:07:49 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:07:50 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:09:50 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:09:52 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:11:52 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:11:53 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:13:53 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:13:55 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:15:55 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:15:56 volvo2mqtt [106] - INFO: Mqtt update done. Next run in 120 seconds. Oct 26 17:17:56 volvo2mqtt [106] - INFO: Sending mqtt update... Oct 26 17:17:56 volvo2mqtt [106] - INFO: Refreshing credentials Oct 26 17:17:56 volvo2mqtt [106] - INFO: Starting login with OTP Traceback (most recent call last): File "/volvoAAOS2mqtt/main.py", line 16, in <module> update_loop() File "/volvoAAOS2mqtt/mqtt.py", line 295, in update_loop update_car_data() File "/volvoAAOS2mqtt/mqtt.py", line 336, in update_car_data state = volvo.api_call(entity["url"], "GET", vin, entity["id"], force_update) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 465, in api_call refresh_auth() File "/volvoAAOS2mqtt/volvo.py", line 201, in refresh_auth authorize(renew_tokenfile=True) File "/volvoAAOS2mqtt/volvo.py", line 77, in authorize response = send_otp(auth_session, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 168, in send_otp raise Exception(message["details"][0]["userMessage"]) Exception: This passcode is invalid or has expired.

@Ilpo55
Copy link

Ilpo55 commented Oct 26, 2024

Same here. Is it API server issue....

@poppyfields
Copy link

Same for me - started about 2 hours ago - new OTP never recognised

@Dielee
Copy link
Owner

Dielee commented Oct 26, 2024

Yes, you found a bug. Already fixing ;)

@Dielee
Copy link
Owner

Dielee commented Oct 26, 2024

So, I don't know why your credential refresh isn't working, but I have added more logging to bring some light into the dark.
And you found a bug, which appears if the OTP auth is used more than once while the addon is runing.
Fixed by v1.10.3.

@nsimons
Copy link

nsimons commented Oct 26, 2024

Would it be possible to change the OTP process so that it does not spam SMS' to your phone when the addon loses the authentication data? If you are not at home with access to your HA instance, then you are not able to stop it.

Some ideas:

  • start the OTP flow once (so that one SMS is sent), if no action taken from the user then give up gracefully and wait
  • alert/warning in HA that credentials are missing
  • possibility to start the OTP process manually, some button/boolean input entity (?)

@Dielee
Copy link
Owner

Dielee commented Oct 26, 2024

Would it be possible to change the OTP process so that it does not spam SMS' to your phone when the addon loses the authentication data? If you are not at home with access to your HA instance, then you are not able to stop it.

Some ideas:

  • start the OTP flow once (so that one SMS is sent), if no action taken from the user then give up gracefully and wait
  • alert/warning in HA that credentials are missing
  • possibility to start the OTP process manually, some button/boolean input entity (?)

Maybe I will add an option to change the otp behavior. For now, the addon will restart, if the auth wasn't successful.

@LaurentB6928

This comment was marked as off-topic.

@Dielee

This comment was marked as off-topic.

@canoben
Copy link

canoben commented Oct 26, 2024

I updated to 10.3 but all the entities are still unavailable. Do I have to do something else?

@LaurentB6928

This comment was marked as off-topic.

@Dielee
Copy link
Owner

Dielee commented Oct 27, 2024

I updated to 10.3 but all the entities are still unavailable. Do I have to do something else?

If you restart the addon, auth is working again ?

@canoben
Copy link

canoben commented Oct 27, 2024

I updated to 10.3 but all the entities are still unavailable. Do I have to do something else?

If you restart the addon, auth is working again ?

Restart of addon did not help, but restarting HA completely did the trick. Thanks!

@Ilpo55
Copy link

Ilpo55 commented Oct 27, 2024

I just updated to 1.10.3 and it started to work OK without new OTP.
Thanks

@Dielee
Copy link
Owner

Dielee commented Oct 27, 2024

v.1.10.4 should work better if OTP ist required during runtime

@dazza120
Copy link

dazza120 commented Oct 27, 2024

Perfect its working again deleted the whole thing and reinstalled it thanks mate and sorry to be a pain

@Dielee Dielee closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants