Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

unable to setup hive component, was working previously #115

Closed woody166 closed 2 years ago

woody166 commented 2 years ago

2022-06-21 00:16:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry myemail for hive File "/config/custom_components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 493, in startSession File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 416, in getDevices await self.hiveRefreshTokens() File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 303, in hiveRefreshTokens File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 544, in refreshToken

mjburton commented 2 years ago

I’ve just upgraded to the latest and get the same error. Deleted and reconfigured/authenticated given the token wasn’t being accepted and now get:

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/hive/init.py:89 Integration: Hive First occurred: 05:44:19 (1 occurrences) Last logged: 05:44:19

Error setting up entry mjburton@gmail.com for hive Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 493, in startSession await self.getDevices("No_ID") File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 417, in getDevices api_resp_d = await self.api.getAll() File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_async_api.py", line 147, in getAll json_return.update({"original": resp.status}) AttributeError: 'NoneType' object has no attribute 'status'

KJonline commented 2 years ago

@woody166 do you have 2FA turned on?

@mjburton are you logging in with the owner account?

spidererrol commented 2 years ago

I'm seeing a similar error to @mjburton:

2022-06-21 05:00:25 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry **email redacted** for hive
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hive/__init__.py", line 89, in async_setup_entry
    devices = await hive.session.startSession(hive_config)
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 493, in startSession
    await self.getDevices("No_ID")
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 416, in getDevices
    await self.hiveRefreshTokens()
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 303, in hiveRefreshTokens
    result = await self.auth.refreshToken(
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 544, in refreshToken
    result = await self.loop.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 691, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 739, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/usr/local/lib/python3.9/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': '** 1785 characters redacted **'},), type: <class 'tuple'>, valid types: <class 'dict'>

I do have 2fa enabled, the same as it was working with before the upgrade to 2022.6.1 last night. I am logging in with the owner account, the same as was working before the upgrade. Rolling back to 2021.5.4 has restored functionality.

Hope this is helpful.

mjburton commented 2 years ago

Yes I am the owner account.

On Tue, 21 Jun 2022 at 07:38, Khole @.***> wrote:

@woody166 https://github.com/woody166 do you have 2FA turned on?

@mjburton https://github.com/mjburton are you logging in with the owner account?

— Reply to this email directly, view it on GitHub https://github.com/Pyhass/Hive-Custom-Component/issues/115#issuecomment-1161324358, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABREFLCXS3SJ4UKYKGSC2GLVQFPNDANCNFSM5ZKLGGSQ . You are receiving this because you were mentioned.Message ID: @.***>

brewston commented 2 years ago

Same here. Rolled back to 2021.5.4 and its working again. Not using 2FA, just basic auth. Where are people finding those log entries ? All I ever see (even when it was broken) is :

2022-06-21 09:03:03 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hive 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

CaptInsano commented 2 years ago

As per other reports: working perfectly with 2021.5.4 but could not setup after updating to 2022.6.1.

I rolled back to 2021.5.4 and all working again (I did not delete and re-add integration when it did not work with 2022.6.1)

My account has 2FA enabled

Omertron commented 2 years ago

Reinstalled the integration, no 2fa and am the account owner

woody166 commented 2 years ago

@woody166 do you have 2FA turned on?

@mjburton are you logging in with the owner account?

Hiya, no not using 2FA and also I’m the acct. owner

Also, just reverted back to 2021.5.4 and working again

KJonline commented 2 years ago

Hi all,

just so everyone is aware 2fa is required now by hive on the latest version of the app so it is required for home assistant.

A lot of people have found success with deleting the integration disabling 2fa and then enabling it again and after that is done re add the integration

mjburton commented 2 years ago

Downgraded and login with 2fa is working fine now. Also entities are updating, IP address no longer appears blocked. 13 devices and I decreased the refresh speed in case there were too many calls being made.

On Tue, 21 Jun 2022 at 17:26, Khole @.***> wrote:

Hi all,

just so everyone is aware 2fa is required now by hive on the latest version of the app so it is required for home assistant.

A lot of people have found success with deleting the integration disabling 2fa and then enabling it again and after that is done re add the integration

— Reply to this email directly, view it on GitHub https://github.com/Pyhass/Hive-Custom-Component/issues/115#issuecomment-1161980997, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABREFLCKSSVMPY3FW56SCRLVQHULFANCNFSM5ZKLGGSQ . You are receiving this because you were mentioned.Message ID: @.***>

Omertron commented 2 years ago

FIxed for me. Uninstall component, reboot. Turn on 2FA in the Hive app. Reinstall, enter username/password and wait for 2FA code. Complete the install by adding devices

KJonline commented 2 years ago

This is fixed in the latest version of the custom component

brewston commented 2 years ago

Turning on 2FA fixed it for me - thanks for maintaining this integration @KJonline