Building Smart Home Automation Solutions with Home Assistant

Book description

A step-by-step guide to building cost-effective and complete home automation DIY projects using tools such as Home Assistant, Raspberry Pi, IoT devices, the Tasmota sensor, ESP32, and Grafana

Key Features

  • Learn by doing using real-life practical examples to build your own home automation system
  • Create, hack, and configure IoT devices through hands-on projects to be used with or without Home Assistant
  • Customize your home automation system using Home Assistant, Node-RED, InfluxDB, and Grafana
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

Picture a home where you can adjust the lighting based on the time of day or when movement is detected. In this same home, you can also detect when a door is unexpectedly opened or an alarm is triggered in response to any suspicious activity. Such automated devices form part of a smart home, and the exciting part is that this book teaches you how to create and manage these devices all by yourself.

This book helps you create your own ecosystem to automate your home using Home Assistant software. You’ll begin by understanding the components of a home automation system and learn how to create, hack, and configure them to operate seamlessly. Then, you'll set up Home Assistant on a Raspberry Pi to work as a home automation server, build your own IoT sensors based on ESP32/ESP8266, and set up real-life automation use cases using hands-on examples and projects. The chapters will also guide you in using software tools such as Node-RED, InfluxDB, and Grafana to manage, present, and use data collected from your Home Automation devices. Finally, you’ll gain insights into new technologies and trends in the home automation space to help you continue with your learning journey.

By the end of this book, you’ll be able to build your own creative, IoT-based home automation system using different hardware and software technologies.

What you will learn

  • Understand the fundamental concepts of home automation systems
  • Set up a home automation system using Home Assistant and Raspberry Pi
  • Create and configure ESP8266-based sensors to work with Home Assistant
  • Hack a commercial actuator to work with Home Assistant using Tasmota
  • Create automations, customize, and use applications with Home Assistant
  • Leverage IoT software tools to take your home automation to the next level
  • Work on hands-on projects, including LED strip lights and an ESP32 five-zone temperature logger
  • Explore home automation FAQs, emerging technologies, and trends

Who this book is for

The book is for engineers, developers, students, makers, and enthusiasts who’re working on or interested in working with electronics and IoT devices, embedded systems, systems integration, computer software, and coding to develop their own smart home automation systems. Technicians, teachers, and other professionals who want to learn home automation–related technologies will also find this book useful. Prior experience of working with Raspberry Pi, creating hardware prototypes, and software programming will be beneficial.

Table of contents

  1. Building Smart Home Automation Solutions 
with Home Assistant
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1: Introduction to Home Assistant – Installation and Configuration
  7. Chapter 1: Understanding Home Automation Systems
    1. Technical requirements
    2. Overview of home automation systems
    3. Benefits of having an automated home
      1. Saving time
      2. Feeling comfortable
      3. Saving money
      4. Being safe
    4. Home automation structure
      1. Home automation server
      2. Sensors
      3. Actuators
      4. Communication media
      5. Protocols and brokers (MQTT)
      6. User interface and other clients
    5. Example of a real home automation system
      1. History
      2. Current configuration
      3. Bill of materials and costs
    6. Summary
  8. Chapter 2: Getting Started with Home Assistant
    1. Technical requirements
    2. Learning about Home Assistant
      1. Introduction and evolution
      2. Home Assistant features and resources
      3. Important Home Assistant definitions
      4. Home Assistant availability
      5. Community and support
    3. YAML
    4. Raspberry Pi as a home automation server
      1. Hardware architecture
      2. Main Raspberry Pi features used by the home automation system
    5. Installing Home Assistant on a Raspberry Pi
      1. Preparing the SD card for Home Assistant installation
      2. Home Assistant installation verification of Raspberry Pi
      3. Home Assistant initial configuration
    6. Exploring a Home Assistant installation
      1. Home Assistant default screen and menu disposition
      2. Home Assistant sidebar navigation
    7. Home Assistant basic configurations
      1. User preference configuration
      2. General configuration
      3. People configuration
      4. MQTT configuration
      5. Wi-Fi network configuration
      6. Dashboard cleanup
    8. Summary
  9. Part 2: Install, Create, and Hack Sensors and Actuators
  10. Chapter 3: Hands-On Project 1 – Creating Your Own Sensor
    1. Technical requirements
    2. Knowing the parts and tools to build your sensor
      1. Element sensor and signal conditioner 1 – the motion sensor
      2. Element sensor and signal conditioner 2 – environmental/temperature sensor
      3. Wireless communication module – ESP8266
      4. Power supply and cabling
    3. Connecting the electronic parts and cables
    4. Understanding Tasmota and how to install it in our sensor
      1. What is Tasmota?
      2. Installing Tasmota in our sensor
      3. Configuring the software of your sensor
      4. Getting data from sensor elements
      5. Device name
      6. Configuring the MQTT information in the sensor
    5. Integrating the sensor data into Home Assistant
      1. Integrating the temperature sensor
      2. Integrating the motion sensor
    6. Enclosing, calibrating, and installing the sensor
      1. Enclosing our sensor
      2. Calibrating the sensor
      3. Installing the sensor
    7. Summary
  11. Chapter 4: Hacking a Commercial Actuator to Work with Home Assistant
    1. Technical requirements
    2. Understanding hacking a sensor or actuator
      1. How to choose a commercial sensor or actuator to be used with Tasmota
    3. Using tools and hacking the firmware of a commercial actuator
      1. Learning about the tools and materials used to hack an actuator
      2. How to hack your commercial actuator
    4. Configuring your hacked actuator
      1. Configuring the Tasmota firmware in your actuator
      2. Configuring the actuator in Home Assistant
    5. Adding another commercial actuator to Home Assistant (non-hacked)
      1. Using a Home Assistant integration to add a commercial device
    6. Installing actuator devices in your home
      1. Getting started with the actuator installation
    7. Installing other types of devices in your home
      1. Installing small actuators in electrical wall boxes
      2. Installing outlet plug actuators
      3. Installing smart lamps (bulbs)
      4. Installing battery-powered devices
    8. Summary
  12. Part 3: Automations, Customizations, and Integrations Using Home Assistant
  13. Chapter 5: Creating Automations Using Home Assistant
    1. Technical requirements
    2. Learning what automations are
    3. Components of an automation in the context of Home Assistant
      1. Understanding entities
      2. Understanding the automation components
    4. Creating your own automations
      1. Automation 1 – convenient light for your garage
      2. Automation 2 – turn off screen monitor at bedtime
    5. Testing and debugging your automation
      1. Setting and checking the state of entities
      2. Changing the state of output devices using services
      3. Using traces to debug your automation
    6. Expanding the Home Assistant automation capabilities
      1. Using and creating pre-formatted automations (blueprints)
      2. Creating and using scripts
      3. Creating scenes
    7. More examples of automations
    8. Summary
  14. Chapter 6: Doing More Using Integrations and Customizations
    1. Technical requirements
    2. Adding more devices to your home using integrations
      1. Using Home Assistant-based integrations
      2. Using device manufacturer-based integrations
      3. Adding other devices to your home
    3. Using dashboards in Home Assistant
      1. Understanding and creating dashboards
      2. Populating dashboards by using cards
      3. Populating the dashboards by using badges
    4. Customizing your dashboards
      1. Dashboard approach 1 – by home dependencies
      2. Dashboard approach 2 – by device type
      3. Dashboard approach 3 – Home Assistant integrations
    5. Using extra resources to customize your dashboard
      1. Using the Picture Elements card
      2. Installing and using other customizable cards and items
    6. Summary
  15. Part 4: Expanding Home Assistant’s Capabilities
  16. Chapter 7: Extending Home Automation Capabilities Using Add-ons
    1. Technical requirements
    2. What are add-ons in Home Assistant?
    3. Doing automations without Home Assistant using 
