Home Assistant is a free and open-source smart home ecosystem with near-limitless potential. Unlike proprietary systems from Apple, Google, and Amazon, Home Assistant lets you build more complex automations and use unique combinations of devices to do so much more.
Setting up a Home Assistant server isnât quite as simple as logging into your Google or Amazon account or buying a HomePod. Hereâs how to set everything up on a Mac.
Related
What Is Home Assistant? And Why Isnât Everyone Using It?
Get to know this open-source locally-controlled smart home platform.
Setting Up Local Remote Access
The Mac mini makes a perfect Home Assistant server for a few reasons, not least the fact that itâs cheap, quiet, in plentiful supply on the used market, and can fit just about anywhere. That last point is an important one since it allows you to put your Home Assistant server anywhere you like, without having to worry about attaching a monitor. That said, you can do this on a MacBook (or any other kind of Mac) too, if you have a spare one lying around.
Iâll be running through this setup process on a headless Mac mini, which means itâs a Mac mini thatâs not connected to a screen thatâs on. In reality, this is the same Mac mini that Iâll be using as a media center (and server). Being able to complete the bulk of the setup remotely and perform any admin duties from my MacBook Pro rather than turning the TV on is much more convenient.
So the first thing Iâll be doing is enabling remote access from local devices using Appleâs built-in VNC server. Ironically, this requires that your Mac mini be connected to a display so you can set everything up.
On the Mac mini weâll be using as a Home Assistant server, head to System Settings > General > Sharing > Remote Access and click the âiâ button next to it. I personally opened up the floodgates here as itâs just my personal network, and I wanted to be able to configure my server from pretty much any device.
First, turn on âRemote Managementâ and enable âAnyone may request permission to control screenâ and âVNC viewers may control screen with passwordâ and then set a password. Now click âOptionsâ and enable additional settings like âObserveâ and âControlâ along with anything else you want to do. Click âOKâ and then âDone.â
You can now access the machine using a VNC viewer on the same network, like the one thatâs already built into macOS. Launch Finder and then hit Command+K (or Go > Connect to Server). Now type in the address of the machine on your local network. Youâll find this under System Settings > Sharing > Local hostname on the machine youâre hoping to access.
My Mac mini is simply called âTimâs Mac miniâ so to access it, I typed vnc://Tims-Mac-mini.local and hit Enter. All of a sudden, I have local access!
Create a Virtual Machine in VirtualBox
Weâll be running Home Assistant within a virtual machine that stays active on your Mac 24/7. The easiest way to do this is using VirtualBox, which now has both Intel and Apple silicon versions. The first step is to download the correct version from the VirtualBox downloads page.
Not sure which version to get? On your server Mac click Apple > About This Mac. If you see âAppleâ listed under the âChipâ field then youâll need the âApple Silicon Hostsâ version. If you see âIntelâ then get the âIntel Hostsâ version.
Once the app has been downloaded, open the DMG you downloaded and install the software by running the PKG file.
Related
Virtualbox Now Runs on Apple Silicon, Hereâs What Works (and What Doesnât)
Mac users finally have another free virtualization option to choose from.
Before running the app, we can save ourselves a bit of time later by opening up System Settings > Privacy & Security > Accessibility and dragging the âVirtualBoxâ icon from Applications into the settings window. Now do the same for System Settings > Privacy & Security > Input Monitoring, authenticating as necessary. This will make it easy to use your mouse and keyboard within the Home Assistant virtual machine without restarting it, should you need to.
Now open the VirtualBox app in your Applications folder, and at the top of the screen in the menu bar click Machine > New. A new window will open using which you can give your virtual machine a name (I chose âHome Assistantâ). Leave the .ISO field blank and make sure that the âTypeâ is set to âLinux,â the âSubtypeâ is set to âOracle Linux,â and the âVersionâ is set to âOracle Linux (ARM 64-bit).â
Hit âNextâ and set up your virtual machineâs hardware configuration. Home Assistantâs minimum recommendations are 2048MB of RAM and 2 virtual CPU cores, which is what Iâm using here. You should also make sure the âEnable EFIâ box is checked or your machine wonât boot. Click âNextâ again.
Now itâs time to set up the virtual drive. We wonât be creating a drive, but downloading one instead. Head to the Home Assistant macOS setup page and download the relevant VirtualBox image (either an Intel or Apple silicon VMDK file). Once downloaded, move the file to a suitable location (youâll be relying on this, so donât leave it in your Downloads folder).
Now go back to VirtualBox, select the âUse an Existing Virtual Hard Disk Fileâ option, and click the file icon next to the box followed by âAddâ to locate the file you just downloaded and then select it. Lastly, hit âNextâ followed by âFinish.â
Thereâs just one setting we need to change to make sure your Home Assistant server has a network connection. Right-click (Control-click) on the virtual machine you created in VirtualBox, then click âSettings.â Under âNetworkâ use the âAttached toâ drop-down to select âBridged Adapterâ then choose the relevant network interface under âName.â I picked âen1â as thatâs the Wi-Fi connection Iâll be using, if your server is connected via Ethernet this is likely âen0â instead.
You can find out which hardware refers to which identifier by running the following command in Terminal (on your server):
networksetup -listallhardwareports
Click âOKâ to save your settings. The nitty-gritty is done!
Setting Up Home Assistant
Now itâs time to run your virtual machine within VirtualBox by selecting it and clicking âStart.â Youâll see your server spring to life, just let Home Assistant get going and do its thing. Eventually, youâll see a success message like the one below along with some URLs and IP addresses that will come in handy.
As noted, you can head to homeassistant.local:8123 or use the IP address of the local machine from any computer on your local network. Try it now and you should see a screen like this:
Youâll see that Home Assistant is still getting everything ready. Let it do its thing for around 20 minutes. Refresh the page until you see the âCreate My Smart Homeâ button. Once everything is ready, power off your virtual machine and launch the Terminal app on your server.
We need to run the following command in order to tell the machine to use the discard command to automatically shrink the drive to free up space (something that doesnât happen automatically by default):
VBoxManage storageattach âstoragectl âSATAâ âport 0 âdevice 0 ânonrotational on âdiscard on Replace with the name of your VM, and âSATAâ with the type of storage your machine uses. For me, the machineâs name was Home Assistant, which requires a backslash in order to indicate a free space within the command, so I typed Home\ Assistant instead.
For the type of storage, which you can find listed in the VirtualBox virtual machine settings, Iâve used VirtioSCSI instead. So within Terminal, I ran the following command:
VBoxManage storageattach Home\ Assistant âstoragectl âVirtioSCSIâ âport 0 âdevice 0 ânonrotational on âdiscard on If you see an error about the name or the type of storage, youâll know youâve got something wrong. If you donât see an error and the command returns nothing, it worked.
The Finishing Touches
Last but not least, I recommend installing free app Amphetamine to keep your server awake. This will ensure that your Home Assistant installation is always running and available in the background, otherwise it will cease working whenever your Mac goes to sleep.
Related
12 Single-Purpose Mac Apps I Couldnât Live Without
Apps that do one thing well, rather than trying to do it all.
With the app downloaded and running, click on the Amphetamine logo in the menu bar at the top-right corner of the screen. From here, click âIndefinitely.â Click Amphetamine again followed by âSettingsâ and enable all of the âLaunch and Wake Behaviorâ checkboxes so that Amphetamine starts up when your Mac does and triggers a session.
Move to the âSession Defaultsâ tab and make sure âDefault Durationâ is set as âIndefinitelyâ and enable the âAllow display sleepâ option if relevant. Youâre now done and can close the VNC session if you like.
Now the Fun Begins
Now itâs time to actually set up your smart home. Launch a web browser from your device of choice (thatâs on the same local network) and head to homeassistant.local:8123 in a web browser. As long as you see the blue setup button, youâre good to go.
Click on it and start creating your smart home by setting up a user, setting a home location, and deciding whether you surrender analytic data. Eventually, Home Assistant will report any compatible devices and dump you on the dashboard.
Use the âSettingsâ menu to find integrations, add other devices, map out your home with zones, build complex automations, and much more.
If youâve followed along, you now have a working Home Assistant server on your Mac mini (or another Apple computer, thereâs nothing inherently specific to the Mac mini here). Now itâs time to dig into whatâs possible, including complex Home Assistant automations, adding smart speakers to your smart home server, and even using an old tablet like an iPad as a dashboard.

