Smart Home: The Very First Step

Smart Home: The Very First Step

Requirements

Although you’re more than welcome to just read this post for general knowledge, check out my recommendations for what you need to have, in order to be able to fully use the provided information.

The very first step in building a smart home is arguably the most fun: buying some gadgets. You'll likely get addicted to this, and "some" gadgets will quickly grow into "lots" of gadgets. However, it's important to start from the beginning, so I recommend starting with some of the simplest smart home devices possible.

For those new to the world of smart home technology, there are a few excellent devices to get started with: the Tuya Wi-Fi Smart Plug, the Sonoff B05 Wi-Fi Lamp Bulb, and the Sonoff Micro. The Tuya Wi-Fi Smart Plug connects to your electrical outlet, allowing you to control any device plugged into it remotely, such as a lamp or fan. The Sonoff B05 Wi-Fi Lamp Bulb lets you control the lighting in your home, offering dimming and color-changing options for added ambiance. The Sonoff Micro is perfect for making small USB-powered devices smart, enabling remote control and automation. Each of these devices provides a straightforward and affordable entry point into home automation, offering convenience without the complexity of more advanced systems.

Voltage and Socket Compatibility

When ordering smart home devices, it's essential to pay attention to the voltage requirements specific to your country, whether it’s 110V or 220V. Additionally, be aware of the socket type in your home, as plug configurations vary from country to country. Ensure the smart plugs or devices you purchase are compatible with your local sockets to avoid any compatibility issues or the need for adapters. Taking these factors into account will help you smoothly integrate your new devices into your home.

Communication Protocols: Wi-Fi and Zigbee

When buying smart home devices, it's important to note that there are a few ways these devices "communicate" with your home. The two primary ones are Wi-Fi and Zigbee. We all know Wi-Fi; with these devices, you simply need to provide the Wi-Fi network and password, just like any other Wi-Fi device, and they'll connect to your network, allowing you to control them. The other type of devices communicates using a protocol called Zigbee. Zigbee is similar to Wi-Fi but with a few differences. Zigbee is a low-power, wireless mesh network standard. Devices using Zigbee can communicate with each other, forming a network that can cover a larger area than a typical Wi-Fi network. This mesh network allows for greater reliability and energy efficiency, making it ideal for devices like sensors, lights, and switches that don't require a lot of bandwidth but benefit from extended range and lower power consumption. However, Zigbee devices require a hub to operate, which acts as the central point of communication for all Zigbee devices in your home. So in other words, Zigbee devices won't just work "out of the box"; you'll need to get something else as well for them to function, and we'll save that for one of the next steps in setting up your smart home.

For this step of this guide, I recommend you start with a couple of Wi-Fi devices, as these will be easier to set up. After you've started setting up, you'll most likely want to get Zigbee devices as well. I have quite a few that I recommend here, here, and here.

Getting Started with Device Apps

Now, you could stop your smart home setup here. Each of the devices you got will come with a short manual and a link to an app. Their app will guide you on how to connect the device to the internet, and you'll be able to control that device from your phone. Stopping here, though, is missing out on all the fun.

The main issue plaguing the smart home world is that many manufacturers push their own cloud solutions and mobile applications to control their devices. This can be very inconvenient, as you’ll soon end up with so many applications that you won't remember which app controls what. Even with the 3 products recommended above you'll already end up with 2 different apps - Tuya's SmartLife app and Sonoff's Ewelink app. The best solution to merge all your smart home appliances into one platform is called Home Assistant (often abbreviated as "hass").

Introducing Home Assistant

Home Assistant is a software that needs to be installed on a computer that runs 24/7. It cannot run from your smartphone; your smartphone will connect to this home system once everything is set up, so you will be able to control your home from your phone, but the "hub" itself will need to run from this computer that you'll set up.