Node-RED
      1. Installing and using Node-RED
      2. Recreating an automation using Node-RED
    4. Using database and chart tools to present data from 
your home
      1. Installing and creating databases using InfluxDB
      2. Installing and presenting data using Grafana
    5. Managing your network of Tasmota devices using TasmoAdmin
    6. Accessing Home Assistant remotely
    7. Summary
  17. Chapter 8: Installing and Setting Up Home Assistant Container
    1. Technical requirements
    2. Creating backups in Home Assistant
      1. Creating and retrieving manual backups using Home Assistant
      2. Creating an automation to back up your system
    3. Understanding the architecture of IOTstack
    4. Installation of IOTstack
    5. Configuring the IOTstack
      1. Raspberry Pi static IP configuration
      2. Accessing and configuring the container software applications
      3. MQTT server configuration in Tasmota devices
      4. Configuring Home Assistant in IOTstack
    6. Running and managing the applications in IOTstack
      1. Maintaining the software used by IOTstack
    7. Summary
  18. Part 5: Learn by Doing and Future Trends
  19. Chapter 9: Hands-On Project 2 – Creating an LED Strip Controller and Adding It to Home Assistant
    1. Technical requirements
    2. How an LED strip controller works
    3. Grouping the materials and connecting the parts
      1. Materials required to build the LED strip controller
      2. Connecting the parts to build the LED strip controller
    4. Deploying the controller software
    5. Configuring the LED strip controller using the WLED software application
      1. Configuring the Wifi network in the WLED application
      2. Configuring the main parameters of the WLED application
    6. Integrating the LED strip controller into Home Assistant
    7. Creating an automation using the LED strip controller
    8. Installing the LED strip controller in your home
    9. Summary
  20. Chapter 10: Hands-On Project 3 – Creating a Five-Zone Temperature Logger for Your Home
    1. Technical requirements
    2. Understanding the five-zone temperature logger system architecture
      1. Hardware system architecture
      2. Software system architecture
    3. Creating and configuring the five-zone temperature sensors and the ESP32 module-based temperature hub
      1. Changing the Mi Bluetooth thermometer firmware
      2. Uploading the ESP32 Tasmota firmware variant to the temperature hub
    4. Connecting the sensors data to a database using 
Node-RED
      1. Double measurement sensor data capturing and formatting
      2. Temperature hub data capturing and formatting
      3. Configuring the data to be stored in the InfluxDB database
    5. Storing data in a database using InfluxDB
    6. Presenting the InfluxDB data using Grafana
    7. Using the five-zone temperature sensor in Home Assistant
    8. Summary
  21. Chapter 11: The Road Ahead in Home Automation Technologies
    1. Technical requirements
    2. New technologies and trends in home automation
      1. Using current and new technologies to interact with your home
      2. Using different smart devices in your home
      3. Using a single home automation communication protocol
      4. Using energy-efficient systems
      5. Including security in home automation
    3. Home Automation and Home Assistant FAQs
      1. Home automation FAQ
      2. Home Assistant FAQ
    4. How to get ideas for projects to automate your home
    5. Additional resources
      1. Websites
      2. YouTube channels
      3. Online forums and communities
      4. Podcasts
      5. Books
    6. Summary
  22. Index
    1. Why subscribe?
  23. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share your thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Building Smart Home Automation Solutions with Home Assistant
  • Author(s): Marco Carvalho
  • Release date: September 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781801815291