HA and Tailscale - Possible to use the HA companion app when away from home?

I have configured Tailscale and I can now access my instance of HA when away from home by entering the URL that Tailscale gave me in a browser. Is it possible to also access it through the companion app?

It gives me the option to open settings, so I then tried to add a server and enter the address manually (using the tailscale provided url), it gives me a message:
“the mobile app integration is required to use the app, but it is not avalable on you Home Assistant Server”. What does that mean? I tried to add the mobile app integration to my home instance of HA, but I then get a pop up saying:
" Open the mobile app to set up the integration with Home Assistant. See documents for a list of compatible apps.".

It is just going around in circles. Am I doing something wrong, or is this not possible?

Are you setting this up while you are away or at home?

I set it all up at home.

Connect your phone to your local wifi.

Install the HA companion app and set it up. Check that it has created a mobile device in Devices & Services.

Once that is done you can edit the companion app External URL to the tailscale address.

Start the tailscale app on your phone and turn off wifi to test the remote connection.

Thanks. I had already installed the companion app and my mobile device is there (SM-S931U). But I’m not sure where to edit the app external URL. I went to Settings, System, Network and tried adding it here, but got the following error:

I tried it with \ and also http prefix, but no joy. Should I remove and reinstall the companion app?

Also, once I have it set up, do I have to run the tailscale app each time I’m away from home and want to use the HA companion app?

You add it in the companion app on your phone.

Settings → Companion App → (Your Server) → External URL

Yes.

Roger that. I was able to add it following your instructions. Once I entered my credentials, the following screen came up:

I clicked “most secure” and it is connecting with wifi turned off. Yay! I’m hoping this will also fix the automation that I had created that was based on entering my home zone.

One other question. Do you know if most people who have to use the app when away from home use this method, or do they enter their tailscale url into a browser? Is there any advantage to one over the other? If using the companion app instead of a browser, I guess it doesn’t hurt to leave tailscale always on (and unmanaged). I can always try it and see what the battery usage is.

Thank you so much!

I don’t know the relative use of Nabu Casa, DuckDNS, Cloudflare, Tailscale or other remote access methods.

I used Tailscale for a few months when I was in a place that blocked Nabu Casa. And yes that’s how I used it, with the app.

It’s interesting that it still let you use Tailscale with “Most Secure” as the setting. Tailscale does their own encryption rather than using https, so the app thinks it is using an insecure http connection.

Maybe I did something wrong, but it is working without wifi. One thing I notice is that under the companion app settings, there are duplicate instances of the server “Home” and they both have SM-S931U (my phone/device name) under them. Is that what you would expect? Also, is there a way to check whether I actually am running under “Most secure”? Mayb I hit the wrong button by mistake.

I just tried turning off tailscale (in the tailscale app) to see if it would shed some light. When I tried to connect with the companion app, it would not allow it and it shows that I do indeed have More Secure selected. BTW, I couldn’t restart tailscale (clicking on log in or the switch at the top left does nothing). I had to restart my phone…

I did none of that to be able to access HA remote via Tailscale. I have Tailscale running on about a dozen devices, one of those advertises subnet routes. So I am always connected to my home network and just use the local ip to access HA.

From what I read about subnet routes, maybe I don’t need it(?) My use case is to connect to devices in my home using my phone when away. Someday I may install it on my wife’s phone as well.

I was surprised to see tailscale used about 6% of my phones battery yesterday. And that was only after a few hours of use. But this morning it is down in the weeds so maybe that 6% was a fluke.

Remote access is still working, so thanks again! I have one more related question (but I can post a new thread, if you think I should). I cannot get Tailscale to update my location (home vs away zone). I have given the companion app all permissions and enabled high accuracy.

I can see my postion being updated within about 5 seconds when on wifi, but not when I turn it off. Even after a few minutes. And as mentioned earlier, I can access my HA instance when wifi is off. Here you can see I have funneliing enabled. Is ther anything obvious you can think of?

