Tag: home automation

  • How to Access Home Assistant Remotely with Tailscale on a NAS (No Port Forwarding Required)

    How to Access Home Assistant Remotely with Tailscale on a NAS (No Port Forwarding Required)

    One of the biggest things I wanted after setting up Home Assistant was reliable remote access.

    At first, I assumed this would be simple. Install Home Assistant, install the mobile app, sign in remotely somehow, and that would be the end of it.

    The deeper I got into self hosting though, the more I realised remote access is one of those areas where things become complicated surprisingly quickly. Every guide seemed to recommend something different, from opening ports on the router to setting up reverse proxies, SSL certificates, Cloudflare tunnels and domain names.

    None of those things are inherently bad, but when you are still building your understanding it becomes difficult to know what is actually necessary and what is just adding complexity.

    There was another factor as well: subscriptions. I completely understand why Home Assistant Cloud exists and for many people it is probably the right solution. But like a lot of people these days, it feels as though everything wants a monthly fee.

    I was not trying to avoid spending money entirely. I just wanted to see if I could achieve reliable and secure remote access using the hardware and software I already had, without exposing Home Assistant directly to the internet while I was still figuring things out.

    That is what led me to Tailscale. It gave me a way to get remote access working without turning it into a much bigger networking project.

    My setup

    For reference, this is the setup I am currently running.

    The NAS itself is a UGREEN NASync DXP2800 running Docker containers for both Home Assistant and Tailscale. If you’re interested in the hardware itself, I covered my experience in my  UGREEN NASync DXP2800 Review After 2 Months.

    There is no port forwarding, no reverse proxy, no public Home Assistant exposure, and no Home Assistant Cloud subscription.

    That probably sounds restrictive at first, especially if you spend enough time reading forums where people are building very advanced setups. But honestly, that was exactly the point.

    Despite working in IT, I did not want this to become a project that required constant maintenance. I wanted something that was secure, made sense, and just worked day to day without needing to be constantly revisited.

    Just because a solution is more advanced does not automatically make it better for your situation. For me, the goal was not to build the most complex setup possible. It was to build one that was secure, reliable, and easy to live with long term.

    That is what pushed me towards Tailscale.

    Why I chose Tailscale

    The biggest reason was simplicity, not because the alternatives were beyond me, but because I was trying to solve a specific problem rather than build a networking project.

    There are plenty of ways to provide remote access to Home Assistant. You can use reverse proxies, SSL certificates, Cloudflare tunnels, domain names, port forwarding and various other combinations depending on how much control you want.

    The problem is that every additional layer becomes something else to configure, secure and maintain.

    For some people that is part of the hobby, and there is nothing wrong with that. For me, the goal was simply to access Home Assistant securely when I was away from home.

    Tailscale felt like a very clean solution to that problem. Instead of exposing Home Assistant publicly and then protecting it afterwards, it creates a private encrypted network between devices you already trust.

    In practice, that meant my phone could communicate directly with my NAS without Home Assistant ever being exposed to the public internet.

    That shift in approach made everything much easier to reason about. I was not publishing a service and securing it, I was extending a private network.

    For a home setup, that balance between simplicity, security and reliability was hard to ignore.

    The benefit I was not expecting

    When I first started looking at remote access, I was focused almost entirely on Home Assistant. The goal was simply to be able to open dashboards and make sure automations worked when I was away from home.

    What I did not really think about at the time was that I was solving a much bigger problem.

    Once Tailscale was working, Home Assistant was only one of the things I could access remotely. I also had other services running on my NAS, including my Recipe App and Home Dashboard. Several of these are applications I discussed in my  Docker Containers I Still Use One Year Later article, and Tailscale effectively gave me secure remote access to all of them at the same time.

    That was the point where it clicked. Tailscale stopped feeling like a Home Assistant tool and started feeling like part of the underlying infrastructure of my home network. The more services I added locally, the more useful it became.

    The Home Assistant benefits were still significant. Presence detection became more reliable, location updates worked more consistently, and geofenced automations behaved the way I expected them to.

    But the bigger takeaway was that I only needed to solve remote access once. Every service I run now, and anything I add in the future, can use the same setup.

    Before you start

    This guide assumes you already have Home Assistant running and accessible on your local network.

    If you are starting from scratch, make sure you can access Home Assistant locally first, for example:

    http://192.168.x.x:8123

    Do not move on until this works reliably. Otherwise you end up troubleshooting multiple things at once.

    Checking Home Assistant locally

    Before adding Tailscale, confirm Home Assistant is actually listening on port 8123.

    sudo ss -tulpn | grep 8123

    You should see Home Assistant (usually as python3) listening on that port. If not, fix that first.

    Installing Tailscale in Docker

    Tailscale running as a Docker container on a UGREEN NAS alongside other self-hosted applications.
    Tailscale running as a Docker container on my UGREEN NAS.

    Install Tailscale as a Docker container on your NAS.

    docker pull tailscale/tailscale:latest
    docker run -d \
    --name=tailscale \
    --hostname=nas \
    --network=host \
    --cap-add=NET_ADMIN \
    --cap-add=NET_RAW \
    -v tailscale-data:/var/lib \
    tailscale/tailscale:latest

    Check the logs to get the authentication link:

    docker logs tailscale

    Open the URL shown, sign in, and approve the device.

    Make sure to click this link right away, as Tailscale login URLs expire after a few minutes. If it has expired, simply restart the container or re-check the logs to generate a new one.

    Note: In this example, Tailscale stores its configuration in a Docker named volume called tailscale-data. If you prefer to keep your container data in a specific folder for easier backups or management, you can replace the named volume with a local path that suits your environment.

    For example:

    -v /path/to/tailscale-data:/var/lib

    The exact location will depend on your operating system, NAS, or Docker setup.

    Verify the connection:

    docker exec -it tailscale tailscale status

    Setting up Tailscale on your phone

    Tailscale mobile app showing connected devices and assigned tailnet IP addresses.
    The Tailscale app lets you confirm your devices are connected and quickly find your NAS Tailscale IP address.

    Installing Tailscale on the NAS is only half of the setup. You also need it running on the device you actually want to connect from, which in my case is my iPhone.

    Download the Tailscale app from the App Store and sign in using the same account you used to authenticate the NAS. Once signed in, your phone will appear in your Tailscale admin console alongside your NAS.

    At that point, your phone is part of the same private network. Your phone is no longer “connecting into” your home network, it is effectively part of it.

    One useful thing is that the Tailscale app shows all connected devices and their assigned IP addresses. That means you can quickly check your NAS Tailscale IP directly from your phone without needing to SSH in.

    This is useful when setting things up or troubleshooting because you can confirm:

    • your NAS is online
    • your phone is connected to the tailnet
    • the correct Tailscale IP is being used

    Finding the Tailscale IP

    Get the Tailscale IP:

    docker exec -it tailscale tailscale ip -4

    You will get something like:

    100.x.x.x

    Use that to access Home Assistant remotely:

    http://100.x.x.x:8123

    This uses HTTP, not HTTPS. Tailscale already encrypts the connection, so forcing HTTPS here will break things.

    Configuring the Home Assistant Companion App

    Home Assistant Companion App server settings showing internal and external URL configuration.
    Directly after “Configuring the Home Assistant Companion App” and before you explain Internal vs External URLs.

    In the Home Assistant Companion App, you need to set the Internal URL and External URL.

    On iPhone, open the app and go to:

    Settings → Companion App → Server Settings

    (If you have multiple servers configured, tap your server first, then open Server Settings.)

    Use your local IP for Internal URL:

    http://192.168.x.x:8123

    Use your Tailscale IP for External URL:

    http://100.x.x.x:8123

    Both should use HTTP. Tailscale already encrypts the connection, so you do not need HTTPS here.

    Once set, back out of the menu and give the app a few seconds to reconnect. If everything is correct, it should connect both on WiFi and over Tailscale without any errors.

    VPN On Demand on iPhone

    One thing I highly recommend enabling is VPN On Demand inside the Tailscale app.

    Enable it for both WiFi and cellular so the connection is automatic. That way you do not need to remember to manually connect before opening Home Assistant.

    This makes the whole setup feel much more seamless day to day and also improves reliability for things like presence detection and geofenced automations because your phone maintains a consistent connection back to Home Assistant.

    The issue that caused the most confusion

    The biggest problem I hit was not Home Assistant. It was Tailscale Serve taking over port 8123.

    sudo ss -tulpn | grep 8123

    If you do not see Home Assistant on that port, something else has taken it.

    Fix it with:

    tailscale serve reset

    Hardware I Use

    Before I wrap up, a quick note: some of the links below are Amazon affiliate links. If you choose to purchase through them, I may earn a small commission at no additional cost to you. I only recommend products I personally use or have hands-on experience with.

    The software in this guide is free, but if you’re curious about the hardware behind my setup, this is what I currently use:

    I’ve been using this setup for Home Assistant, Docker containers, remote access through Tailscale, and various self-hosted projects. If you’re building something similar, these are the components I have the most hands-on experience with.

    Final thoughts

    Tailscale ended up being one of the most useful additions to my setup, not because it was flashy, but because it removed friction.

    Once it was configured, I stopped thinking about remote access entirely. Combined with a stable home network, which I discussed in  What Actually Happens on Your Network (Why WiFi Feels Inconsistent), it became one of those rare pieces of infrastructure that simply fades into the background and does its job.

    There are more advanced ways to achieve the same result, and for some setups they will make sense. But for me, this struck the right balance. It solved the problem I actually had without introducing more moving parts to maintain.

    Looking back, that was the biggest win. Not just remote access, but a simple foundation I can keep building on without having to rethink it every time I add something new.

  • Smart Home Network Setup: 7 Best Practices for Connectivity & Security

    Smart Home Network Setup: 7 Best Practices for Connectivity & Security

    Introduction

    Ever had your smart light take ages to turn on? Or your security camera lose connection at the worst time? A poorly optimized smart home network is the hidden culprit behind these daily frustrations.

    A smart home setup can make life more convenient, energy-efficient, and secure, but only if your network is built to handle the demands of multiple connected devices. A poorly configured network can lead to slow performance, security vulnerabilities, and connectivity issues.

    This guide walks you through how to set up a smart home network, ensuring reliable connectivity, security, and efficiency—without needing expensive upgrades.


    1. Planning Your Smart Home Network

    Before connecting devices, it’s important to assess your network’s capabilities:

    • How many devices will be connected? Smart homes can range from a single device to an entire ecosystem of interconnected gadgets.
    • What are your bandwidth needs? Streaming 4K content or running security cameras requires more bandwidth than smart lights and sensors.
    • Where will devices be placed? Some devices (e.g., outdoor cameras) may struggle with weak Wi-Fi signals.

    Action Steps:
    ✅ Check your router’s device limit and bandwidth capabilities.
    ✅ Consider a separate network for smart devices (more on this below).
    ✅ Identify Wi-Fi dead zones that may need signal improvements.


    2. Smart Home Devices & Network Requirements

    Not all smart devices have the same network needs:

    • Low-bandwidth devices (e.g., smart bulbs, plugs, sensors) work fine on 2.4 GHz Wi-Fi.
    • High-bandwidth devices (e.g., cameras, smart speakers, streaming devices) benefit from 5 GHz or wired connections.
    • Latency-sensitive devices (e.g., video doorbells, smart locks) require strong, stable signals to work instantly.

    Action Steps:
    Use 5 GHz Wi-Fi for devices that need fast data transfer (smart TVs, security cameras).
    Use wired Ethernet for mission-critical devices like home security hubs and smart speakers.
    Place routers or mesh Wi-Fi nodes near bandwidth-heavy devices.

    Comparison of 2.4 GHz and 5 GHz Wi-Fi bands, showing ideal device connections.

    3. Setting Up a Dedicated Smart Home Network

    Many routers allow you to create a separate network just for smart devices. Why?

    • Prevents smart home devices from interfering with personal computers and smartphones.
    • Improves security by isolating smart devices from sensitive data.

    Best Options:

    • Guest Network: If your router has this feature, enable it and connect all smart devices to it.
    • VLAN (for Advanced Users): If your router supports VLANs, you can segment smart home traffic from personal devices.

    Action Steps:
    ✅ Create a separate SSID (Wi-Fi name) for smart home devices.
    Disable remote access for devices that don’t need it.
    ✅ Set up static IPs for key smart home devices (ensures a stable connection).

    A segmented home network with IoT devices isolated from personal devices for security.

    4. Securing Your Smart Home Network

    Since smart home devices are common hacking targets, it’s crucial to secure them properly.

    Key Security Measures:

    • Change Default Passwords – Many smart devices ship with weak, easy-to-guess passwords.
    • Enable WPA3 Encryption – If your router supports WPA3, use it for better security (otherwise, use WPA2).
    • Regularly Update Firmware – Many vulnerabilities come from outdated firmware.
    • Disable Unused Features – Turn off WPS (Wi-Fi Protected Setup) and UPnP (Universal Plug and Play), as they can be security risks.
    • Use Two-Factor Authentication (2FA) – Many smart home platforms offer 2FA for added protection.
    A checklist of essential cybersecurity steps to secure home networks and smart devices.

    Action Steps:
    Rename SSIDs (avoid using your last name or home address).
    Update device passwords to something unique and strong.
    Enable automatic firmware updates for all devices.
    ✅ Set up 2FA for smart home apps (Google Home, Alexa, etc.).


    5. Optimizing Smart Home Performance

    Even with a strong network, smart home devices can sometimes experience lag or disconnections. Here’s how to improve performance:

    • Reduce Wi-Fi Interference – Use router settings to switch to less crowded channels.
    Wi-Fi coverage heatmap before and after optimizing network with an access point.
    • Use Mesh Wi-Fi or Wi-Fi Extenders – For large homes, a mesh system can help eliminate dead zones.
    • Monitor Your Network – Use router admin tools or apps to see which devices are using the most bandwidth.

    Action Steps:
    ✅ Run a Wi-Fi analysis tool (like NetSpot or your router’s app) to find congestion.
    Reposition smart home hubs and routers for better signal strength.
    Limit background bandwidth use on streaming devices during peak hours.


    6. Smart Home Automation & Integration

    Now that your network is optimized for speed and security, let’s explore how to maximize your smart home’s potential with automation.

    Infographic depicting smart home automation routines with geofencing and scheduling.

    Examples of Smart Home Automation:

    • Geofencing: Lights and thermostat adjust when you leave home.
    • Schedules & Routines: Automate lights, blinds, and coffee makers.
    • Voice Commands: Control devices using Google Assistant, Alexa, or Apple HomeKit.
    • Sensor-Based Automation: Motion sensors trigger lights or security cameras.

    Action Steps:
    ✅ Set up routines in Alexa, Google Home, or Apple HomeKit.
    ✅ Enable geofencing for smart lights & thermostats.
    ✅ Experiment with motion-based triggers for security.


    Conclusion: Building a Smart & Secure Home Network

    Your smart home is only as good as the network it runs on. With these steps, you’ll enjoy faster connections, better security, and smoother automation. Ready to take the next step? Stay tuned for my guide on smart home automation!


    📌 Coming Soon: “Intro to NAS & Network Storage: Why You Should Consider It” 🚀