Close

Central Control

A project log for A Home Automation System

I hacked my own LED lighting control system into a home automation system.

Dan JulioDan Julio 08/17/2016 at 23:230 Comments

Our usual ways of interacting with the system are through the physical controls, either mounted on the walls or remote controls here and there. However I wanted to provide remote access and have a place to put some automated intelligence over time. I looked at a lot of the open source home automation projects and marveled at how comprehensive they are. Ultimately though I decided to roll my own. I wanted to design my own user interface. I didn't really like any of the other ones I saw and I knew my artist partner wouldn't. And I had a lot of existing library code to interface with the QualColor protocol.

I use a development environment called xojo (formerly Real Studio). It lets me spit out applications for Windows, OS X and Linux as well as IOS for iPhone/iPad and stand-alone web server applications without having to learn a lot of other software stacks. I am definitely one of those people who wants the end result over finding the most perfect way to get there.

The control program is currently very simple. It runs on an old Mac laptop (eventually will run on a Pi 3). It is configured using a simple XML file and interfaces to the rest of the home via one of the prototype USB interfaces with a repeater to get coverage of the entire house. It provides a web interface with a login for any addresses that come from a different net. It's pretty straight forward object oriented code with functional and display objects for each kind of device. xojo lets me create different web views depending on the size of the device's screen and I take advantage of this feature for desktop browsers, tablets and phones.

USB interface on "equipment" shelf...

Example XML configuration.

Color wash light fixtures get additional visible controls to display a color-picker for manual color selection as well as a pull-down menu to select one of their built-in color wash programs (either random color fades or a rainbow cycle, each at one of four speeds). You can see how this is specified in the XML. A white-only dimmable fixture has a Device Value of "dimmer". A color-wash capable fixture has a Device value of "hsvdimmer". Currently the color picker only detects initial touch down and not dragging. I'd like to modify it to generate a continuous set of values as people drag their finger or mouse across it so that it operates the same way the physical remote control does.

Groups of fixtures, for example that are in some sculptural pieces are condensed into a single control but with an additional pull-down menu allowing address selection (all units, specific sets of units within the group or individual units). By default the user interface tries to display the most general and commonly used selections.

The control program takes advantage of a feature of the touch dimmers with LED indicators. They are designed so that they can either directly query the device they control for its current value to update their LED display if some other device changed its value or they can watch for query packets to their device to go by and update the value based on the response to those queries. Every few seconds the control program queries the state of the house. Currently this includes the color values (or intensity) of each light fixture and temperature and boiler state information. It uses this information to keep its own state up-to-date so that controls are drawn with the correct value. The wall mounted dimmers use this information to keep their LEDs up-to-date as well.

The constant query function also serves another purpose. Although the radio protocol is fairly reliable, it is unacknowledged. Or rather, acknowledgement has to be handled by higher level software. This allows for the construction of very simple devices like remote controls and controllers that can interact in 1:1 or 1:many configurations with the human acting as acknowledger. The control program can resend commands that it thinks have been missed by a device.

Repeater using amplified nRF24L01+ module - makes it possible to reach every room in the house.

Over time we've found the most use of this program for turning up the heat before arriving home from vacation in the winter, for simulating occupancy while gone and being lazy turning things off from bed.

I have lots of ideas for expansion of this program including some intelligence about house occupancy, additional monitoring functions (for example energy usage), security monitoring (access web cams and recordings). A member of my local makerspace also had the brilliant idea of having it record daily activity in some form and then use those recordings to simulate occupancy when we are gone.



Discussions