@lapsmith - a couple of questions:

  1. in your web browser, on your phone, when you are away and on Tailscale, what does the address to connect to HA look like?
  2. Can you share your screen of this page? The External URL should be the same as above, but there are other settings.
  1. Also what does this screen look like?
    Settings → Companion App → Manage sensors → Location sensors

The operative word here is “used”. I no longer do and so can’t do any of that sorry.

The web browser address that works when I am away looks like:
homeassistant.xxxx.yyyy-zzz.ab.net:8123

I think this is the screen shot you wanted. I have two devices. Here is the first:

I tried setting the internal url the same as external but it still didn’t work.

And here is the other (for the phone, I suppose):

I don’t know why they both have the same device name, maybe it doesn’t matter.

Here is the Location sensors screen shot:

I tried all sorts of variations of these settings, both enabled and disabled. Nothing helped. This is what the troubleshooting screen looks like (for comparison, when on wifi, it would show sent):

I’m ready to work on it, even if I have to reinstall Tailscale. But as of last night, for some reason, I can’t connect to home assistant even when home and on wifi. I read this can happen with a previous version so I tried force stopping tailscale and turning on/off airplane mode, but no joy. More likely, I changed some setting inadvertently. I do notice one difference in my admin page. Under home assistant machine, there used to be the word “connector” in blue, but now it is gone. Hopefully that is also a simple fix!

Copy that, @tom_l thanks!

OK. When you said you have 2 devices, are you saying 2 phones, or 2 HA servers? Let’s simplify the situation and compare notes,

  • I only need one server profile in the Companion app, which is also an Android
  • Check: when your phone is not on home wifi, going using mobile data, and connected to Tailscale, can you open http://100.xxx.yyy.zzz:8123, where 100.xxx.yyy.zzz being the Tailscale IP that was assigned to your HA server, from your mobile browser of your phone? Logging in OK from the mobile browser?
  • Now go back to the HA Companion app, pick one server profile.
    . Under the Home Assistant URL, let’s use http://100.xxx.yyy.zzz:8123
    . The Home network should be the SSID in your house. The companion app would know your are home, when the phone is connected to this SSID. And I hope the name would not change throughout the house.
    . The Internal connection URL would be http://192.168.1.zzz:8123
    . The Remote connection security level: let’s use “Less secure” for now, since we are not using https anywhere.
    . I have enabled all 3 toggles under the Security section of the server profile
    . Don’t know if this matters, but I do “Always” under the Persistent connection.
  • Under Manage sensors → Location, I have enabled “Location zone” also. So let’s do that.
    . BTW I didn’t enable high accuracy mode nor update interval - don’t need those for my need. For you, don’t change what you had just yet, and maybe after the connection is done inside and outside, you could revisit and turn them off and see what’s the differences they make.

Now, when you are outside, your Companion app should be able to talk to your HA server, as long as both HA server and your phone are on Tailscale. Your screenshot above, for example, is saying your HA server is on Tailscale, but your phone is not.

In the HA, if you go to Developer Tools → States , and type in device_tracker, you should now be able to see your phone in there, and the device_tracker (likely device_tracker.sm-s931u) should say home or away in the status, and should have attributes of GPS lat & lon, at this point.

I would then create a person under the Settings → People, if not already, and tie the device_tracker.sm-s931u to the person who owns the phone.

Hope this helps.

