Payload Logo

Home Assistant: EP1 Down the Rabbit hole

Author

Norbert Takács

With the 2012 release of the Phillips Hue platform, many of us were introduced to the world of home automation and IoT. The limits of our common-day appliances suddenly started to erode. For the first time, we could tell our voice assistant to turn on the Lights and feel like Iron Man. The future was looking exciting and limitless.

Unfortunately, the limits soon came in the form of vendor lock-ins. The dream of having a uniform network of devices was shattered when the reality of tens of competing networks arrived. Each brand brought its line of products and network implementation, some requiring a license to release compatible products and others downright refusing to work with other devices. An example of this would be Yeelight and Phillips Hue both using compatible technologies but being incompatible.


Don’t forget to test your Home Assistant knowledge with the quiz which is found at the end of the article


Home Assistant (online demo) came to try and unite all these incompatible devices. It managed to achieve this by providing an open-source dashboard for controlling your devices. This service can be run independently on your network and does not report to any companies. The core members maintain control of the higher-level design of the Python platform and anyone can contribute to the development.

The software is free to use except for their ready-to-use NabuCasa remote access platform. It allows for easy and secure remote access to your Home Assistant instance. This feature is optional and can be recreated with free resources. Home Assistant manages to bridge the gap between competing vendors. In the case above both Yeelight and Phillips hue can play along with the same interface.

The platform is extensible by third-party add-ons where each add-on can be developed by an independent person or team published and consumed freely. Currently Home Assistant supports over 2600 different integrations

This has come at a perfect time because:

  • OpenSource movement is on the rise - software freedom, where code is shared openly for anyone to use, modify, and distribute.
  • IoT-compatible products such as Arduino family, Raspberry Pi family, ESP32, Tasmota devices, and off-the-shelf microcontrollers often come with the latest tech capabilities

To be able to integrate a device to Home Assistant oftentimes someone had to take their time to understand how the given device works. Some devices were easy to integrate since they provided developer API interfaces and documentation. Others required downward reverse engineering to understand, extract, and transform the data to be Home Assistant compatible.

Community created integrations

Since the early days of Home Assistant some of these problems spawned different open source projects which were designed to address and solve these problems from the core HA project.

Here are a few to name:

  • zigbee2mqtt - ZigBee bridge to offload devices from Home Assistant
  • Node-RED - drag and drop flow-based scripting
  • ESPhome - Program and manage IoT devices with ease
  • AppDaemon - Extends the functionality of Home Assistant with Python scripting
  • DiyHue - Hue bridge emulation
  • Frigate - A complete and local NVR designed for Home Assistant with AI object detection.

Some of these containers also interact with each other or are communicate together through the MQTT broker.

The downsides of managing your own service

The project has gone through an enormous journey, there have been multiple notable breaking changes but they have been handled gracefully by the core team. Most of the breaking changes happen because of migrations from the yaml-based configuration to the UI-based configuration. Notable breaking changes:

  • 2023.8 release
    • The way MQTT entities are named and how device configuration can be shared between discovered entities has changed. This change made quite a lot of users frustrated because their Home Assistant log were flooded with warnings. The change disallowed developers from using the same entity name on the same device. It was announced on the developer blog ahead of time but many have missed it. This also affected me as I am maintaining a fork of UnraidAPI which exposes over 100 entities to Home Assistant.
  • 2022.12 release
    • MQTT Integration: The older main configuration is now managed in the UI. Things like server settings. Platform configuration of entities in YAML (e.g., an MQTT entry under the sensor domain), has been removed (after 6 months of warnings and repairs issues). Now only the new configuration format is accepted.
  • 2022.6 release
    • Google Calendars, Home Connect, Honeywell Lyric, Neato Botvac, Netatmo, Spotify, WiThings, and Xbox: The configuration of the OAuth application credentials for these integrations has migrated to configuration via the UI. Configuring these OAuth application credentials via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

With that, the maturity of the platform and the community has also increased in size exponentially. With over 12000 people on Discord and 3500 contributors on the core repository alone.

Running Home Assistant comes with its challenges. The devices and projects you integrate might have small quirks and how the community overcomes those is quite interesting!

Here are a few interesting problems I have encountered.

  • International Space Station integration is set to blink all lights when orbiting above my location. Great idea if remembered. It took a few months to debug the blinking lights
  • The ZigBee-enabled Aqara Smart Plug that I purchased to monitor the power consumption and state of my washing machine got suddenly activated when I used my Trådfri Ikea dimmers which were on the same network. These devices were never paired before and are not supposed to work together. Turns out that the latest firmware of the smart plug contained a bug that caused the plug to operate on the same group 0 as the dimmers. There was no new firmware from the manufacturer to address this problem. User TheJulianJES came to rescue by reverse engineering a previous binary, fixing the bug, and increasing its internal version number, providing it with a guide on how to flash the device

There were also countless nights when I had to manually turn off my lights because my Home Assistant was in a dysfunctional state because of late-night upgrades.

You are only limited by your time

Home Assistant supports UI-based automation and YAML-based automation. In recent years the progress came to a point, where almost every automation that could be done in the past only with YAML can be created with the UI. For complex automation, I would advise using NodeRed which allows the use of Javascript nodes.

Some of my favorite automations which would not be possible without this platform:

  • Automatically adjust the volume of speakers based on the time of the day
  • Monitor device joins straight from the router.
  • When coming home transfer the music I am listening to my speakers
  • Track birds near my feeder and notify my on-speaker about the bird type
  • Sonos media player pauses if someone rings the doorbell
  • Send a notification and play a chime when the main door lock is not locked for 5 minutes

This is a first look into the Home Assistant platform. I will be covering third-party add-ons in depth in this Publication and in my upcoming course. The course comes with a quiz, feel free to test your level of Home Assistant knowledge!





Join the Discussion on github