The major benefits of setting up Home Assistant include:

  • Merge Different Devices from Different Manufacturers Under One Roof: This allows you to create a "dashboard" for controlling various devices, regardless of their maker, providing a unified interface for your smart home.
  • Create Automations Independent of Device Manufacturers: For example, you can create an automation where if the door sensor senses that the door opened and it's after dark, the light by the door and the light in the living room turn on. This automation can use devices from four different manufacturers, a feat impossible with the original apps that came with these devices.

With Home Assistant, you gain the flexibility and power to customize your smart home experience far beyond what individual device apps offer.

Choosing the Right Computer

Simplest and Cheapest Option: Raspberry Pi

A Raspberry Pi is a small, affordable computer that is perfect for running Home Assistant. The latest model today is the Raspberry Pi 5, but in my experience, the previous generation, the Raspberry Pi 4B, is more than powerful enough to run Home Assistant. At around $70-90, it’s the cheapest computer you could get.

I recommend adding these to your shopping cart. You'll need the Raspberry Pi (from the purchase link below, I recommend the 4GB RAM, the 8GB RAM is a bit of an overkill for Home Assistant), and then you should get a USB-C power cable and preferably a case. I recommend the Argon One series of cases, and you can grab one of their cases already bundled with a USB-C cable. You'll also need a Micro-SD adapter so you can plug it into one of your USB ports on your computer to install the software. Some laptops already have a Micro-SD slot, so if you have one then you don't need it.

What is a Raspberry Pi?

The Raspberry Pi is a series of small single-board computers developed by the Raspberry Pi Foundation to promote teaching of basic computer science in schools and developing countries. In other words, it's simply a tiny computer. It is highly popular for DIY projects because of its low cost, versatility, and wide support community.

One issue with the Raspberry Pi is that the operating system (OS) runs from a micro SD card by default (unlike your computer that has a hard drive that stores all your information). Micro-SD cards, especially cheaper ones, will not last very long when running Home Assistant. You need something very durable for this purpose.

Storage Options

  1. Cheap Option: Sandisk High Endurance SD-Cards. These are made for many writes and will have a long life. Get a 32GB or larger card.
  2. More Expensive Option: Run the Raspberry Pi from an NVME drive. NVME drives are much faster and more durable than micro-SD cards. To do this, you need a special case and adapter for the Raspberry Pi. I personally use the Argon One M.2 case.

If you're just starting out, perhaps start with a Sandisk High Endurance SD Card, and bookmark the NVME option for when you want to take your setup one step further.

Setting Up Home Assistant on Raspberry Pi

After buying the Raspberry Pi, you need to install Home Assistant on it. Here are the steps to follow:

  1. Download Raspberry Pi Imager: Download and install the Raspberry Pi Imager on your computer from here.
  2. Open Raspberry Pi Imager: Open the Raspberry Pi Imager and select your Raspberry Pi device (In our case it's "Raspberry Pi 4").
  3. Choose the Operating System:
    • Select Choose OS.
    • Select Other specific-purpose OS > Home assistants and home automation > Home Assistant.
    • Choose the Home Assistant OS that matches your hardware (In our case you need to choose "Raspberry Pi OS 64-BIT").
  4. Choose the Storage:
    • Insert the SD card into your computer, either directly into a micro-SD slot in your computer or with the USB adapter you got. Note: the contents of the card will be overwritten.
    • Select your SD card.
  5. Write the Installer onto the SD Card:
    • To start the process, select Next.
    • Wait for the Home Assistant OS to be written to the SD card.
  6. Eject the SD Card.

If you're encountering issues during the installation, such as the SD card not being recognized or the installation failing, check out our troubleshooting guide for helpful tips.

Starting Up Your Raspberry Pi

  1. Insert the SD card into your Raspberry Pi (Not the USB adapter, but the MicroSD card itself. If you were too enthusiastic and already assembled your Raspberry Pi enclosure then you may need to reopen it now to access the MicroSD slot. Some cases allow inserting the MicroSD after the case is assembled, check your case carefully and see what matches yours).
  2. Plug in an Ethernet cable and make sure the Raspberry Pi is connected to the same network as your computer and is connected to the internet. It is recommended to connect the Raspberry Pi directly into your router with an Ethernet cable and not to try working with it over Wifi.
  3. Connect the power supply to start up the device. Notice that on many Raspberry Pi models there is no on-off button, you just turn it on by plugging it in.

Accessing Home Assistant

Within a few minutes after connecting the Raspberry Pi, you will be able to reach your new Home Assistant.

If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your Raspberry Pi’s IP address).

