Dielee / volvo2mqtt

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

Updates do not resume after adding OTP token #193

Closed canoben closed 6 months ago

canoben commented 6 months ago

I followed the instructions for version 1.9 to add the OTP token that Volvo sent me this morning at 10:30. Since then, there have been no further updates and it seems like the integration does no longer run. Here are the last lines of the log file of volvo2mqtt: May 27 10:30:18 volvo2mqtt [107] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 12/15 May 27 10:30:23 volvo2mqtt [107] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 13/15 May 27 10:30:28 volvo2mqtt [107] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 14/15 Traceback (most recent call last): File "/volvoAAOS2mqtt/main.py", line 15, in <module> authorize() File "/volvoAAOS2mqtt/volvo.py", line 71, in authorize response = send_otp(auth_session, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 155, in send_otp raise Exception ("No OTP found, exting...") Exception: No OTP found, exting... s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

I only rectified the OTP situation now (8 hours later), but whatever I try (restart the integration, restarting HA), no further log entries are produced and the dashboard shows all the sensors as not available.

ahlburg commented 6 months ago

Hmmm, wait now... Everytime the addon is started, it tells Volvo to send out a new OTP, which means the old one becomes obsolete, which means that this can never work... We are missing something in our communication here. Can you please one more time tell me how this is supposed to work?

Dielee commented 6 months ago
  1. Install the addon
  2. Fill in your credentials, which are working for the Volvo app
  3. Fill in all the other settings, mqtt, TZ, etc..
  4. Start the addon
  5. The addon now starting the otp auth
  6. You are getting an email
  7. Fill the either the otp into the text entity or post it via mqtt service
  8. Have fun
ahlburg commented 6 months ago
  1. Install the addon
  2. Fill in your credentials, which are working for the Volvo app
  3. Fill in all the other settings, mqtt, TZ, etc..
  4. Start the addon
  5. The addon now starting the otp auth
  6. You are getting an email
  7. Fill the either the otp into the text entity or post it via mqtt service
  8. Have fun

Thank you, but one step is missing. When the addon starts and requesting the otp auth it crashes and the next time I try to start it , it request a new code, which means the old one is incorrect (obsolete) and the addon crashes again... Because you know how the addon works. Why does it crash, instead of waitng for a correct OTP? It could retry the auth-process without crashing?

Dielee commented 6 months ago

So you start your addon and it crashes immediately without doing anything?

ahlburg commented 6 months ago

So you start your addon and it crashes immediately without doing anything?

Impossible to follow those steps because when the email is received the addon has already crashed because auth failed... Why does the addon crash because auth is not working?

May 29 17:48:37 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.9.2 May 29 17:48:37 volvo2mqtt [106] - INFO: Starting login with OTP Traceback (most recent call last): File "/volvoAAOS2mqtt/main.py", line 15, in authorize() File "/volvoAAOS2mqtt/volvo.py", line 73, in authorize response = send_otp(auth_session, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 164, in send_otp raise Exception(message["details"][0]["userMessage"]) Exception: This passcode is invalid or has expired. s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

Dielee commented 6 months ago

Is it possible that you are sending your otp codes as "retained" message ? Or even send a "retained" message before to this topic?

ahlburg commented 6 months ago

Is it possible that you are sending your otp codes as "retained" message ? Or even send a "retained" message before to this topic?

That is possible. Not sure what that means? I see there is a checkbox (currently checked) in the mqtt publish.

Dielee commented 6 months ago

Makes absolutely no difference when set to false...

Sure, as the message is already retained inside the mqtt broker. Please read how mqtt retain works and clear the retained message.

ahlburg commented 6 months ago

Makes absolutely no difference when set to false...

Sure, as the message is already retained inside the mqtt broker. Please read how mqtt retain works and clear the retained message.

That made it!!! Thank you for your patience and support! Coffee sent! ;-)

Dielee commented 6 months ago

Fixed this issue with version v1.9.3.