A few months back, I show you how to install Home Assistant using the Hassbian installation, which was a simple method to set it up in a Raspberry Pi. Today, I want to show you how to set up Home Assistant using the Hass.io installation, which is an easier method to set up Home Assistant.
This article is part 1 of a series of articles that I would make about Home Assistant based on the Hass.io installation. In future articles, I would cover how to set up a remote connection using DuckDNS so you can access home Assistant from anywhere. We’ll also be exploring other available add-ons for Hass.io, for example, the Node-RED add-on which I’m excited to start using with Home Assistant. And, I would also be bringing other projects where I’ll show you how to automate and control different things around your home using Home Assistant, Google Home, IFTTT, Node-RED and much more.
Step 1: Install the Hass.io image in a microSD card
The first thing that we need to do is download the latest version of Hass.io from the Home Assistant website. Then, insert the SD card into the computer, and use Etcher to copy the image to the SD card. Click on Select Image. Search and select the Hass.io image. Click on Select Drive and choose the SD card. Lastly, click on Flash and give it a few minutes for the process to complete.
Step 2: Configure the WiFi settings (Optional)
If you are connecting the Raspberry Pi via WiFi instead of an Ethernet cable, after the Hass.io image is copied to the SD card, you can open the resin-boot drive, click on system-connections and select the resin-sample file. You can open it using just the regular notepad in Windows, or you can use a text editor like Atom. Enter your WiFi name under SSID and the WiFi password under PSK.
[connection] id=resin-sample type=wifi [wifi] hidden=true mode=infrastructure ssid=My_WiFi_SSID [wifi-security] auth-alg=open key-mgmt=wpa-psk psk=super_secret_wifi_password
Save the file, unmount the SD card from the computer, insert it into the Raspberry Pi and power on the Pi.
Once the Pi boots, go to hassio.local:8123. If the Pi connected to the WiFi with no problem, you would get a page with the Home Assistant Logo in the middle. Give it a few minutes for the latest version of Home Assistant to install and then refresh the page.
Step 3: Install the Configurator add-on
After Home Assistant loads for the first time via hassio.local:8123, we can install the Configurator add-on which allows us to access the configuration files directly from the Home Assistant web interface.
On the left side, click on Hass.io. Then go to Add-on Store and select Configurator. Click on Install and give it a couple of minutes. Once the installation finish, set up a username and a password so you can protect access to the Home Assistant configuration files. Make sure that the username and password are between quotation marks “ ”. For the SSL, leave it set to false for now but, if you set up remote access, which we will cover in the next article, you will need to set it to true.
{ "username": "Admin", "password": "Password", "certfile": "fullchain.pem", "keyfile": "privkey.pem", "ssl": false, "allowed_networks": [ "192.168.0.0/16" ], "banned_ips": [ "8.8.8.8" ], "banlimit": 0, "ignore_pattern": [ "__pycache__" ], "dirsfirst": false }
When finished, click on Save and then Start to enable the Configurator add-on. Scroll down and check the Log to make sure that activation went well. If no errors are showing in the Log, then the setup went well, and the add-on is now enabled.
To access the Home Assistant files via the Configurator, click on Open web UI. Another tab opens where you have to sign in with the new username and password that you created. After you sign in, you will have access to the configuration.yaml file and to access the other files, click on the Folder icon on the top left side of the window.
Step 4: Setup a password for the web interface
Now that you have access to the configuration.yaml file, set up a new password for the Home Assistant web interface. Under HTTP, we have the line # api_password. Remove the hash “#” at the beginning to activate the line and type a new password.
Step 5: Add a shortcut for the configurator on the side menu
We also want to add a shortcut for the configurator on the side Menu in Home Assistant, allowing us to quickly access the Configurator add-on directly from the Home Assistant frontend. To do this add the following to the configuration.yaml file.
panel_iframe: configurator: title: Configurator icon: mdi:wrench url: http://hassio.local:3218
Then, to save the changes, click on the Save icon at the top. To restart Home Assistant, you can click on the Menu icon on the top right and then click on Restart Hass.
Give it a minute and then refresh the Home Assistant page. You will be asked to enter the new Home Assistant password that you set up in the configuration.yaml file. After you log in, you can see that a new configurator shortcut was added to the side menu in the Home Assistant frontend.
Step 6: Set up Samba
Even though you set up the Configurator to access the Home Assistant files directly from the Home Assistant web interface, you still have the option to set up Samba so you can access the files directly from a computer and edit them using any text editor of your choice. For example Notepad++ or Atom. To set up Samba, Go to the Hass.io tab, then Add-on store, select the Samba share add-on and then click on Install.
Under Config, you can set up a few things. If you have your local computer set up with a specific WorkGroup name, you can specify it here. Otherwise, the default is WORKGROUP. You can also change the shared folder’s name which is set up by default to Hassio. Guest mode, you want to have it disabled so no one can access it without a username and password. Under map, you have 5 different folders that you can select to see in the shared folder. If you want to disable one of them, you can change it from true to false. Set up a username and password, so the Shared folder is secured. Remember to enclose them with quotation marks “ ”. Now for the interface, if you have your Raspberry Pi connected to your router with an Ethernet cable, set it to eth0. If it’s connected via wireless, set it to wlan0.
{ "workgroup": "WORKGROUP", "name": "Hassio", "guest": true, "map": { "config": true, "addons": true, "ssl": false, "share": true, "backup": true }, "username": "admin", "password": "password", "interface": "" }
When finished, click on Save and then Start to enable the Samba share add-on. Check the Log below to make sure that everything went well. If the Log shows that the setup was successful, open Windows Explorer on your computer, then go to Network and refresh the page.
How to manually map samba shared folders
If for some reason the shared folder doesn’t come up, you can always manually map the folders. To do that, right, click on Network and select Map Network Drive. Now type \\HASSIO\config and then click on Finish. Because it is the first time accessing this folder, you will need to log in with the username and password that you created in the Samba share add-on. Go back to This PC, and you will see the new Config shared folder. To see the other shared folders do the same steps and enter the name of the specific folder at the end of the path (e.g., \\HASSIO\backup, \\HASSIO\addons, \\HASSIO\share).
All right, I’m going to leave it here for now. On the next article, we are going to set up remote access using DuckDNS, so definitely stay tuned for that. If you are new to my YouTube channel, be sure to subscribe and hit the bell button so like that you get notified when I upload new videos, so you don’t miss anything.