Andy's Blog

A handful of ramblings...
Font size: +
17 minutes reading time (3429 words)

Choosing a Home Automation Hub - How Hard Could it Be?

5684sm-Medium

As I mentioned in the introduction article of this series, there isn't a standard yet for smart home devices to talk to each other. However, the advertising and hype sure makes smart homes look like an easy care free way of life. Well, it isn't. If someone is telling you it is, beware! Snake oil will soon follow!

 

Smart Home - What's in a Name?

Before I get into what I'm using and why, let's start with a bit of background. When I say smart home, what pops in your mind? Probably, an Amazon Echo or a Google Home smart speaker. For many, this is the first step into the smart home ecosystem. I say ecosystem because from this point on, everything you choose to buy probably hinges on a stamp on the side of the box that says "Works with ..." and your chosen ecosystem. If you've been in this world for a while, you may have graduated up to a Wink or SmartThings hub and some lights. This is the natural progression in which most people find themselves and to be entirely fair, this is a sensible move. It wasn't too difficult to pull off and it achieved a certain wow-factor and utility. 

I almost went down this same road - I have an Echo with Alexa and it's cool. So, what stopped me? What's wrong with this scenario? 

 

Begin with the End in Mind

For most people, nothing is wrong with this route; it works just fine until it doesn't! How do you know that this or that thing will work and what does failure look like with something this complex and obscure? Did you know that people have figured out how to combine hubs? I started to get paralyzed from too many options. So, I took a step back and ignored the options. I began by thinking about what I wanted to ultimately accomplish.

As I mentioned in 8 Months of Home Automation Lessons, I wanted to achieve these goals:

  • Cost Effective - The system can't be prohibitively expensive. 
  • Remote Control - Control common things in and outside the house that are difficult to get to if you can't climb stairs, reach places, etc.
  • Automation - Allow the system to control some things for you or respond to conditions.
  • Security - Provide additional tools to promote better safety.
  • Stability - Ensure that the system is dependable.
  • Easy to use - The system must be easy for people to setup and use.

These are great for the big-picture goals but for me as the builder and maintainer, I had a few more requirements:

  • Extendable - The system needed to be something I could add capabilities to. I needed to be able to fill in some gaps that I might find to taylor the system to our needs. I'm not a professional programmer but have a coding background. I needed the system to be built in something I understood - C, VB, Python, PHP, or Pearl.
  • Support for Many Devices Across Multiple Brands - What good is an automation and control hub if it can't talk to the devices I need? As it turns out, however, this wasn't as important as I had originally thought.
  • Cannot Rely on Internet Connection in ANY Way - As I was looking for solutions for my Wife's friend who had become paralyzed after an accident, it became clear that any dependance on the outside world will guarantee intermittent and random failures. Although rare, our internet connection goes down from time to time. Anyone with a smart speaker has discovered at some point or another that when there is a service interruption, it becomes an expensive paperweight. This does not mean that the system will not use the internet, just that it's normal operation will in no way require it.
  • Redundancy Options or an Easy Failover Plan - I need the system to be resilient meaning, if some central part fails, it either needs to automatically switch over to a backup or it needs to send notifications so I can replace the failed part EASILY
  • Doesn't Auto-Update - One thing that I despise from a technical perspective is auto-update. I absolutely do not want a company somewhere deciding when and what software they get to push to my devices in my home. Inevitably, it ALWAYS leads to massive problems in one form or another.
  • Bonus Point - No account registration required. I'm tired of having to register myself on damn near every website, service, or company I do business with. I don't want to give more data points for people to use to market crap to me. 

 

A Note About Complexity

I'm planning on going into this in more detail in future articles but one major concern is limiting, as much as possible, complexity. This is a wide topic in this sense because 'complex' is context sensitive - it means different things depending on the topic.

At the heart of this project is a need for simplicity - for me as the designer and for my family as the users. However, with regard to the whole, some complexity in one part is better than simplicity in another. For example, while the setup of the system is complicated and has a steep learning curve (*for now), the user interface for my family is very simple. Lights switches still work as one would expect a light switch to work and the automation is intuitive and disappears into the background. 

Stability and Redundancy

point of failureI've had many design teachers point out that "a complex system will fail in complicated ways." It has been my experience that complex systems tend to fail often as well. One aspect of analyzing a technical system is to determine the potential Points Of Failure - the number of parts in the whole that, if it fails, would result in large sections of a system or a full system wide failure.

Think of a desktop computer. Inside the case there are lots of mysterious parts that make up all of the functions and abilities of your machine. If the power goes out, it doesn't matter how well constructed the machine is, you'll have a useless thing. The power supply is known as a single point of failure. Now, you can mitigate this by adding a backup power supply (a UPS) inline with the power from the wall. Now, if the line power goes out, you have a small window of time to prepare the computer to be shut down or for the main power to be restored in.  The UPS is considered a failover device. 

