Uncategorized

Locally Controlled Open Source Home Assistant – With Voice Control!

 

Have you ever bought a product or service and were forced to create an online account to access some or all of it’s functionality? Have you ever wondered if it’s possible to have 100% local, off grid control over your smart home devices?

Like many people, I’ve always been uncomfortable with those Amazon Alexa and Google Nest speakers listening to everything you say in the privacy of your home. In fact, I think many people willingly forgo the convenience of smart home devices simply because they are not willing to invite Google, Amazon or Apple to listen in to every word spoken in the privacy of the home. In most cases, the user is forced either integrate with one of the big three smart home integrators, or load a different app for each brand of device with less than stellar functionality and UI, while being subject to 3rd party cloud dependency.

Most any smart device you purchase includes a dedicated cloud service attached to it, and it will often not be fully functional without connecting to your wifi. This dedicated cloud-based component may be a server in another country providing automation services, controlling your device and relaying your commands to smart home services including Google or Amazon. It’s difficult to know what other data the device may be collecting and transmitting to it’s mothership in the cloud. Additionally, if the company stops supporting the device or goes out of business, or even if it’s cloud servers go down for a time, your smart device may cease to function at all!

Recently my curiosity about all this led me to test out the open source driven Home Assistant project.

Home Assistant, or HASS, is a free and open-source home automation software designed to be the central home automation control system for smart home technology. Both the Home Assistant “core” application itself and its software extensions are written in Python. Its main focus is on local control and privacy. –Wikepedia

HASS runs in a linux environment and is designed for Raspberry Pi. It sits on your local lan (or cloud server of your choosing) and provides a high level of automation and control of many smart devices in your home. Out of the box, HASS provides integration with a wide variety of devices…

Home Assistant Web Dashboard
Home Assistant Mobile App

Home Assistant can work with cloud controlled devices just like Amazon Alexa or Google Nest. However, if you want total local control, you can replace the firmware in many devices with open source firmware, giving you, the homeowner and purchaser of such devices, 100% local and private control of your home. It turns out that many small IOT device on the market (at least when it comes to smart light dimmers and switches) are controlled by the same MCU: The ESP8266:

ESP8266.. totally hackable!

Most of these chips have 1MiB internal memory, WIFI, 16 GPIO pins and can be easily re-flashed with custom firmware. And, it just so happens, that there are a lot of people doing just that! There are two popular open source firmware packages available for this chip, Tasmota and ESPHome.

 

 

 

 

 

I chose to work with Tasmota, as it appears to be a little more user friendly, while ESPHome requires you to compile a binary with all configuration options, while Tasmota spins up a web host right on the device allowing you to change configurations more easily. Until recently, one could flash many devices over the air without having to open the device at all, but now most devices are locked down and require access to the serial data pins on the MCU to re-flash the device. Here is a photo of me flashing a few smart 3-way dimmers with the serial pins on a pi.

Flashing Open Source Firmware on a ESP8266 based Smart Dimmer
De-soldering the ESP

Here is my current home setup:

And a little video!

My next quest was to add voice control. Home Assistant natively supports an open Source voice assistant called Almond, but the actual voice recognition is not included and must be sent to the cloud.  I wanted a 100% off cloud voice controlled home assistant. I found another voice/assistant/intent tech stack called Rhasspy that supports Home Assistant integration.

Rhasspy has a nice collection of speech to text, text to speech, intent handling and authoring tools that allow highly customizable approach to voice control for Home Assistant. It will run just fine on a Raspberry pi 3 or later, although depending on how you use it, it can be slow. I used this USB microphone with the pi with great success.

Rhasspy accepts your custom voice commands and tries to determine the logical intent of your statement. For example, here are a few sentences that I wrote with logic operators in parenthesis:

And here is an example output of the intent engine when I ask “What time is it”..

Over in Home Assistant, I created several automatons and actions to handle intent, and create the voice responses here as well. Notice the responsetext, which I send back to Rhasspy:

Now that I have integrated voice control, I want to expand home assistant to control and automate more devices in my home. My GE Smart Washer and Dryer will be the next victim! The native app interface is not a great experience, and I would like to see this and other appliance usage in my histogram. There is an integration available using the If This Then That protocol, but I believe it still requires cloud integration.

GE Smart Appliances
My Home IOT Histogram. Find the hidden correlations.

I also will be testing a Sense Sensor soon, this will allow more detailed usage analytics based on electrical noise caused by various appliances and devices in the home. There is even a nice plugin available for Home Assistant!

What have I learned from this experience? Mostly that off grid automation is possible, useful and very stable! Unfortunately I don’t think that this kind of setup is available to most people that don’t have a high degree of technical skills and patience. I don’t want to even say how much time I’ve put into this project. I think there is a real market opportunity for more locally controlled IOT devices and services. I also think that home and personal data is a powerful resource and commodity, and should be protected and controlled by the owner.  I had a great time learning about the communication protocols between devices, and I’m excited to get a taste of what a highly personalized responsive home of the future might look like!

 

Leave a Reply