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

Google WIFI router causing error - local_auth_token must follow the correct format #348

Closed
jazzyisj opened this issue Sep 21, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@jazzyisj
Copy link

jazzyisj commented Sep 21, 2021

Describe the bug

Errors when Google WIFI on network. Interesting to note that this Google WIFI router is actual set up on a second home in the Googe Home app. It is not in my primary home. We should be able to limit this integration to a specific home.

Version of the integration

v1.8.1

Logs

2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] Looking for 'Google Wifi router' (id=8CCC28E85744C2B7DFE6E90A013B81A7) in local network
2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=3c5639b1-7041-4fce-ad73-fe0d36da264f)] Initializing new Device instance
2021-09-21 01:34:27 ERROR (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=3c5639b1-7041-4fce-ad73-fe0d36da264f)] local_auth_token must follow the correct format
2021-09-21 01:34:27 WARNING (SyncWorker_1) [glocaltokens.client] Google Wifi router device initialization failed because of missing local_auth_token, skipping.
2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] Looking for 'Google Wifi router' (id=23D62ACE28B68134828189049C8D143D) in local network
2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=4508cfb0-000d-4f0e-9ba5-9776b98d16f6)] Initializing new Device instance
2021-09-21 01:34:27 ERROR (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=4508cfb0-000d-4f0e-9ba5-9776b98d16f6)] local_auth_token must follow the correct format
2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] Looking for 'Google Wifi router' (id=6E382A9A0EAF47591124C1D261FADF64) in local network
2021-09-21 01:34:27 DEBUG (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=b3b5870c-f0cb-4165-8c53-7b8926ed2983)] Initializing new Device instance
2021-09-21 01:34:27 ERROR (SyncWorker_1) [glocaltokens.client] [Device - Google Wifi router(id=b3b5870c-f0cb-4165-8c53-7b8926ed2983)] local_auth_token must follow the correct format
@ArnyminerZ
Copy link
Collaborator

The device discovery feature is linked to your Google account, so that might be the issue why it adds the device from different homes, however, I find it strange that it's working at all, since all the requests are made locally, so if the Home Assistant installation is on one network, and the device on another, that should not work.

For your question on Google WiFi, that's totally a bug, it shouldn't be recognized as a device.

@leikoilja
Copy link
Owner

@jazzyisj and @CallumCVM i looked at the code implementation for client in glocaltokens and the logic seems right:

  1. we fetch all devices from google
  2. validate all device tokens for a correct format and if the format is incorrect we log it as error and skip passing that device to the ha-google-home integration.
    Therefore, the integration should still be working for you and be correctly initialized for all other google home devices you have in your networks except the WiFi routers, those should just be skipped. Is that right or is the entire integration not working for you?
    p.s. perhaps we should revisit the glocaltokens and not log "invalid token format" for devices like WiFi routers as error, but rather log as debug

@jazzyisj
Copy link
Author

jazzyisj commented Oct 9, 2021

The integration is working exactly as expected.

Concern 1 was the error raised by the google wifi. They do not appear to be causing an issue, I believe just reclassifying the log message as debug would probably be adequate.

Concern 2 is fact that the integration is grabbing devices for a google home other than the intended one associated with HA. The underlying issue probably lies on the google end of things. There likely isn't a way to limit which "home" to fetch the devices from when dealing with multiple homes any more than there is a way to prevent HA entities from being added to a second home in the Google Home app. Not a big deal, any unwanted devices can always be disabled within HA.

@leikoilja
Copy link
Owner

Gotcha, thanks for the info @jazzyisj.
The first one is fixed here and will go out with a next release.
Can you please create a separate issue for concern 2, so we could separately take a look at google foyer response and see if it's possible to separate devices between homes.

@jazzyisj
Copy link
Author

Done. Thanks!

#363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants