-
Notifications
You must be signed in to change notification settings - Fork 38
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
Failed setup #99
Comments
Have you put hubspace into debug before inital setup? This may provide additional logs logger:
default: warning
logs:
custom_components.hubspace: debug |
I did the initial setup and debug through the UI. I can try the yaml config as well. |
I did get some debug logs to generate: |
The issue seems to be around the refresh token which would be tied to
hubspace-async. Can you verify what version of the integration you are on?
…On Sun, Aug 4, 2024, 15:34 cjr222 ***@***.***> wrote:
I did get some debug logs to generate:
2024-08-04 14:30:54.872 DEBUG (MainThread) [hubspace_async.connection]
Querying API for account id
2024-08-04 14:30:54.872 DEBUG (MainThread) [hubspace_async.auth] Refresh
token not present. Generating a new refresh token
2024-08-04 14:30:55.157 DEBUG (MainThread) [hubspace_async.auth]
Successfully generated an auth code
2024-08-04 14:30:55.260 DEBUG (MainThread) [hubspace_async.auth]
Successfully generated a refresh token
2024-08-04 14:30:55.261 DEBUG (MainThread) [hubspace_async.auth] Token has
not been generated or is expired
2024-08-04 14:30:55.327 DEBUG (MainThread) [hubspace_async.auth] Token has
been successfully generated
2024-08-04 14:30:55.523 DEBUG (MainThread) [hubspace_async.connection]
Querying API for account id
2024-08-04 14:30:55.608 DEBUG (MainThread) [hubspace_async.connection]
Querying API for all data
2024-08-04 14:30:55.608 DEBUG (MainThread) [hubspace_async.auth] Refresh
token not present. Generating a new refresh token
2024-08-04 14:31:00.929 DEBUG (MainThread)
[custom_components.hubspace.coordinator] Finished fetching hubspace data in
5.323 seconds (success: False)
2024-08-04 14:31:06.366 DEBUG (MainThread) [hubspace_async.connection]
Querying API for all data
2024-08-04 14:31:06.366 DEBUG (MainThread) [hubspace_async.auth] Refresh
token not present. Generating a new refresh token
2024-08-04 14:31:06.443 DEBUG (MainThread)
[custom_components.hubspace.coordinator] Finished fetching hubspace data in
0.078 seconds (success: False)
2024-08-04 14:31:16.641 DEBUG (MainThread) [hubspace_async.connection]
Querying API for all data
2024-08-04 14:31:16.641 DEBUG (MainThread) [hubspace_async.auth] Refresh
token not present. Generating a new refresh token
2024-08-04 14:31:16.866 DEBUG (MainThread)
[custom_components.hubspace.coordinator] Finished fetching hubspace data in
0.227 seconds (success: False)
2024-08-04 14:31:26.354 DEBUG (MainThread) [hubspace_async.connection]
Querying API for all data
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEM5HZ6DGEMGRR7RAVFNPTZPZ627AVCNFSM6AAAAABL63U2K2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGY2DKNZRGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
v3.0.4 |
Not positive on this one other than failure to generate a token and not correctly raising an exception. I'll need to dive into it some more and create a dev release for you to try. |
Sorry I haven't gotten back on this issue. I need to add some more logs in
hubspace-async to see what's happening. However I haven't seen this before
and it's a semi private API so this one may stink to figure out.
Did you have this issue pre-3.0?
…On Sun, Aug 4, 2024, 16:49 cjr222 ***@***.***> wrote:
v3.0.4
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEM5H2LED6DZBW5KAT5F7LZP2HVNAVCNFSM6AAAAABL63U2K2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGY3DIMRXGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
No worries, I appreciate any help you can provide. This is the first time I've used the integration so I am not upgrading from any previous version. |
Can you try a version under 3 and see if the connection works? It will
require manual configuration though
…On Tue, Aug 6, 2024, 07:44 cjr222 ***@***.***> wrote:
No worries, I appreciate any help you can provide. This is the first time
I've used the integration so I am not upgrading from any previous version.
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEM5HZILE73I54H7UJ4JPLZQCZITAVCNFSM6AAAAABL63U2K2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGA4TCMBRG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Maybe try the testhubspace.py . Perhaps the password is just wrong or has some special characters? Or can add some extra logging there. |
testhubspace.py seems to run successfully. I got a long output that includes details about the ceiling-fan-kensgrove-ii model I have. |
I also tried v3.0.3 and same setup error |
I have added additional messages (HS_TRACE) when authenticating. Can you run install and run manually to see what you get back?
After installed, run the following (but replace username / password): import logging
import hubspace_async
import asyncio
# TRACE messages in logs
hubspace_async.logger.setLevel(logging.HS_TRACE)
hubspace_async.logger.addHandler(logging.StreamHandler())
try:
loop = asyncio.get_event_loop()
except RunTimeError:
loop = asyncio.new_event_loop()
username = "<username>"
password = "<password>"
async def get_devices(username, password):
connection = hubspace_async.HubSpaceConnection(username, password)
return await connection.devices
loop.run_until_complete(get_devices(username, password)) You will see log messages like these:
Please paste those in (not the other messages as it contains information that could log you in from another system). For example, my run looks like
|
This could be an issue with the way I ran it but I get this: |
That warning is fine as long as an exception was not raised. I would continue to run the commands and get the logs. |
@cjr222 Were you able to gather the information from the logs? |
I was not. I got the script to run but have no idea where the logs go. Tried in verbose mode, looked in the normal HA logs but not sure where to look. |
Can you try with #104 to see if that helps at all? If not, well need to grab additional logs |
I had already deleted the integration during my last testing. So I downloaded the beta code first and now get this error when trying to add the integration, entering my username/password. It says connection timed out when reaching the server. In the HA logs I saw this. /usr/local/lib/python3.12/site-packages/hubspace_async/auth.py:265: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. The code that caused this warning is on line 265 of the file /usr/local/lib/python3.12/site-packages/hubspace_async/auth.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor. auth_page = BeautifulSoup(page)` |
I have a similar issue with failed setup. It was working previously with manual configuration.
|
Can you try to manually login to see what happens? Instructions can be found @ #103 (comment) |
So I finally was able to run the manual login - I get an output similar to your example, but it ends with 'Token has been successfully generated'. Throughout the output I see other things like 'Successfully generated an auth code' and 'Successfully generated a refresh token'. Didn't want to post the entire output as I'm not sure if there's sensitive information there. |
I have managed to replicate this (but not sure I got it in the same fashion). When logging in, if providing a valid username it can cause an issue with the initial setup but after an HA restart the problem goes away. I will continue to see why this is the case. |
I tried twice, even rebooted HA in between redownload but when adding the integration I get "Connection timed out when reaching the server." I've checked my traffic logs and I see a connection to accounts.hubspaceconnect.com |
Running into a similar issue as @cjr222 after redownload and restarting HA. I'm receiving an error "cannot_connect" on the integration setup screen. |
This has been released with 3.2.0. Please let me know if that does not fix your issue! |
this did the trick! the default timeout (10000) didn't work, so I increased it to 20000 and everything worked like a charm. thanks for your hard work @Expl0dingBanana |
increasing to 20000 worked for me as well. Thank you!! |
Perfect! Glad this fixed yalls issues. Good ol connection differences 😂 |
I keep getting failed setup after configuring the integration. I've checked the logs but other than beginning setup I don't see any logs. Any ideas what might be happening?
The text was updated successfully, but these errors were encountered: