leikoilja / ha-google-home

Home Assistant Google Home custom component
MIT License
428 stars 72 forks source link

Device IP not found when running through VPN #447

Closed hugalafutro closed 2 years ago

hugalafutro commented 2 years ago

Describe the bug

I recently connected the whole machine on which HA runs inside a docker to a VPN via mullvad according to this link: https://mullvad.net/en/help/wireguard-and-mullvad-vpn/ After HA restart Both this integration, and Google Cast integration detected no devices. For Google Cast integration I was able to work around this by supplying IP addresses of the cast devices, but did not find a way to do the same for this integration.

I was wondering if there is a way to do tell the IPS to your integration? My google devices are on static IPs. The logs suggest the devices are found, but not their ips. I suspect this is because when I'm connected via the vpn, local name resolution does not work.

Version of the integration

1.9.4

Logs

2022-01-29 10:00:51 INFO (MainThread) [custom_components.google_home]
-------------------------------------------------------------------
Google Home community driven integration
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/leikoilja/ha-google-home/issues
-------------------------------------------------------------------
2022-01-29 10:00:51 DEBUG (MainThread) [custom_components.google_home] Coordinator update interval is: 0:03:00
2022-01-29 10:00:51 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance.
2022-01-29 10:00:51 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
2022-01-29 10:00:51 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "s******************", password to "j***************", master_token to "a******************************************************************************************************************************************************************************************************************************" and android_id to a***************
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Initializing models list if empty...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Forcing homegraph reload
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Invalidated homegraph
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Getting homegraph...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] There is no stored homegraph, or it has expired, getting a new one...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] There is no access_token stored, or it has expired, getting a new one...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Master token: a******************************************************************************************************************************************************************************************************************************
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] Access token: y**************************************************************************************************************************************************************************************************************************************************************************************************************************, datetime 2022-01-29 10:00:51.509572
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Creating SSL channel credentials...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Creating access token call credentials...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Compositing channel credentials...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Establishing secure channel with the Google Home Foyer API...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Getting channels StructuresServiceStub...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Getting HomeGraph request...
2022-01-29 10:00:51 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Fetching HomeGraph...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.client] [GRPC] Storing obtained HomeGraph...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.client] Getting network devices...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Discovering devices...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Creating new Event for discovery completion...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Creating new CastListener...
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Using attribute Zeroconf instance
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Creating zeroconf service browser for _googlecast._tcp.local.
2022-01-29 10:00:52 DEBUG (SyncWorker_2) [glocaltokens.scanner] Waiting for discovery completion...
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.scanner] Got 0 devices. Iterating...
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] Iterating in 14 homegraph devices
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Lightstrip' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Programmable Thermostat' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - SCP(id=REDACTED)] Initializing new Device instance
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - SCP(id=REDACTED)] Set device_name to "SCP", local_auth_token to "8***********************************************************************************************************", IP to "None", PORT to "None" and hardware to "Google Home Mini"
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] Adding SCP to devices list
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Lava Lamp' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - CDC(id=REDACTED)] Initializing new Device instance
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - CDC(id=REDACTED)] Set device_name to "CDC", local_auth_token to "I***********************************************************************************************************", IP to "None", PORT to "None" and hardware to "Chromecast"
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] Adding CDC to devices list
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Small Lamp' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Power' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Bedside Lamp' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'NAS Temperature' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - FEMA(id=REDACTED)] Initializing new Device instance
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] [Device - FEMA(id=REDACTED)] Set device_name to "FEMA", local_auth_token to "Z***********************************************************************************************************", IP to "None", PORT to "None" and hardware to "Chromecast"
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] Adding FEMA to devices list
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Ceiling Lamp' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Power' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Heater' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] 'Bedroom Blind' local_auth_token is not found in Homegraph, skipping
2022-01-29 10:00:54 DEBUG (SyncWorker_2) [glocaltokens.client] Successfully initialized 3 Google Home devices
2022-01-29 10:00:56 DEBUG (MainThread) [custom_components.google_home] Failed to fetch timers/alarms information from device SCP. We could not determine its IP address, the device is either offline or is not compatible Google Home device. Will try again later.
2022-01-29 10:00:56 DEBUG (MainThread) [custom_components.google_home] Failed to fetch timers/alarms information from device CDC. We could not determine its IP address, the device is either offline or is not compatible Google Home device. Will try again later.
2022-01-29 10:00:56 DEBUG (MainThread) [custom_components.google_home] Failed to fetch timers/alarms information from device FEMA. We could not determine its IP address, the device is either offline or is not compatible Google Home device. Will try again later.
2022-01-29 10:00:56 DEBUG (MainThread) [custom_components.google_home] Finished fetching sensor data in 5.371 seconds (success: True)
leikoilja commented 2 years ago

Hey, @hugalafutro. Right, the reason integrations cannot auto-discover the devices is because your VPN prevents them from mDNS lookup on your local network. What you are asking for is reasonable and we already have an open feature request for it :) Please follow it here - https://github.com/leikoilja/ha-google-home/issues/340