The problem....
Firstly lets define what is home automation. Oxford dictionary defines automation as:
"the use or introduction of automatic equipment in a manufacturing or other process or facility"
What we are trying to achieve with our modern homes should be more than 'automatic equipment', and definitely much more than remote control, although both these aspects should be part of the solution. A better term is a smart home - a home that has intelligence to be able to smartly apply device features like actuation and monitoring, adding attributes like remote control and automation to the devices within and adjusting the home environment to your preferences.
It is useful to look at the analogy of a modern day automobile and compare to see what is possible with homes. So much automation is now included to augment the basic function of the automobile to get you from A to B. Each feature in an automobile (like headlamps coming on automatically when it gets dark) by itself is nice, but it is the combination of all the features and how they integrate with each other that makes the difference. A good example is storing profile data about seat position, mirror adjustment, temperature settings and associating it with the key used to enter the vehicle makes the vehicle environment more comfortable, personalised and a generally better experience for the driver. Automobile makers are now putting a lot more attention around the infotainment and intelligent systems that interact with the driver, because consumers can see the advantages of a smart car and are expecting it. This is such a powerful trend that a major factor these days when selecting a $30,000 vehicle is how well it integrates with your $300 smartphone!
Our homes are the equivalent of the '80's automobile, functional and using technology to improve the basic home functions like remote control of the front gate (similar to how fuel injection improved the fuel efficiency of motor vehicles in the '80's) but hardly intelligent or personalised. In the future we will think of the intelligence and smarts of our home the same way we now think about the use of technology in the automobile. But we are long way from that today.
The single most important hardware consideration that is holding home automation back is the lack of a common standard for interfaces that makes the integration between devices harder and not seamless. It is why a central hub server and the software are even more important to create the glue that can (virtually) bind these devices together so that exciting things can happen.
OK, enough of the musing. What does all this mean about how we should think about smart homes?
- Is it being able to use an app on a smartphone to control a Philips Hue light? Nice but no.
- What about seeing the temperature & humidity on the display of a DIY Arduino sensor? Interesting but again no.
- Security cameras recording video from the front entrance on a DVR? Nope.
- Answering the front door through a video intercom? Helpful but still no.
There are many more of these examples that are the staple of today's home automation systems. All these automation features we add to our homes do have benefit but are mostly point solutions and we still fall well short of the potential of the smart home. I believe that we have to add integration, intelligence and personalisation to take home automation to the next level to truly become smart homes.
This is why the home automation 'problem' is a software problem much more than a hardware one. Hardware is still important and it provides the 'senses' (to monitor) and 'muscle' (actuation) of the system but we still need a brain to make some sense of it all, pull it all together in a synchronised way and do something useful with it. Software is the oxygen that fuels the senses, muscles and intelligence of our homes, and why the software side of home automation solutions poses interesting and challenging problems to solve.
Vision for the smart home
A home automation system in a truly smart home will have the following characteristics and some typical example scenarios:
Automation
- Combine multiple actions (eg. Turn off all the house lights with one button when exiting the house).
- React based on environment (eg. Run the pool pump for an extra 1/2 hour for hot days)
Remote Control
- Actuate devices (eg. Open the garage door from the vehicle when arriving home)
- Have multiple access control points (eg. Turning off the security system via a smartphone to let a housecleaner into the house)
Energy efficient
- Awareness of energy use (eg. Create alerts when power use is over a threshold limit)
- Optimise the house environment (eg. Open / close shades and windows based on temperature differentials inside and out)
- Control based on usage (eg. switch off all lights left on after everyone has gone to bed)
Secure
- Able to protect the home from intrusion with alerts and barriers (eg. sound alarm)
- Monitor and alert if there is intruders (eg. alert security patrol)
- Don't interfere with the day to day running of the house (eg. false alarms)
Integrated
- Take action on a device based on the state of another device or environment (eg. dim the lights when tuning on the TV at night)
- Combine multiple data sources into a single screen (eg. Show me the current weather station data along with the weather forecast and rain radar)
Informative
- Alerts (eg. SMS me when the postman arrives with a package)
- Use historical data (eg. compare current average power use with same time last month)
- Enquire (eg. find out who was up at 3am stealing from the refrigerator)
Intelligent
- Provide insights (eg. Suggest ways to improve energy efficiency based on usage patterns)
- Able to anticipate your needs (eg. the ubiquitous example of turning the kettle on as you wake up)
- Learns and adjusts based on multiple stimuli (eg. knows if it is windy and raining to close windows)
Personalisation
- Create lighting scenes based on the time of night and individuals in the room
- Music playlists based on mood, and the audio follows you around the house.
- Adjust the look and feel of interfaces based on personal preferences
Ease of use
- Reliable & responsive (always up, responds quickly and consistently)
- Available over multiple channels (web, mobile, remote, voice)
- Intuitive (easy to understand and operate)
Pliable
- Can connect with disparate hardware both old and new (eg. Serial, MQTT)
- Able to easily add new features when new technologies or ideas emerge (eg. add a REST API)
- Support open standards and protocols (eg. leverage open source components)
Some of these things we can do today with existing systems, and are basic even without a 'home automation' system (eg. garage door remote opener). They each have a place but today they are mostly isolated subsystems that don't communicate to each other, and we don't take advantage of the collective intelligence of these systems and additional benefits if we can control them in harmony.
No current home automation system can claim to tick all of the above boxes, and each has its strengths and weaknesses. The software HA system described in this project also can't tick all the boxes but I have tried to implement a number of these points that aren't significant features of existing software solutions and am continuing to build out the software to realise this vision over time.
The importance of the user interface
Before launching into the details of what the home portal software can do and how it is built, I want to dwell on the topic of the user interface because it is a very important aspect of a smart home and one that isn't addressed well with existing systems.
The smart home should apply the same thinking that auto makers are implementing in modern vehicles, as outlined in earlier section. Just as we live inside the environment of a vehicle and interact with it in many intimate ways (eg. automatic adjustment of seat height based on saved personalisation data or warning bell from the GPS if we go over the speed limit of the road we are on), we also live inside our homes and should interact with it just as intimately so it becomes an extension of our senses, muscles and brain. This doesn't mean we will be physically wired into our future homes, but the technology in the home will complement and extend us, and be so intuitive we won't need effort to interact with it. In order to do this, attention to the user interface is so important and a line of text on a touchscreen saying that the kitchen light is 100% just won't cut it.
There is a lot of ground to cover about how best to create an intuitive and intimate user interface but to keep it brief the following considerations need to be addressed:
- Extensive use of pictures, symbols and graphics.
- Free form layout, sizing and customisation of user interface elements (i.e. not locked into a particular layout or format)
- Make the interface come alive with animation (in moderation),
- A pleasure to look at and fun to interact with
- Intuitive to understand and use
- Fully extensible and customisable by the end user
- Interact with it through multiple channels (eg. voice command / response, mobile screens consistent with web screen but formatted to optimise the smaller screen)
- Add new features and functions without much effort
Most of the development time put into this system has been on the user interface which has gone through many revisions and is one of the main strengths of the software. The system has high acceptance and use from family and friends because it has utility, is easy and fun to use.
OK, but what exactly is it?
My approach for a smart home is to leverage modern standards based technology, with an intelligent local hub (cloud isn't fast enough or reliable enough although cloud services can augment local features). A front end that is visually pleasing, extensible by the end user and dynamic, available on any device (including voice and video channels). An integration layer that is simple, scalable, easy to write and add new devices. An automation engine that is event driven, where historical data is just as easy to use as current data and being truly smart by layering sophisticated logic according to current or historic state (not just 'if this then that').
The software as posted on GitHub is working code and operational in my house at the moment. It handles 70 lights, a weather station, front gates, intercom & doorbell, integrates with 5 cloud based services, monitors and controls the internet router, sends SMS, has remote web and mobile access (without opening ports in the internet router firewall), 2 security cameras with motion detect, A/V integration, 2 x 3 phase power monitors, 915Mhz radio for remote sensors, solar power inverter and a rain tank level gauge.
Read the following project logs for the details of how the smart home hub software has been constructed and addresses the various parts of the smart home vision, as well as how to set it up for your own use.