My desire is to get seamless switching between nabucasa and the local URL without any additional user intervention. When I move from my home network into the world and back the app never automatically switches the URL being utilized. Once I get a successful connection to either the external or internal URL it seems to be good until I need to switch between the URLs. To get the nabucasa connection to work I have to disable “Prioritize Internal URL” in the companion app. To get the local connection to work I have to enable “Prioritize Internal URL”. This works when switching from between the URLs but not 100% of the time. Sometimes when I’m in the process of switching remote and local access I get the following error in my homeassistant.log error:
2022-01-20 16:40:44 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.10.60 (192.168.10.60). (HomeAssistant/Android Pixel 5a 2022.1.1-full)
It seems like closing the app help with getting a connection after the home/not_home switch happens. That is after I change the state of “Prioritize Internal URL”.
I’m using a simple ping tracker to tell if I’m on the local network or not. When it indicates I’m home I use an automation to disable nabucasa. When it indicates I’m not_home I use an automation to enable the nabucasa connection. For testing I simple enable and disable the wifi on the phone and the ping tracker detects home and not_home.
Prior to bring nabucasa into the picture, I had HA set up for some time using duckdns to support https and the associated cert. Remote access was really just local access via openvpn. I just introduced nabucasa into the mix.
Am I correct that the app is supposed to allow seamless transition between home and away, with switching between nabucasa and the local URL? Any thoughts on how I fix the authentication error? Finally any suggestion on how to get a seamless transition between home and away?
UPDATE: In the HA GUI under the users profile I deleted all refresh tokens. I then reinstalled the app on my phone. It’s only been about 20 minutes of testing with 6 switches between home and away, but it now seems to be working. I’m not sure how it got in the strange condition and hopefully it things will not fall back into the same state in the future.