Step 12: External

Just because this is a cloud free setup does not mean that you won’t be able to access your system while you are out and about. Problem is, depending on your requirements and budget, there are a plethora of ways to achieve this.

So, lets look at two base options: domain name with a static (or relatively) IP address and the dynamic dns option. After that you can choose between direct firewall access to port 8123 or push through a reverse proxy, don’t worry Home Assistant can help with lots of this.

Ultimately, you want to be able to login to your home Home Assistant system via the mobile app or browser to manage and monitor your home.

  • Domain Name
    • get an awesome domain name with a basic DNS
    • point the domain at your home IP address with an A record
    • prove you can access http://<domain>:8123
  • Dynamic DNS
    • get a duck dns account
    • install duckDNS via the Supervisor:
      • Supervisor -> Add-on Store
    • configure with token and subdomain
      • here you can use the LetsEncrypt option but don’t if you choose to go for the reverse proxy
    • prove you can access http://<subdomain>.duckdns.org:8123

Now the question of the reverse proxy, if you run multiple services/domains you will probably benefit from having a single entry point to proxy all web requests through, otherwise all it will seem is that you are hiding the port number from the web address.

  • No proxy
    • done – nothing else to do!
  • Proxy
    • install Nginx Proxy Manager via the Supervisor:
      • Supervisor -> Add-on Store
    • configure with domain/subdomain
    • add LetEncrypt SSL and email address
    • save and wait for the SSL setup to complete
    • prove you can access: https://<domain> or https://<subdomain>.duckdns.org

Now the mobile app can report back to your own server over a HTTPS connection your phones location, battery level and WiFi connection name – all things you can base automations from!

Next: Step 13: Moremation

Step 11: Automation

So, you finally have all the building blocks for automation: a sensor to activate a switch or set of switches.

The original initial goal of this blog was to setup a cloud free home automation system, this got extended with the ability to control the lights a house without ever manually having to switch them on or off.

This is starting to be achievable! If you only have the one sensor then you will only be able to control one room, but the principles will be exactly the same.

There are example automation scripts that can do this, but lets build our own simple one. Please bear in mind that the setup described will only work with one actor i.e. one person within the home.

First you’ll need to start a new automation script via the big plus button within the automation configuration section.

Configuration -> Automations -> +

Give it a suitable name like “lounge lights” or whatever is appropriate, and set the motion sensor as a trigger event and then add a condition on the sensors luminance to ensure it is dark enough to warrant triggering the lights.

Then add all the light switches/devices that you want to turn off – such as all the ones outside of the room where the motion sensor for the trigger is – and then also add the lights switches/devices that you want to turn on as actions at the bottom of the automation screen.

Another option here is to call the scene.turn_on service and have a scene setup with the lights you want turning on. Unfortunately with this setup you do not want to simply create an all lights off scene and add that too as every-time motion is detected all the lights will turn off then the ones you want on will turn back on, so you want to set it as described to stop potential light flickering or make a collection of scenes – one for each room to control.

There are tons more automations capable and there will be a couple more covered in this stride, but first you will need to be able to access your system via the mobile app out and about for some real fun…

Next: Step 12: External