At this point, it’s important to note that the URL you are using to access Home Assistant is only available to devices connected to your local network, meaning it is not accessible from the internet. While there are ways to securely access your Home Assistant dashboard when you're away from home, we'll cover that in a future post. For now, rest assured that your dashboard remains private on your local network. Also, during the Home Assistant onboarding process (detailed below), you will set up a username and password to secure access. This ensures that even within your local network, only authorized users can interact with the system.

Congratulations! You have finished the Raspberry Pi setup. With the Home Assistant Operating System installed and accessible, you can now continue the initial setup. You can click on "Create My Smart Home" to begin the initial setup.

At the next step you'll be asked to set a username and password and a location for your home. At the very last step, Home Assistant will perform a scan of your network and will try to find compatible devices. Don't worry if you don't see all your devices, your can add more later.

Click Finish to see your default dashboard (which you'll be able to heavily customize to your liking). You can now access this dashboard either from a computer, a phone or a tablet, and control all your home devices.

By following these steps, you'll have a solid foundation to begin building your smart home. Enjoy your new smart setup!

Your Next Smart Home Devices

In this article, I specifically recommended starting with WiFi smart devices since they are the easiest to get up and running. Another communication protocol you'll eventually need to explore is Zigbee. However, I suggest holding off on that for now. First, focus on mastering Home Assistant, its automations, scripts, and dashboards. This series of guides will take you through each step until you're ready to expand into Zigbee devices, which will come naturally as you progress.

Shopping List

What's next?

In follow-up posts, we'll learn about setting up the dashboard in Home Assistant to create a unified control interface for your devices. After that, we'll explore setting up automations in Home Assistant, enabling you to create complex, cross-device automations tailored to your needs. So, if you made it this far, read this article, bought what's needed and you've set up your Raspberry Pi with Home Assistant, then you can click on this button below to get qualified for your next rank and move on to the next step in setting up your home.

To start earning levels and track your progress, make sure to — only then will your journey through the Smart Home world be officially recognized!


6 Comments

  1. Idan Givati

    Explained thoroughly and clearly. Wasn’t as easy as expected but the bite size steps and explanations helped me finish it successfully! Will continue leveling up and learning the ropes this site encompasses.

    Great Thanks Dr. Smart!

    2
  2. Idan Givati

    Finished this article, can access HA and log-in from the same network (wired), but not from my mobile smartphone over wifi (still same network). When trying to access http://homeassistant.local:8123/lovelace/0 via mobile it says: “This site can’t be reached” (ERR_NAME_NOT_RESOLVED).
    What am I missing?

  3. Dr.Mor

    Did you try “http://X.X.X.X:8123”, and replace X.X.X.X with your Raspberry Pi’s IP address? Often mobile browsers are not fond of the x.local shortcuts over wifi.

    1
      • Dr.Mor

        Your options:
        1. Connect a monitor to the Raspberry Pi and see what it says on the screen (see attached screenshot).
        2. If you do have a connection to the Pi from another computer through homeassistant.local then you can go to Settings -> Network -> In the “Configure network interfaces” block there’s a 3 dot menu on the bottom left, click on that and select IP information, it will show you the IP.
        3. Download a small utility: https://www.nirsoft.net/utils/wireless_network_watcher.html it will scan your network and will show you all the clients connected to their network.
        4. Browse to your router’s settings address, it will show you all the devices that are connected to it.

        Good luck!

        1
  4. Alon Feldblum

    Nice intro! Easy and fun to read even when technical.
    I am using the more advanced Unraid setup for the Home Assistant, but I used this article as a good reference.

Leave a Reply