Now think about the hard drive of your computer. As most would understand in this day and age, if the hard drive fails, then the system is useless and furthermore, you've lost more than just the immediate availability of the machine, you potentially lost your data as well. One solution is to use two or more drives in what is called an array. If one fails, another is already running with the same data. This is an example of redundant device.

Lastly, let's say that we've accounted for all of the hardware issues that may come up, but the Operating System that is chosen was built to answer every need - making it very big and complex. If some unforeseen issue with software is introduced that causes the system to lock up then you're right back where you started - the power might as well be out, the system is just as useless. In this case, bigger is not always better. A hammer rarely fails because it isn't complex. However, it also can only be a hammer and not a saw. 

Simplicity in solutions, complexity in redundancy

As I've mentioned already, there is no common protocol or standards with regard to home automation. Subsequently, there are thousands of devices that use many different ways to talk to their own ecosystems. Those ecosystems are fairly well developed and stable in and of themselves but if you try to add in something not in that ecosystem then you need a bridge - a device that speaks both languages and in doing so, added a point of failure and a multiplier in complexity. 

With all of this in mind, I am trying to design my system so it uses the least number of potential points of failure and maximizes the ability for redundancy or failover and needs only simple troubleshooting for large problems. 

 

Commercial Options

As stated, I almost went the commercial route for the hub but the more I dug into it, the less I liked that idea. First, they will achieve almost all of my big-picture objectives except two - cost effectiveness and stability. It also doesn't satisfy my security requirement entirely but I'll get to that a bit later. Second, the commercial route really faltered on my technical requirements. For now, let's look at the popular commercial products you could pickup at your local Walmart or Best Buy.

SmartThings Wink 
Extendable  Proprietary code base but a public API is available  Proprietary code base but a public API is available
Device support   Works with an unlimited number of devices spanning many communications types  Works with up to 200 devices spanning many communications types
 May not be the case with Wink2
Internet Required  Yes, but some local processing is available  Depends on what equipment you have.
Account Creation Required  Yes  Yes
Auto-Update  Yes and no opt out / reschedule  Yes but you have the option to opt out or have it prompt
Redundancy  No  No
Cost  $89 for the hub  $69 for the hub $99 for Wink2

 

Why only SmartThings and Wink?

They are the only two I considered due to their large device and technology support, massive user base and means of community support, and relatively inexpensive price point. There are a several others but most of the rest are very limited in their direct connection support over wireless communication standards such as z-wave, zigbee, bluetooth, etc. Just about every device even closely resembling a hub communicates over wifi so that one is a given. In the next article, I'll go into more detail on these technologies. You can see more options and reviews below. I suggest that you read as many reviews as you can tolerate. You'll notice that, depending on the writer's point of view, they all like and dislike different devices and attributes.

Where these items fail the most is in the realm of personal security and privacy. So why do I care so much about creating accounts and sharing my usage data? Isn't that stuff out there anyway? Who cares? Well, I do. I care that every bit of my life is starting to show up as a data point for mass marketing, and I care that I am paying for the "privilege" of being marketed to. It's ok with me if this is not important to you, I'm not here to debate ideologies, but rather just to point out that this matters to me and factored into why I didn't choose a commercial solution. 

Additionally, I care a great deal that the more devices we have in our homes, the more likely they will be used for cybercrime. It is a real problem that low security devices like cheap home monitoring systems have easily hacked root accounts that can be used to turn that device into an eavesdropping tool or a botnet drone. I would very much like to avoid this problem. This one you should be concerned with too.

Just as an example, how ok are you with someone watching you live your life through your baby monitor?

 

Open Source Home Automation Software

If you are not going with a commercial product, then you're really only left with writing your own or using an open source solution. What is open source? Generally it is software or hardware that has had the code or design made freely available for anyone to use or modify. If you've used any flavor of Linux, you have used open source software. An Arduino is an example of open source hardware. 

There are a lot of open source home automation solutions in various stages of maturity out there. Below is a list of some of the most popular ones that I considered but this list is by no means exhaustive.

  • OpenHAB - Open HAB (Open Home Automation Bus) is probably the most well known and most mature open source home automation projects. It has been around since 2010 and has a very active community of contributors. It supports thousands of devices and can communicate over just about every protocol used in IoT today. It is based on Java.
  • Home Assistant - Home Assistant began 5 years ago and is arguably one of the fastest growing home automation projects available. It supports over a thousand devices and can communicate over each of the most commonly used protocols available. It is based on Python and as such will run on any system that supports python 3. There are flavors of installation with HASS.io being the one I would recommend.
  • Domoticz - Domoticz is a lightweight system that runs on several operating systems. It is written in C++ and uses an HTML5 front end. 

For a good article showing several of the pros and cons of many of the popular projects out there please see this article for details, videos and screenshots:
http://24-7-home-security.com/open-source-home-automation-software/

