It's been a while since I have posted anything! I have been busy with work, but have been making some slow progress on my home automation system. Since posting about my Apartment Security System, I have moved to a new house and made some nice additions. I now refer to it as a “home automation system”, since its uses have evolved past just providing security.
My new house has two thermostats, and I wanted to control both of them from my system. I briefly considered building my own thermostat, but decided I would like to be able to operate my AC when my automation system eventually has bugs/crashes/whatever. The next option was to buy a WiFi thermostat with an open API and control it that way. The Nest is the first thermostat that comes to most people's mind, and while it does have an open API, I didn't really want the other features or to pay brand name premium. Eventually, I found the Radio Thermostat CT-50 for $100. It has a completely open API (PDF) and there's even a Python library for it called radiotherm.
After hacking around with the Python library for a while, I was able to integrate it with my automation system. I replaced both of my thermostats with these models, and was able to add a web page to view the status of the thermostats. It was also not too difficult to add logging to the SQL database, so that the temperature display graphs included thermostat data right along side my EnviroNode data.
Unfortunately, the only way to control the thermostat with the system is by using the internal system commands. These commands can be accessed from the command line only, and I needed an easy way to execute these commands from the web. I decided to add a new feature, scripts. This would be how I began to control my thermostat.
Although it has always been one of my ultimate goals to make the system extremely script-able with flow control, variables, the works (maybe some D++ integration!), the current script system just processes commands sequentially. Commands like “tstat 1 cool 76”, or “leds blink” or “sound 41” are the usual commands used in scripts, and it let me put together some useful and fun scripts.
While implementing this system, I began to look into more “proper” ways of exchanging data between a web interface and a Python server, but with this script control also came an easier way to control my LED lighting…
I made some pretty cool LED lights to go with my house. Originally based on code from my LED_Panel, I designed a new PIC24 micro board to control the WS2812B LED strips, in addition to APA101 LED strips. I bought a bunch of WS2812B LED strips, wrapped them around a PVC pipe, spray-frosted a glass vase and put the pipe in the middle.
The lights have several modes, but they mostly run a hypnotic “ambient color mode” that pulses colors in a pleasant way. I have about 7 of these LED lamps around my house. They look super cool in person, and I definitely plan on doing a full write up as well as publish schematics and source code.