home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.84k stars 29.54k forks source link

Hive Addon - Failed to set up: could not authenticate #81417

Closed gunjob closed 9 months ago

gunjob commented 1 year ago

The problem

Trying to setup the Hive addon and it fails to authenticate each time. Deleting and installing the addon again doesn't help.

What version of Home Assistant Core has the issue?

core-2022.10.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Hive

Link to integration documentation on our website

https://www.home-assistant.io/integrations/hive/

Diagnostics information

Logger: homeassistant.config_entries Source: components/hive/init.py:89 First occurred: 3:25:55 PM (5 occurrences) Last logged: 3:51:20 PM Error setting up entry EMAIL ADDRESS for hive

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 503, in startSession await self.getDevices("No_ID") File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 426, in getDevices await self.hiveRefreshTokens() File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 304, in hiveRefreshTokens result = await self.auth.refresh_token( File "/usr/local/lib/python3.10/site-packages/apyhiveapi/api/hive_auth_async.py", line 548, in refresh_token result = await self.loop.run_in_executor( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 391, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 691, in _make_api_call request_dict = self._convert_to_request_dict( File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 739, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/usr/local/lib/python3.10/site-packages/botocore/validate.py", line 360, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN':' #### long token removed for ticket #### '},), type: <class 'tuple'>, valid types: <class 'dict'>

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @rendili, @kjonline, mind taking a look at this issue as it has been labeled with an integration (hive) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `hive` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign hive` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


hive documentation hive source (message by IssueLinks)

holdestmade commented 1 year ago

have you enabled 2FA in the Hive app ?

gunjob commented 1 year ago

I have yes, 2FA code comes through, enter it. Still fails.

On Wed, Nov 2, 2022 at 7:52 PM holdestmade @.***> wrote:

have you enabled 2FA in the Hive app ?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/81417#issuecomment-1301154704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHP6QJ7VWFPAI2TC4E2EPETWGLA6RANCNFSM6AAAAAARVHJN6Y . You are receiving this because you authored the thread.Message ID: @.***>

holdestmade commented 1 year ago

There is someone with the same error here but removing and restarting and then reinstalling seemed to fix it as this was an issue before 2022.6.6

https://community.home-assistant.io/t/hive-integration-returning-invalid-type-for-parameter-authparameters/433128

Also, seemed to remember logging out and back into the Hive App might have worked for some.

Theres lots on the forum, search for hive authparameters

gunjob commented 1 year ago

Tried the above but no joy. I did notice once I'd setup the account and it displays the could not auth' message, another MFA code comes through.

gunjob commented 1 year ago

I should add, the trusted device "Home assistant" does show up on my hive app. Dispite the plug in failing to auth.

Akiva-J commented 1 year ago

I've also got this issue. HA core version 2022.11.3

I've tried adding, removing reinstalling everything - 2factor, HA, Hive Integration.

mcclumpherty commented 1 year ago

Same as the others here, except that it only happens when setting up a second hive account. The existing account still works ok.

ichilton commented 1 year ago

I get the same error:

    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN': '--snip--'},), type: <class 'tuple'>, valid types: <class 'dict'>
Akiva-J commented 1 year ago

So do well all have multiple users on our Hive system? Is that why?

KJonline commented 1 year ago

For info the hive integration doesn’t support multiple systems only one system can be logged in at a time

emtunc commented 1 year ago

I'm getting the same issue. Brand new HAOS set-up and brand new Hive account. What's strange is that my MFA config in Hive is "stuck" in the enabled state (I say stuck because it doesn't turn off even when I go through the screens to disable it) but I don't get prompted to enter any MFA when logging in on an untrusted/new device 🤷

Akiva-J commented 1 year ago

Interesting. I'm also having that issue in the Hive app. So here are my current setup and issues. Hopefully it helps.

Setup

Hive: 2 thermostats, 1 primary app user, 2 family member app users 2FA: Enabled, I can't turn it off, even after uninstalling/reinstalling app (android)

Issue: Can't login to Hive integration. Due to authentication issues. On my first try I got a "suspicious login attempt email" which I approved but the HA device never showed up in my approved devices list in the app. I heard disabling 2fa and reinstalling fixed this. But as I'm unable to turn off 2fa in the app reinstalling has not been getting me anywhere.

I'm getting the same issue. Brand new HAOS set-up and brand new Hive account. What's strange is that my MFA config in Hive is "stuck" in the enabled state (I say stuck because it doesn't turn off even when I go through the screens to disable it) but I don't get prompted to enter any MFA when logging in on an untrusted/new device 🤷

eouthwaite commented 1 year ago

Hi, I am also receiving the "Failed to set up... Invalid type for parameter AuthParameters" error. I have a brand new VM using haos_ova-9.3.ova Brand new Hive thermostat and hub - only 1 login at present No other devices currently configured Tried:

  1. unchecking 2FA and killing Hive app on phone - this resulted in 2FA still being enabled with a message to verify my phone number when starting the app and logging in; a new verification code was then received from Hive.
  2. deleting Hive integration from Frontend and restarting host from cli (host reboot) - rediscovered Hive, after configuring with username and password, same "Failed to set up" error appears (no verification code received from Hive either)
Phil-Barker commented 1 year ago

Exactly the same issue here - the app won't let me turn off 2FA, it never prompts for 2FA despite showing it as enabled and my phone number being verifed, same error code in HASS after multiple delete->reboot->re-add

Akiva-J commented 1 year ago

Okay. So I've contacted Hive support and they told me that my twofactor authentication is off. It's just the app that is showing me that it's still on. I've tried using a different mobile number and still can't turn it off in the app though.

Is anyone on iOS having this issue or is it an android thing?

None of the above has helped with Home Assistant either.

mattlaverick commented 1 year ago

Same issue for me. I cannot disable 2FA in the hive all and do not receive a code when logging into HA. Seems to be a Hive issue not allowing 2FA

Akiva-J commented 1 year ago

May be worth a bunch of us contacting them to say we're having issues with their 2fa.

https://www.britishgas.co.uk/help-and-support/ or I've been chatting on their WhatsApp +44 7458 029132

On Sat, 26 Nov 2022, 09:09 mattlaverick, @.***> wrote:

Same issue for me. I cannot disable 2FA in the hive all and do not receive a code when logging into HA. Seems to be a Hive issue not allowing 2FA

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/81417#issuecomment-1328011020, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASTPXGKMCVH67QKRMILSXODWKHHV7ANCNFSM6AAAAAARVHJN6Y . You are receiving this because you commented.Message ID: @.***>

mattlaverick commented 1 year ago

Looking at the Play Store reviews it looks like their last app update on 10th November has broken a lot of functionality and a lot of the settings fail to save, including any changes to scheduling

Akiva-J commented 1 year ago

Looking at the Play Store reviews it looks like their last app update on 10th November has broken a lot of functionality and a lot of the settings fail to save, including any changes to scheduling

I've got it working!

@mattlaverick 's comment gave me an idea. I rolled back to a previous version of the app via apk mirror. The toggle switch for two factor then worked. I toggled that to on (I believe the latest app version is off even when it says on) and it now actually sends me two factor codes. I then deleted and re-added Hive in HA and logged in like normal. 10/10

Edit: Figured I'd post a clearer guide for this as people seem to still have the issue. And I had to redo it recently.

Android:

  1. Uninstall hive app
  2. Download and install Android Version 10.51.1 from APK mirror.
  3. Go to Account Security and Toggle 2FA in settings to On (if on already toggle off and then back on)
  4. Login via HA as normal - you should now get your 2FA code.

Windows 11: (Windows 11 supports android apps locally)

  1. Download and install Android Version 10.51.1 from APK mirror.
  2. Go to Account Security and Toggle 2FA in settings to On (if on already toggle off and then back on)
  3. Login via HA as normal - you should now get your 2FA code.

Windows 10<: (I have not confirmed this method)

  1. Refer to ians guide below - comment link

iOS:

  1. I don't beleive there is a fix for this currently, go find a friend with an android or a pc with windows 11.
mattlaverick commented 1 year ago

@Akiva-J Amazing! I'll give it a go, which version of the app did you use?

mattlaverick commented 1 year ago

Can confirm @Akiva-J's solution. I reverted to v10.51.1 and can enable 2FA, receive the authentication code when logging in via HA and all works as expected. Thank you!

eouthwaite commented 1 year ago

Adding my confirmation that @Akiva-J 's solution of reverting to Hive app v10.51.1 has resolved the issue

Phil-Barker commented 1 year ago

If only I could roll back on iOS 😠

I have an android headunit in my car, I might try installing an older version of the app on that just to enable 2FA. Terrible work by British Gas on that though, the new app has broken tons, you can't enable 2FA from the web. Nice hardware but the software leaves a lot of wanting

Phil-Barker commented 1 year ago

Ok so... and this is insane but

If you have windows 11 you can install the Windows Subsystem for Android, then grab the google SDK, pull the v10.51.1 release from APK Mirror, enable developer mode on WSA and load the old APK in through that

As soon as I ran the app it prompted me to enable 2FA, which I did and now it's in HASS fine

What a ****-show from the Hive development team to break the app across all platforms!

mattlaverick commented 1 year ago

The lengths we go to have a pretty dial on our dashboards! 😆

Akiva-J commented 1 year ago

I had a good moan at them on live chat and all they said was "so is your problem fixed?"

I've only had Hive a few weeks and really wish I got a Nest now.

On Wed, 30 Nov 2022, 11:55 Phil-Barker, @.***> wrote:

Ok so... and this is insane but

If you have windows 11 you can install the Windows Subsystem for Android, then grab the google SDK, pull the v10.51.1 release from APK Mirror, enable developer mode on WSL and load the old APK in through that

As soon as I ran the app it prompted me to enable 2FA, which I did and now it's in HASS fine

What a ****-show from the Hive development team to break the app across all platforms!

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/81417#issuecomment-1332035436, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASTPXGMEZ7PXCJVIHIOURA3WK46ETANCNFSM6AAAAAARVHJN6Y . You are receiving this because you were mentioned.Message ID: @.***>

Phil-Barker commented 1 year ago

25 years as a software engineer, now a full-time CTO - and I'm still surprised and annoyed when large companies fail to do even basic QA!

I was just going to wait for them to update the app but their poor attitude didn't leave me with much hope

emtunc commented 1 year ago

I used to work at Hive - active development product and feature development hasn't been a thing for about 2+ years. Their core offering is basically the thermostat and even that has stayed almost exactly the same for about 4-5 years.

If you're looking to enter a new ecosystem, I wouldn't choose Hive.

Phil-Barker commented 1 year ago

Yeah I'm kinda wishing I'd gone the Nest route tbh

samellis commented 1 year ago

Also having this issue. I add the hive add on and enter log in details. I then get a 2FA code via text and put this in, then get the error "Failed to set up: could not authenticate". Weirdly, about 30 s later I get another 2FA code sent.

In the hive app I have 2FA on, and can see home assistant in settings > account security > trusted devices. So there is some communication going on.

blackys7312 commented 1 year ago

Managed to get this to work with IOS app. and working in HA now

  1. In the Hive app go to account security.
  2. Make sure your mobile phone has been verified for 2FA.
  3. Go to 2FA auth and Toggle to off and then toggle it back on
  4. Remove the integration from HA and readd
  5. Log on to HA Hive integration and you should now get the 2FA request to complete
mattlaverick commented 1 year ago

Managed to get this to work with IOS app. and working in HA now

  1. In the Hive app go to account security.
  2. Make sure your mobile phone has been verified for 2FA.
  3. Go to 2FA auth and Toggle to off and then toggle it back on
  4. Remove the integration from HA and readd
  5. Log on to HA Hive integration and you should now get the 2FA request to complete

That process didn't work for me because the 2FA was never actually on. The app said it was but turning it off and on again didn't work until the app was rolled back

thundercatsNZ commented 1 year ago

Same situation for me. Quick rollback of the apk on Android and I'm up and running in HA...

Thanks to all who helped diagnose and document the workaround!

samellis commented 1 year ago

Managed to get this to work with IOS app. and working in HA now

  1. In the Hive app go to account security.

  2. Make sure your mobile phone has been verified for 2FA.

  3. Go to 2FA auth and Toggle to off and then toggle it back on

  4. Remove the integration from HA and readd

  5. Log on to HA Hive integration and you should now get the 2FA request to complete

Will give this a try, removing the integration and re adding. However I am actually getting the 2FA codes already, they just don't seem to work authenticating me.

samellis commented 1 year ago

Currently receiving the 2FA code when creating the integration, but when submitted the following error is shown, same as the original issue raised. Tried deleting and recreating, as well as clearing trusted devices in the hive app.

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) File "/srv/homeassistant/lib/python3.9/site-packages/apyhiveapi/session.py", line 503, in startSession await self.getDevices("No_ID") File "/srv/homeassistant/lib/python3.9/site-packages/apyhiveapi/session.py", line 426, in getDevices await self.hiveRefreshTokens() File "/srv/homeassistant/lib/python3.9/site-packages/apyhiveapi/session.py", line 304, in hiveRefreshTokens result = await self.auth.refresh_token( File "/srv/homeassistant/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 548, in refresh_token result = await self.loop.run_in_executor( File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/srv/homeassistant/lib/python3.9/site-packages/botocore/client.py", line 530, in _api_call return self._make_api_call(operation_name, kwargs) File "/srv/homeassistant/lib/python3.9/site-packages/botocore/client.py", line 919, in _make_api_call request_dict = self._convert_to_request_dict( File "/srv/homeassistant/lib/python3.9/site-packages/botocore/client.py", line 990, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/srv/homeassistant/lib/python3.9/site-packages/botocore/validate.py", line 381, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN': ''},), type: <class 'tuple'>, valid types: <class 'dict'>

ribbal commented 1 year ago

Managed to get this to work with IOS app. and working in HA now

  1. In the Hive app go to account security.
  2. Make sure your mobile phone has been verified for 2FA.
  3. Go to 2FA auth and Toggle to off and then toggle it back on
  4. Remove the integration from HA and readd
  5. Log on to HA Hive integration and you should now get the 2FA request to complete

This worked for me! Thanks.

basilcroutons commented 1 year ago

@mattlaverick and @Akiva-J, and everyone else who crowd-sourced this solution many thanks for getting me up and running. Hive now working with my new install of HA

sterling work!

snibbo71 commented 1 year ago

Thank you to everyone who found this - just rolled back and now I get a 2FA request on my HA :)

Excellent, it looks like it's working now - thank you all!

(And shame on Hive for such a crappy app experience)

ian-hargreaves commented 1 year ago

Here are some instructions if like me you needed more details on how to fix this issue ... (I'm happy to be corrected if I've made any mistakes - this worked for me)

You need to install and run an old version of the Hive Android App to enable 2FA on your hive account "properly". The most recent versions don't save your settings.

[1] Enable Windows Subsystem for Android (WSA) 1.1 Load the Amazon Appstore from Microsoft Store This loads the WSA. You don't actually need to login in to Amazon Appstore https://apps.microsoft.com/store/detail/windows-subsystem-for-android%E2%84%A2-with-amazon-appstore/9P3395VX91NR?hl=en-us&gl=us

1.2 Change the settings on the WSA Open Windows Subsystem for Android Settings

[2 ] Download an old version of the Hive APK to let you enable 2FA https://www.apkmirror.com/apk/centrica-connected-home-ltd/hive/hive-10-51-1-release/hive-10-51-1-android-apk-download/

[3] To run the app - you can use WSA PacMan from Github Download the latest .exe here: https://github.com/alesimula/wsa_pacman/releases/tag/v1.3.6 Follow the installation defaults to have WSA Pacman be associated with .APK files.

[4] Run/Launch your downloaded Hive .APK file. You should be able to access the 2FA settings and enable them

[5] Remove/Add the Hive integration to HomeAssistant When prompted to enter your Hive credentials you should be prompted to enter the 2FA code sent via text message.

There you go

whitwocb commented 1 year ago

Same problem for me. iOS app shows 2FA is enabled, set to disabled and back out, summary page still shows enabled.

No OTP via the app or integration. I still get the error below: Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN': 'eyJ.....

Short of completing the activities in https://github.com/home-assistant/core/issues/81417#issuecomment-1400333267 I'm stuffed until the app is fixed.

Edit: Will need to wait, don't have Win11

Phil-Barker commented 1 year ago

How have they still not fixed this? 2FA in the app has been broken for 2 months and multiple people have reported the bug. Man I wish I'd bought a Nest instead

isdanryan commented 1 year ago

Looking at the Play Store reviews it looks like their last app update on 10th November has broken a lot of functionality and a lot of the settings fail to save, including any changes to scheduling

I've got it working!

@mattlaverick 's comment gave me an idea. I rolled back to a previous version of the app via apk mirror. The toggle switch for two factor then worked. I toggled that to on (I believe the latest app version is off even when it says on) and it now actually sends me two factor codes. I then deleted and re-added Hive in HA and logged in like normal. 10/10

Edit: Figured I'd post a clearer guide for this as people seem to still have the issue. And I had to redo it recently.

Android:

  1. Uninstall hive app
  2. Download and install Android Version 10.51.1 from APK mirror.
  3. Go to Account Security and Toggle 2FA in settings to On (if on already toggle off and then back on)
  4. Login via HA as normal - you should now get your 2FA code.

Windows 11: (Windows 11 supports android apps locally)

  1. Download and install Android Version 10.51.1 from APK mirror.
  2. Go to Account Security and Toggle 2FA in settings to On (if on already toggle off and then back on)
  3. Login via HA as normal - you should now get your 2FA code.

Windows 10<: (I have not confirmed this method)

  1. Refer to ians guide below - comment link

iOS:

  1. I don't beleive there is a fix for this currently, go find a friend with an android or a pc with windows 11.

For anyone that's still searching for a solution to this issue in 2023, this works! The issue seems to be with the latest hive app so roll back to the version above from apk mirror.

cat12d12 commented 1 year ago

The above does work feb 2023-Thank you--- had to use ios on a tablet- does not work from IOS

danielbodart commented 1 year ago

All I had to do in the latest android app (no need to install old versions) was:

After that in HA:

Now it all works

ichilton commented 1 year ago

@danielbodart Are you on iOS or Android though?

On the iOS app, if you turn off 2FA, it does not turn off :(

StephenGrey commented 1 year ago

@danielbodart Are you on iOS or Android though?

On the iOS app, if you turn off 2FA, it does not turn off :(

Same problem - can't make the fix work on IoS

danielbodart commented 1 year ago

Yes sorry, android here. I've updated my comment

ichilton commented 1 year ago

I only have iOS devices, no Android. I just had an idea - I went on the support chat on the Hive site and asked them to turn off 2FA. They did (but it still showed as on in the iOS app). I then asked them to turn it back on.

Now the Hive integration works!

pm1961 commented 1 year ago

Managed to get this to work with IOS app. and working in HA now

  1. In the Hive app go to account security.
  2. Make sure your mobile phone has been verified for 2FA.
  3. Go to 2FA auth and Toggle to off and then toggle it back on
  4. Remove the integration from HA and readd
  5. Log on to HA Hive integration and you should now get the 2FA request to complete

Thanks! This worked for me too.