One other notable mention in this class is NodeRed. For those who want the bare minimum but don't want to code their solution either, then NodeRed might be the solution for you. It is a flow control tool that makes automating states for devices pretty simple. I considered this tool during my research and am still considering it as an automation add-on for Home Assistant - my chosen hub software.

 

Home Assistant

When I was evaluating Home Assistant I nearly didn't choose it due to one specific problem - usability for my family. While the interface ultimately came together in a friendly way, getting it to be friendly wasn't very straight forward, plus, it was somewhat the new kid on the block and I'm not much of an early adopter. However, from a technical standpoint, I quickly gravitated to the product as it easily overcame most of the other checklist items. 

  • ✔ Cost Effective - The software is free and runs on a Raspberry Pi which, with SD card, case and power supply cost about $60. 
  • ✔ Remote Control - The system has a built in web interface, automation, scripting, and some nice built in sensors that can be used to trigger common events like turning on lights 1 hour before sunset. Plus, the system can be set-up for an encrypted connection to the web interface through an add-on.
  • ✔ Automation - Check, there is a built in automation engine based on system events
  • ✔ Security - Out of the box, the documentation encourages secure settings, certificates and best practices.
  • ✔ Stability - I have been running this product on a pi in my basement for 8 months without one single failure or lockup. Others have mentioned performance issues which I resolved by moving my states and events database to my already existing database server. There are other ways to address this with as good or better results.
  • ✖ Easy to use - This is the big one. I'm going to say that this solution is not easy. It requires some technical skill and does require some upfront work to make the interface easy for others to use. However, out of the box, the user interface does show states, buttons and other items automatically and while confusing at the beginning, it was a nice feature till I got up to speed.
  • ✔ Extendable - Home Assistant is written in Python which I am learning for other reasons. It has a straight forward structure and the documentation is fairly well layed out. As with all new things, there is a learning curve and with Home Assistant, there is a pretty steep curve. 
  • ✔ Support for Many Devices Across Multiple Brands - With over 1000 devices currently supported and native support for MQTT, Home Assitant is well connected.
  • ✔ Cannot Rely on Internet Connection in ANY Way - One of the things that sold me in the beginning was this article written by one of the founders.
  • ❗ Redundancy Options or an Easy Failover Plan - No fail over or built in redundancy in the software at this time however, the system does have backups and recovering from a failure can be done in as little as 5 minutes - even with entirely new hardware. A future article will go into further detail on this topic.
  • ✔ Doesn't Auto-Update - This is one thing that I love about Home Assistant, not only do you get to choose when to apply an update, but you also get to SEE what is in the update. There is a full changelog announced with each new release. AND! if an update does break something, in addition to being able to recover with a backup, you can actually revert back to an older version with one command. I did have one update break a set of switches I have and I just simply reverted back to the previous release and all was right with the world. 
  • ✔ Bonus Point - No account registration required unless you want to post on the forum. Other than that, you're good to go anonymously. 

There are some other niceties to the software as well like the ability to roll your own interface using AppDaemon or the built in API. Also, there is a user contributed project called lovelace that gives a lot more options to the existing web interface and it may be that this becomes the de facto interface in the near future. Also, they just added in basic local accounts so that, in the future, different accounts could have access to different parts of the system so you won't have one of your kids disabling an automation "for fun". 

There is also a big push to make the interface much more user friendly. They just recently announced that they will begin integration of Mozilla’s Web Thing API - an attempt at a communications standard for IoT. I think that, in time, this product will be much easier to setup and use.

 

How to get started with Home Assistant

I started with a Raspberry Pi kit plus a good SD card. Some kits come with cards and adapters. Next, I read through the documentation on the Getting Started section of the Home Assistant website. I am not going to go through a step by step setup of home assistant because smarter, prettier people than me have already done great work on the topic. The following videos can help get you going with HASS.io which is the version I recommend and am running. If you get stumped during installation, please take a look at the community site for Home Assistant. Post your questions there and the friendly community of users will likely have an answer for you in short order.

 

*** PLEASE NOTE *** It's ok if you don't want to use Home Assistant!

Let me say that again! It IS ok if you DO NOT want to use Home Assistant! This is not a "I'm taking my marbles and I'm going home!" statement either.

It is just fine for you to use something else. I hope that I am creating all of this generically enough so that it doesn't matter what hub you use. However, for the rest of my articles on the subject I will be talking about "the hub" from my perspective and that perspective has the following context:

  1. I am using Home Assistant which has a built in MQTT client (no we haven't covered that yet but it is important).
  2. My hub has a MQTT broker installed on it as an add-on.
  3. I get to my hub via a web interface and not an app.
  4. I use a VPN connection to get to my home network and my hub when I'm away from home.

 

More to come...

In the next article, I'll go over what communication standards and protocols there are in the IoT world and why there is no standard for all of these things. 

 

Home Automation Links

Main graphic Designed by Macrovector

2

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Friday, 29 March 2024

Captcha Image