house-of-abbey / GarminHomeAssistant

Garmin application to provide a dashboard to control your Home Assistant
https://community.home-assistant.io/t/home-assistant-app-for-garmin/637348
MIT License
101 stars 14 forks source link

Even application or Widget won't work if my phone is connected on WIFI. (Garmin VENU3 or EDGE 830) #172

Closed lMikel closed 2 months ago

lMikel commented 2 months ago

Describe the bug Hi!

First, many thanks for this application !

I know that the app and widget won't connect if the devices are connected directly to WIFI. But is it the same if they're connected to the phone via BT and the phone is connected to the wifi network?

I have a Garmin VENU3 watch connected with the GarminHomeAssistant APP and my EDGE 830 GPS connected with the GarminHomeAssistant Widget.

To be able to use the GarminHomeAssistant APP or widget i must thirst disconnect the WIFI on my phone. Is it normal ? (WIFI on the VENU3 & EDGE 830 are deactivated)

One interresting thing : if I reconnect the WIFI on the phone = still functional if I kill Garmin Connect and restart it after the phone is connected to the WIFI = I get the Webhook error logging error (check your internet connection) To make it work again, I must disconnect the WIFI.

To Reproduce Just lunch ever GarminHomeAssistant APP or GarminHomeAssistant Widget with my phone connected to the WIFI network.

Garmin Device (please complete the following information):

Smartphone (please complete the following information):

JosephAbbey commented 2 months ago

My initial thought reading this is that your router is unable to do a process called hairpinning (https://companion.home-assistant.io/docs/troubleshooting/networking#hairpin-nat). This means when you use the external IP of your HomeAssistant from inside the same LAN that HomeAssistant is on, it will not work.

Have you tried using he app while your phone is on a different WiFi (e.g. at a coffee shop)? Have you tried using a VPN while connected to your home WiFi (this means you are connecting from outside and thus hairpinning is not a problem)? What kind of router do you have?

lMikel commented 2 months ago

My initial thought reading this is that your router is unable to do a process called hairpinning (https://companion.home-assistant.io/docs/troubleshooting/networking#hairpin-nat). This means when you use the external IP of your HomeAssistant from inside the same LAN that HomeAssistant is on, it will not work.

But my HA companion app (on the phone) is working like this without problem. (i have set up an internal dns that should redirect all trafic directly to the HA IP address). I'll will try to investigate more on this point.

Have you tried using he app while your phone is on a different WiFi (e.g. at a coffee shop)? Have you tried using a VPN while connected to your home WiFi (this means you are connecting from outside and thus hairpinning is not a problem)? What kind of router do you have?

Yes, i've just test with a VPN connected over my Phone WIFI, and it's working. The point is related to my internal network. Thanks for your help, i'll try to focus on this (my router is a Linksys Velop)

philipabbey commented 2 months ago

if I reconnect the WIFI on the phone = still functional

Yes, i've just test with a VPN connected over my Phone WIFI, and it's working.

So as the Watch application works under one condition, the watch application has no bug. I'm removing the bug label as this is a request for help with your personal local networking.

philipabbey commented 2 months ago

As you have a Venu 3 watch, there really should be no mention of "Widget". If you had a Venu 1 watch you would need the widget, from Venu 2+ you should only be using the full application. See https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/README.md#widget-or-application.

Please confirm you have installed the Application and not the Widget. This point will of course make no difference to your networking issue. That sounds like a DNS problem you need to solve.

In principle, if the watch is connected via Bluetooth to the phone, and the phone can see the API, then you have a working solution as per https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/TroubleShooting.md#watch-menu-and-api.

Good luck!

lMikel commented 2 months ago

I was reffering to the widget for my EDGE 830. I confirm i've installed the "Application" on the Venu 3.

Many thanks for your help, I will try to solve the problem regarding my network.

philipabbey commented 2 months ago

We have setup a DNS entry for our HA on both a public Dynamic DNS service, which points to our public dynamic IP address, and also on our LAN DNS pointing directly to the LAN IP. We also had to set up port forwarding for the public to private hop. This means when I mow over the Internet connection and sever the cable, yes I did :-(, we are still able to operate the HA instance without public Internet access.

You should be able to check your API connectivity using the script(s) at https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/TroubleShooting.md#home-assistant-api-url and also check nslookup resolves the domain name to the expected IP address.

Finally disconnect your public Internet connection (or mow over the cable?) and check your LAN setup operates between watch and HA still.

JosephAbbey commented 2 months ago

N.B. the HA companion app on your phone allows you to specify a URL to use on your home network which may be fixing it for your phone. This is not a feature we provide as we cannot detect when you are on your home network from the watch.

lMikel commented 2 months ago

Hello, it seems that this problem is related to my DNS / Reverse proxy configuration. When I changed the DNS server on my local network (in fact I had no choice, my NAS which hosted the ReverseProxy & DNS services was fried...), the Garmin VENU3 and the Garmin EDGE 830 run the applications without any problem.

I'll try to find out more as soon as I have a bit more time...

Anyway, I'd like to thank you for your time and help in resolving my problem !