Smart Home Control

For over 10 years I used the Perl based Misterhouse package for controlling everything, it was heavily modified over the years to improve it visually and functionally but over the last couple of years I have built my own system using Node-RED and MQTT as the back end and have written a new web based control interface taking  a few visual design cues from Misterhouse along the way.

For manual control as opposed to automated events voice control is being increasingly used but the web interface still forms one of the main day to day interfaces to the system, running in full screen browsers on several O2 Jogglers, Raspberry Pi Displays and Android tablets as well as being accessible from inside or outside the house on any PC, phone or tablet.

Joggler showing dials from emoncms embedded within the Home Control web interface
Joggler showing dials from emoncms embedded within the Home Control web interface

On arriving home the audio amplifier turns on and welcome me audibly with speech output as well as visually on an LED matrix sign, turning lights on if it is dark.  On leaving the house all lights and appliances are turned off and various notifications change to alert me on my phone and watch instead or audibly and visually within the house.

A ‘going to bed mode’ turns all the ground floor lights and appliances off and turns on the stairs and main bedroom bedside light, a few minutes later the stairs lights turn off and when I manually turn the bedside lights off the system knows I am in bed and I will only be disturbed by urgent notifications.

Based on the status of the system (home, away or bed mode) various sequences of events will occur such as turning lights on and off. When the house is occupied PIRs in several areas will turn lights on when detecting movement if it is dark and the heater by my desk will maintain the temperature at a comfortable level if I am present.

In the morning it turns my bedside light on in an attempt to wake me up gradually and then a couple of minutes later I get a voice message telling me what time it is, what the external temperature is and the current weather, the Radio 4 is turned on. If it is very cold it wakes me up 10 minutes earlier to give me extra time get ready and to de-ice the car if required. The coffee machine in the kitchen is also turned on so I have fresh coffee ready when I get downstairs and if I still haven’t surfaced a few minutes after that a Star Trek red alert sounds to tell me it really is time to get out of bed now.

I can also schedule events by creating an event in a dedicated “Home Control” Google calendar which makes a nice easy way to schedule things from any device and caters for one off events or repeating events. This is done by creating an event with an MQTT topic and message, eg. creating an event of “lights/kitchen,on” will turn the kitchen lights on at the event time.

The system also provides notifications if the fridge door has been left open, if power usage is outside the normal range, if rain is expected or if the nearby River Mersey is higher than normal or if there are any flood alerts in place. It will also tell me when the next International Space Station pass is due and when it is overhead.

I get notifications of calls on the landline, if someone is at the front door, if the letterbox has been opened, if there is movement detected at the rear of the house when there shouldn’t be and if the fridge door has been left open. Exactly how the notification appears depends on the home/away/bed status of the house and where I am, it could be verbally through speech notifications and visually through displays if I am at home or via my smartwatch or phone if I’m not.

Here are some screenshots from my web interface system:

Main screen
Main screen

Light control
Light control

Appliance control
Appliance control

Modes
Modes

AV control
AV control

DAB tuner
DAB tuner

Environmental data
Environmental data

Alternative data view
Alternative data view

Weather data
Weather data

Gas and electricity usage
Gas and electricity usage

PBX and voicemail
PBX and voicemail

Where I am
Where I am

Where I've been
Where I’ve been

Node-RED is behind the scenes
Node-RED is behind the scenes

Bandwidth usage
Bandwidth usage

Email, news, Twitter, calendar etc.
Email, news, Twitter, calendar etc.

System status
System status

Logs
Logs

Mobile view of main page
Mobile view of main page

Mobile view of light control
Mobile view of light control

 

 

The server and network

This is much simpler than it used to be, the network is a mix of GigE, 100 Mbit/s wired & 802.11b/g/n/ac Wi-Fi and the home automation server itself is nothing fancy, currently a 3.2GHz dual core Pentium E5800 with 4GB RAM running Debian GNU/Linux. A couple of RAID NAS boxes handle media storage and on site backups with off site backups of important things done to a remote box over the net and larger less important files via sneakernet.

The router is a TP-Link Archer C7 running DD-WRT connected to an Openreach fibre modem,  I also have an old Linksys WRT54GL (also running DD-WRT) which is setup on a different subnet, this is used as a guest router and for any other untrusted devices that come into the house such as those infected Windows laptops people keep bringing for me to fix!

MQTT

The backbone of the system is MQTT, I run two brokers, both Mosquitto, one is internal only and is set up without security which makes things easier for small embedded devices. The second is on a VPS and is exposed to this internet, this one has security and SSL enabled, this second broker is used for any Internet connected devices such as Owntracks running on my phone. The two brokers use MQTT bridging to link topics together.

 

Read more about  my smart home automation system here.

 

Last modified: 17 September 2016

One thought on “Smart Home Control

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.