members
Raspberry basics: Project 29a Raspberry PI 3 model B board - Home assistant for beginners
of Acoptex.com in Raspberry Pi 3
Raspberry basics: Project 29a
Project name: Raspberry PI 3 model B board - Home assistant for beginners
Tags: Raspberry, Raspberry PI 3 model B board, vers 1.1, v 1.1, Home assistant, how to intstall home assistant, easy way
Attachments: configuration.yaml
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
1.Raspberry PI 3 model B 1 pc
2. Micro SD card and SD card adapter 1 pc
3. Micro USB power supply (2.1 A, max 2.5 A) 1 pc
4. USB keyboard 1 pc
5. USB mouse 1 pc
6. TV or PC monitor 1 pc
7. HDMI cable 1 pc
General
We will learn about Home Assistant, how to set up Home Assistant.
Home Assistant is an open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Home Assistant is running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.
Home Assistant supports 895 different components.
We are going to install Home Assistant on Raspberry Pi 3 model B.
Understanding the Raspberry PI 3 model B
The Raspberry Pi 3 is the third-generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016.
Specification:
- Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
- 1GB RAM
- BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
- 40-pin extended GPIO
- 4 USB 2 ports
- 4 Pole stereo output and composite video port
- Full size HDMI
- CSI camera port for connecting a Raspberry Pi camera
- DSI display port for connecting a Raspberry Pi touchscreen display
- Micro SD port for loading your operating system and storing data
- Upgraded switched Micro USB power source up to 2.5A
Signals and connections of the Raspberry PI 3 model B
Step by Step instruction
We recommend using a high-performance SD card for increased stability as well as plugging your device into an external display to see the default application booting up.
We assume that you have Windows 10 installed on your PC and empty micro SD card with SD card adapter.
1. Installing Hass.io
- Insert micro SD card in SD card adapter. We recommend at least a 32 GB SD card to avoid running out of space.
- Insert SD card adapter to SD card reader in your PC or attached with cable to your PC' USB port.
- Go to home-assistant.io website and select the image for your device: Raspberry Pi 3 Model B and B+ 32bit (recommended), Raspberry Pi 3 Model B and B+ 64bit.
- We choose the Raspberry Pi 3 Model B and B+ 32bit image.
- Go to etcher.io website and download the Etcher on your PC for your OS (We have Windows 7 64 bits OS)
- When downloading completed, open Etcher (double-click on balenaEtcher-Portable-1.5.51.exe file) and click on Select image. Choose the image you’ve previously downloaded, for example we had hassos_rpi3-2.12.img.gz. Select the SD card and click on Flash! button. Please note that SD card must be formatted before doing this step. Wait a few minutes while Etcher flashes the image on the micro SD card.
- Make sure that Raspberry PI 3 switched off.
- Insert the micro SD card with image to your Raspberry Pi 3 board.
- Connect Raspberry PI 3 board HDMI port and to your TV or Monitor HDMI port with HDMI cable.
- Connect an Ethernet cable to LAN' port of Raspberry Pi 3 board.
- Make sure that your monitor or TV is turned on, and that you have selected the right input (e.g. HDMI 1, etc).
- Plug in your USB mouse and USB keyboard to Raspberry PI 3 USB ports.
- Connect Micro USB power supply to Raspberry PI 3 board micro USB input.
- After a few minutes you should be able to access Home Assistant user interface from any device on the same local network.
- We need to find the IP address of our Raspberry Pi. You can check for new device on our router (look for hassio) or use the advanced IP scanner which you can download on advanced-ip-scanner.com website.
- You can access home assistant on any PC/laptop/smartphone connected to the same local network. Type in any internet browser http://your-raspberrypi-ipaddress:8123 by replacing your-raspberrypi-ipaddress with your Raspberry Pi IP address (We have 192.168.1.174 - http://192.168.1.174:8123)
- On first boot, it downloads the latest version of Home Assistant which takes around 20 minutes (slower/faster depending on the platform and your Internet connection). Sometimes the screen below doesn’t load, but the installation is still continuing in the background. Wait till the installation completed.
- Once it’s done, your Raspberry Pi will auto reboot. Refresh your web page. You will need to enter your name, username and password. Click on Create account button.
- You can name your home, click on Detect to get time zone, select the unit system and click on Next.
- You can set your devices and services during setup or do it later. Click Finish to completed the initial setup.
- Congrats. You have succed with home assistant installation. First it will load the default view. You can save your login by click on Save login button in bottom right corner of screen.
- You can see the menu of home assistant in top left corner.
- You can navigate through each tab and explore what is inside.
2. Installing Add-Ons
Add-ons for Hass.io allow the user to extend the functionality around Home Assistant. This can be running an application that Home Assistant can integrate with (like an MQTT broker) or to share the configuration via Samba for easy editing from other computers. Add-ons can be configured via the Hass.io panel in Home Assistant.
As an example we will show you how to install Samba share and Open SSH. You can also install other add-ons if you need them.
- The Samba share add-on gives you access to the Raspberry Pi's folders on your computer. This is useful so that you can access and change your Home Assistant configuration settings through your computer.
- Go to Hass.io.
- Go to ADD-ON STORE and select the Samba share add-on.
- Click on Install.
- In config section assign password. We have "hassio". Click on Start.
- If you want ot access the shared files in Windows on you PC/laptop go to Start -> Computer.
- Type your Raspberry Pi IP address in the field on top. (We had \\192.168.1.174)
- You will see the pop up window from Windows Security. Type your user name (in our case hassio) and password (in our case hassio). Tick on Remember my credentials box. Click on OK button.
- You can see the folders on Micro USB card with Home Assistant now.
- Go to config folder.You will see the configuration.yaml file in this folder.
- Go to ADD-ON STORE and select the SSH server add-on. This allows you to connect to your Raspberry Pi that is running Home Assistant over SSH.
- Click on Install.
- In the Config section, add a password as follows (use your own password) and click SAVE. Click on Start. The connection will be established automatically, when you boot your Raspberry Pi.
3. Rebooting Raspberry Pi
- We need to reboot Raspberry Pi after installing the add-ons. Let's do it via SSH.
- If you’re running Windows OS on your PC/laptop, use Putty to establish the communication via SSH. If you don’t have Putty installed, you can dowload it here.
- Enter your Raspberry Pi IP address with Port 22 selected and click on Open button. When you first connect, you will be prompted with a Warning message. Click on Yes.
- Login as root and enter the password you’ve defined (we have defined "raspberry").
- If you type hassio help, you will see the commands you can use to communicate with the Raspberry Pi.
- To reboot your Raspberry Pi enter the following command: hassio host reboot
4. Modifying the configuration.yaml file
The configuration.yaml file saves data in a hierarchical format to let Home Assistant know what you want to do. This file stores what components you are using, how they are organized and how to automate with them.
Please find the example of configuration.yaml file.
- Go to Hass.io -> ADD-ON STORE and select Configurator.
- Click on Install.
- Click on Start.
- Click on Open Web GUI.
- The configurator GUI opens. Go to Browse FileSystem.
- Go to config folder and find the configuration.yaml file.
- In this file, you can see homeassistant at the beginning. This is a component itself and it's the only one mandatory component. introduction is another component, frontend, config and so on.
- The automations are in a different file called automations (you can also add the automations directly to the configuration file). You can organize all your different components in groups – this is also done in a separate file called groups.
- These separated files are linked in the configuration file at the end.
- You can easily add a password to your Home Assistant User Interface. In the configuration.yaml file you just need to uncomment the line, by taking out the #:
- api_password: PASSWORD . Type your desired password instead of word PASSWORD.
- Save your configuration.yaml file.
- In the Home Assistant User Interface, go to Configuration->General and click the CHECK CONFIG button. This will check the syntax of the configuration.yaml file. When, it’s done, you get a Valid! message if everything is good with the syntax.
- Go to Server Management field (Configuration->General) and click on RESTART.
- Wait for the system to restart. You will be asked for password.
5. Adding integrations
- To add integrations to the configuration.yaml file go here and search for the desired.
- For example, search for Raspberry Pi GPIO switch (we just type Rapsberry Pi GPIO).
- Click on Raspberry Pi GPIO switch.
- You just need to copy the entry given to the configuration.yaml file, and add or edit the configuration variables to meet your needs.
Summary
We have learnt about Home Assistant, how to set up Home Assistant.
Libraries in use
- None
Resources
- See on the begining of this project
Other projects of Acoptex.com










jobs.viewed