Good question, sorry for the confusion. I think I should have used the term machines, but nevertheless, I have one phone and one instance of HA.

  1. Hmm, I wonder how I got two server profiles.
  2. With no wifi and tailscale started, I can access HA from the mobile browser using only by using xxx.yyy.zzz:8123, but not if I include http://100. in front of the xxx.yyy.zzz:8123. Actually, I think I misled you regarding the format of my tailscale provided IP. I should have typed it as homeassistant.xxx-yyy.ab.net:8123. That is the format I enter in my browser and I can access HA.
  3. I picked the server named tailscale.
  • In the format you suggested, for the home assistant URL, I used http://100.xxx-yyy.ab.net:8123. (see NOTE 1 below)
  • The home network shows the SSID of my house follwed by a comma and “VPN connected”. Fortuantely, I have only one netowork in my house.
  • For the Internal connection URL, I entered http://192.168.1.ab.net:8123 thinking zzz in your example was the last part of my HA URL (didn’t work - see NOTE 2 below)
  • I used Less Secure for the security level
  • I turned on all 3 toggles in the securiy section
  • I turned on Always in the persistent connection
    Note 1: Since I couldn’t access HA with the prefex 100 in the web browser, I tried it with just homeassistant.xxx-yyy.ab.net:8123
    Note 2: And since I confused you with my incorrect format, I wasn’t sure what the zzz part of the url I should try so I tried different variations. But then I realized you probably just meant the last 3 digits of my IP address for Ha, so that’s what I did.

It still takes me to the screen that says my server settings are wrong:

But the odd thing is that even though it doesn’t connect, and I get a blank screen for 4 or 5 seconds before the above screen pops up, I do get an Android notification “Connected to Home Assistant”. So I think we are making progress!

Under manage sensors, I I turned on Location Zone. I have Minimum accuracy set to 500, but I’m not sure if that is too high as I don’t want it to conflict with what the phone can provide or other settings. I turned off high accuracy mode to be closer to your configuration. I like the high accuracy interval set to a low number, at least while troubleshooting.

I can see the SM-S931U in Developer Tools, States and it seems to coincide to when I got home this evening. But I’ve turned wifi on and off once or twice since then and it hasn’t updated. Does it use the presence of wifi to know when I’m home?

Yes, I do have myself set up as the user and as the person who owns SM-S931U. But the device_tracker.sm-s931u is not listed, if that matters.

Lastly, do you think I should delete the second server profile? I assume that is not the same thing as Machines in the Tailscale admin page. In the other profile, the Home Assistant URL and the Internal Connection URL are both my internal IP address for HA .

Thanks a bunch!

Yes, let’s simplify and keep one server profile only. You can do screenshots before you delete, just in case.

Restart both your Companion app and your HA server, also just in case.

I will toggle off the “VPN Connected” also. At least for now.

To simplify, let’s use IPv4 format in both of the URLs. So not 100.xxx-yyy.ab.net nor homeassistant.xxx-yyy.ab.net nor 192.168.1.ab.net. Only 4 sets of numbers; no alphabet.

The 192.168.1.xx address is the LAN IPv4 address of your HA server. Use that in the Internal connection URL, which has http:// in front of the IP, and :8123 after the IP.
(And should be the same as what you’d see under Local network in Settings → System → Network… For your sanity you will want to make sure this IP address would never change.)

Verify the Internal URL in your mobile browser, when your phone is on home wifi and no Tailscale.

The 100.x address came from your Tailscale admin console for the HA server. Most, if not all, of your Tailscale nodes would have the 100.x address by default. This address would be in your Home Assistant URL

Test this URL in your mobile browser first, when your phone is not on wifi, but on Tailscale.

= = sidebar = =
I understand this (http) URL would work when you are away. And there are other ways to do the same. We can revisit this later if needed.

= = sidebar 2 = =
I wouldn’t know whether 500 being too high or not in your situation / where you live, but probably too high. After we have got the remote connection going, you can run a series of tests and see if higher or lower would work any better.

= = sidebar 3 = =
When you see SM-S931U in Developer Tools, is there a (or a couple of) HA entity that starts with “device_tracker”…? If so, you should be able to see how any of the device_tracker tracks, via the “source_type” attribute. Some of my device_trackers are of gps type, others are of router type. They do not simply use the presence of wifi, or I should say, they do not scan SSID around your phone.