Google Wifi Integration (Custom Component)

I have a mini pc with ubuntu server 20.04 running Home Assistant on docker.
I cannot make my google wifi gen 1 work. I got the token fine but in the log I keep getting this error:

I try fo find a solution here in the chat but coudn’t
Can anyone help?

OMG you’re a hero!

I’ve been having issues with my wifi for so long now and it seemed nothing was fixing it. Every day sometimes 2-3 times per day my internet would just drop across the entire house. The only thing that would fix it would be to pull the main puck from the wall. That would keep me going for a few hours at least.

Hopefully OP gets this fixed because i would love love love to be able to use this more reliably. I would also have issues where i would try to turn a devices internet off but it just wouldn’t work.

I’m trying to build a chore tracker so that my kids can finish their chore then walk to the living room tablet to mark the chore/homework as finished which will then turn their internet back on for the day.

I switched to a Google Nest WiFi system about a month ago and found it to be dropping out occasionally. I installed the integration at the same time as receiving the system. After following the advice on here, I’ve uninstalled the integration and the WiFi has been reliable for over 2 weeks now. I do hope the issue is resolved as it would greatly aid presence detection and device tracking.

For me was the same. WiFi was going down every 7 days or so. As soon as I removed the integration my WiFi has been stable for weeks.

Is there a way we can help to debug this to fix it? Really love the integration!

Unfortunately I haven’t been able to figure out what part of the integration is causing the instability. My hunch is that Google doesn’t like the system calling their cloud APIs for status so frequently, but without the calls being frequent there isn’t much benefit to the integration.

I have mine set to restart the network via HA automation every night at 3am which seems to keep me stable on the network. I have only had to restart once in the last 3-4 months this way.

I’m happy to collaborate with someone who has more time to look at more troubleshooting, but unfortunately other than the occasional bug fix I can’t do much more right now on this one.

Maybe a bit off topic here but allow me to be silly for a sec… I just bought a pair of Google Wifi mesh and the “router” has a wan port so it gets an IP form my private IP in the 192.168.1.0 range and then creates another private 172.16.x.x range for the clients which consist of a bunch of stuff including some google chromecast audio… So … how will HA see them as they are “behind” the google router/ap for instance?

This integration sees all of the devices that are assigned an IP/managed through the Google Home/Wifi system. So if they are managed in Google Wifi/Home app, then they will appear here.

Oh via the API so no direct connection, got it.

Thanks!

really dont get how to install this.

copied the googlewifi dir to my custom_components dir

search the integration from home assistant, it wasnt found (google wifi)… search the website instead Google Wifi - Home Assistant witch told me to add sensor google wifi to configuration.yaml

sensor:
  - platform: google_wifi
    host: 192.168.86.1

restart…

created the token with the chrome extenssion… but where should I add that? there is still no Google wifi integration showing up in integrations

You don’t need anything in your configuration.yaml

Once you copy the files to custom_components then you need to restart HA. Then sometimes you will need to do a hard-refresh on the integrations page (Ctrl-F5). You should then see it when you search in the add an integration window

Hi all,
I’m getting the following error -

Logger: homeassistant.components.sensor
Source: custom_components/googlewifi/sensor.py:32
Integration: Sensor (documentation, issues)
First occurred: 30 November 2021, 23:37:52 (2 occurrences)
Last logged: 30 November 2021, 23:38:12

Error while setting up googlewifi platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/googlewifi/sensor.py", line 32, in async_setup_entry
    for system_id, system in coordinator.data.items():
AttributeError: 'NoneType' object has no attribute 'items'

I believe this is due to me not being an owner of the wifi network but only being a manager. I set my network up again yesterday following a factory reset but I’m still getting the error. Is there any further explanation that causes this? Thanks all.

Does anyone know how to sol e this one. I notice with the latest version of this integration all wifi devices report unavailable every 12 mins or soand come back soon afterwards. In the core logs i see a lot of these. Is it related I wonder.

File "/usr/local/lib/python3.9/site-packages/googlewifi/__init__.py", line 289, in structure_systems
    for this_station in system_metrics.get("stationMetrics"):
TypeError: 'NoneType' object is not iterable

had on onhub integration already… think that was it… removed in and now it showed up.

1 Like

Has anyone been able to get the auth code from a Mac recently? I’ve tried in Chrome (with and without the extension), Safari, and Firefox, including with and without spoofing the useragent, but it always just takes me to https://accounts.google.com/embedded/close with no obvious way to get an auth code from that.

I got it to work. It seems that the issue was that I was logged in to multiple Google accounts at the same time. I ran the manual method of getting the auth code in an incognito window, and it worked there.

I was also missing a key step of the manual method, which is that you need to look at the cookie that gets set after going through the login screen in order to find the oauth_code.

Hi Aaron, Tim,
I’m trying the Google Wifi Integration, and I’m having the exact problem mentioned above, which is after this https://www.angelod.com/onhubauthtool, I put in my dev name as ‘Nest Wifi’ (that is shown on the Nest Wifi iphone app), and copy the URL to chrome, with suggested ‘ModHeader’ extension to modify the ‘UserAgent’, I logged into google with one of my account (I made sure I closed all the accounts on my Mac to google, since I saw the above comments), but I still get this blank page of https://accounts.google.com/embedded/close. I’m wondering something else is missing…, should I first to setup some api thing on the google cloud side? is that device name special I need to get from somewhere? thanks.

The step that isn’t well documented is that after you get to that embedded/close page you should go to chrome://settings/cookies/detail?site=accounts.google.com and look for a cookie called oauth_code. The value in its “Content” field is what you paste back into the “oauth_code cookie” field in https://www.angelod.com/onhubauthtool.

I confirmed with the person who made that tool that the device_name you enter doesn’t actually make any difference.

1 Like

Hi Aaron, Got it working. Thanks for this extra step!

This integration doesn’t seem to be installing correctly for me. I find it in HACS and install. Restart the HA server and see it listed under HACS as installed but looking under Configuration -Settings - Info it is not listed. Other HACS integrations do appear there. I was never given a chance to provide logins/tokens for the integration either. Am I missing something on how this should be installed?

In case someone else runs into the same issue (installing in HACS but not being able to add integration even after multiple reboots) I found if I went to my laptop (had been working on my Mac) the integration appeared in the list. God I love computers.