I’ve been gone for a while and now I’m back. I’ve noticed there’s a severe lack in good (and good looking) software for modern DIY home automation. In this post I’m throwing up some screen shots of a software suite that I’m currently working on. I’m focusing on my thermostat, motion sensors and lights. And getting them to eventually work together.
Considering I see a lot of impressive thermostats and various home automation products being built from scratch using Arduinos and the like, it’s a shame that none of them have a particularly good software user interface. I was in the same boatand thought, “why shouldn’t we all have a pleasant home automation interface?” I plan to put the code I’m working on up on Github as open source so that others can use this in their projects if they like, or even contribute improvements.
If you’ve created your own Arduino thermostat, this app is for you.
This software platform has been designed so that none of the protocol specifics matter to the user interface. It’s completely abstract, so if I want to use X10 or Zwave or Arduino or Philips or whicheverproducts in my home, I don’t have touch the UI code. What I have to do is configure the devices in the database, and write a “protocol translator” for the device. In other words, if I bought a new thermostat (or made one) and it had a completely different protocol/API, all I would have to do is write a basic shell script to sit between my core software and the thermostat, translating commands to API calls. Probably sounds more complicated than it is.
I was previously managing the thermostat and motion sensors through some ugly shell scripts. I’ve moved both over to a mysql database for configuration and state, with an HTML5 front end and some basic shell scripts to interface with the hardware. I think by decoupling these three tasks it will make it easy to shim in other protocols and hardware down the road.
In the motion sensors app, I can now get a very good idea of what each sensor is doing, making the set up and troubleshooting of sensors easy. This app shows me which zones see motion in green, dormant zones in grey. I can click a zone button to disable motion detection in that particular zone. It tells me how long it’s been since it has last seen motion . It also shows me the number of “hits” behind the main text.
When a sensor is triggered, it will run a related macro for it, to say turn on lights on that room, or whatever. The macros are just a series of basic shell scripts.
The back end service for motion detection compares the last time a zone saw motion to a timeout which can be a hard set number or perhaps a dynamic number based on “hits” of activity seen in that zone recently. An exponential push-back on the timeout. When the timeout is exceeded a macro is run to turn things like lights off or maybe adjust my thermostat. Maybe auto-arm the alarm when all zones are dormant and it’s during work hours.
Speaking of alarm, it also acts like an alarm system now. When enabled, triggered zones show up in red on the UI. The back end servertakes photos from my cameras, emails me the photos, and plays a siren and flashes all of my lights on and off in my house. It’s pretty cool considering it was a $0 feature add.
All of the data is maintained in the same database as the thermostat app. I plan to write something to use this motion data to dictate thermostat functions, so that it will operate similar to a nest thermostat.
The thermostat app provides your typical thermostat functions. This interfaces to an x10 thermostat which I don’t recommend. But it would easily work with any WIFI thermostat with an open API or a home made thermostat with an Arduino or Raspberry Pi.
This app also pulls data from yahoo’s weather API and logs it to the database. So now I can correlate external weather to internal thermostat usage over the years. Possibly use that data and compare it to my Utility bills.
The image in the background updates dynamically and is animated.
With both apps, it updates status changes from the back end service quickly. So changes made on one client(phone) reflects to other clients almost immediately. This is great for multi-user homes.
Also these apps automatically scale for mobile or desktop view. Meaning I only have to maintain one code line. The cool part about this is it will act as an end to end solution. It will work and look good on desktops, tablets (maybe on a wall), and phones.
I’ll post my software publicly when I have modified it for easier distribution. If you’re interested in working with it or possibly adding to it, send me your github information.
Controlling Home appliances via cellphone or PC, It’s great. And the blog you have written on Open user Interface for Home Automation is really nice. I Like it.
I approve of this message 🙂
This is good work. When I eventually get around to getting off my ass to start building my system, this looks like what I may use. Quick question though, will the graphics assets be editable/replaceable? I am a bit picky about design, and while yours isn’t bad, it’s not quite to my taste.
The design is very “modular” you just drop new css. I’m literally using no images.
That’s awesome. I hope you don’t mind, but I linked this post from my Google+ community, DIY Automation and Security.
Wow! This is a very useful page and I really enjoyed reading article and all users’ comments. Smart Home Group is a privately owned and operated Technology Distribution company offering a full range of Home Automation solutions. With a strong brand presence in the Australian market, Smart Home Group continues to provide value for money solutions across a growing range of products. Thank you for sharing valuable information.
I’ve also been working on a from-scratch home automation software kit that seems to have very similar aims as yours. Mine is called gnhast, and the idea is that each piece of equipment is controlled by a driver that acts somewhat similarly to a UNIX device driver. There is a central control coordination program, that deals with all the different devices. All the communication is handled through a common API. If you want to switch a light on, you tell the central controller to do so, it finds the daemon that is communicating with that device, and asks it to flip the switch.
My point being, this sounds nearly identical to your goal. However, all my stuff is just ugly backend code, I have no pretty front end, and I pretty much suck at css. However, it seems like our two efforts could easily be combined. You should email me, I’d really like to see what you have, or see if we can collaborate in some way.
Hey thanks for the info and sorry for the late reply. What you’re doing sounds interesting. Maybe throw up a few videos walking through your solution. I agree with you that you could take me “pretty” front end and adapt it for your use. I tried to write it with back end generic in mind.
I’ve created something similar based on node.js and arduino based wireless sensors/controllers. Node.js doesn’t need external scripts and the server process will keep on running (not only during page requests like php). This way you can have the same single application serve the web pages, insert information in the DB based on incoming wireless data and perform the (timed) home automation.
Sounds cool Could you post a link to your work?
I started from the install side. I have a Home Automation Controller in place but I am looking for a simple universal user interface for may family. UI wall tablets from HAI are ridiculously priced and only work with the technologies attached to the controller. I have the internet protocols to connect and control devices and get status from sensors for the controller so your UI approach would work perfectly. I just set up an empty github site but have never collaborated this way before. Could you help me out and let me know what I need to send you to get started? Thanks for sharing your work is excellent.
Are you guys aware of OpenHAB? It seems to me that you have similar goals (open source, universal, etc.). Perhaps it might be best to contribute to that project, instead of rolling your own from scratch?
I have, I’ve since dropped this project and have been using samsung smartthings.