Home Automation Series: HVAC Controls

I have a HoneyWell WiFi thermostat, which prior to this project was great. I could control it from my phone or their website. It was fuss free and convenient. That changed after I started this, while they have an API available, my specific thermostat isn’t part of their deployment. Which I only found out after writing a bit of code to authenticate to the API.

After realizing their API was not an option, I decided to scour Google and Github looking for other ways. I stumbled upon pyhtcc which at first, I couldn’t get to work, but after some testing found I was doing something wrong and has since worked great. The really nice thing is, it exposes a way to bypass it’s built-in features and directly call it’s base function which communicates to the HoneyWell service. Which I’ve taken advantage of 🙂

An example of code used to check on and update the overall HVAC system

Never mind the fact there are warnings in the screenshot above. Those are because I’m calling “protected” areas of the pyhtcc code base. I ended up adding a few specifics that suite my needs better than what pyhtcc can offer. One of those is the ability to control the temperature at the next period. With HoneyWell, you have this concept of periods, or slices of time in the day where you want a specific temperature. What this means is I can build into the system the ability to measure outdoor temperatures, and as they rise or fall, I can leave the house temperature where it’s at and simply adjust the next periods temperature. That is of course, if temperatures outside rise or fall dramatically, then adjust right now.

Damper control

A damper can control airflow by opening and closing. Opening allows more air, closing allows less air. When we bought our house, the dampers were set in such a way it would be “balanced” and we only had to mess with the main trunk in the garage when the season changed. That really didn’t work out. I’ve crawled up to the attic a couple of times to adjust them, and I’m done doing that. Not the mention the damper that controls our entry way, kitchen and second Master bedroom is much too low and we always have issues with cold spots.

We’ve got six dampers that control various areas.
– There is the main control, which dictates how much air flow goes downstairs vs upstairs.
– one that controls air flow to the downstairs living room
– one that controls air flow to the guest room/kitchen/main entry
– one that controls air flow to the master bedroom
– one that controls air flow to the two bedrooms upstairs
– one that controls air flow to a little sitting area/living room upstairs.

By having temperature sensors in those areas along with damper controls, I can hopefully achieve good balance and better control of when a room is heated/cooled, without needing to buy a multi-zone HVAC unit.

I hope at some point to do a video describing how it all works. That will probably be after I’ve installed damper controls.

Thanks for reading!

Home Automation Series: Weather Data

This is probably over kill, but I’ve always had a fascination with the weather, and so one of the things I wanted to do was hold an enormous about of weather data, so I could write logic to analyze it and provide me with data about unusual trends, or possible up coming weather.

I read through several different Weather API providers and settled on DarkSky, who had two important factors: History all the way back to 1937 (for the most part) and cheap rates for excessive API calls.

Example output from my RestAPI

Using DarkSky, which has their own engine to “predict future weather”, I’ve populated weather data all the way through 2024. Every day though, my code will reach out and pull down accurate weather for each day. Ensuring valid data.
Right now, this process is dependent entirely on the internet, in the future though all weather data will be collected from a locally hosted weather station.

Why all the data though?

A major part of this will be a digital assistant, which I will probably call Jarvis. With that, I want to be able to rather quickly calculate weather records and have Jarvis be able to provide me with weather from a specific day or factoids about weather. Ideally, I think it would be pretty neat to write some code that could try to predict what the weather will be, then use actual weather recordings to prove or disprove (validating the learning process). This way, Jarvis could inform me of possible weather pattern changes or be able to tell when upcoming days will be sunny or not.

The real reason for the data hoarding though, is primarily because DarkSky was bought by Apple and it’s rumored the API will go away at some point. Which means, my ability to write code that will be dependent on that API is in question. So, instead, I’ve captured all the data I need prior to the API going away.

I’ll eventually look at plotting out all of the data in a scientific format using Matplotlib, this goes back to me being fascinated by weather data. It would be pretty neat to see how often trends repeat in terms of temperature spikes and dips, how often we actually get snow accumulation, or monthly average rain fall. I’ve always kind of been a bit of a data scientist, I’ve just never had the ability to act on the desire.

All of this data will feed into the logic that will be used to adjust the house temperature using the HVAC controls I’ve been building.

Thanks for hanging around!


The Hardware Of Jarvis: Sensors

With the development of Jarvis seeming to ramp up, I’m going to start getting into the development of hardware additions. After reading a series of blog posts by Rob Tennyson on building wireless sensor networks (http://www.robtennyson.us/post/building-wireless-sensor-networks), I decided that is the way I would go.

Then it dawned of me, instead of actually telling Jarvis that I am going to bed, like my prototype is setup right now, I would build something very similar to this wireless sensor setup, but have it be a single button arduino setup, that when pressed, sends a signal to Jarvis that I’ve gone to bed, then keeps track of the fact I’ve pressed it, so in the morning when the alarm goes off to wake me up, I can press it again it sends a signal that I’m awake, stopping the alarm and starting the “wakeupHandler” script that I’ve built.

Anyway, back to the original post idea. Wireless Sensor Building. The whole idea is to have a temperature sensor in each room of the apartment, and possibly one out front of the apartment. The end result I’m hoping for is to have Jarvis monitor the temperatures in each room and ensure the temperature stays above a threshold (i.e. 70 degrees), or a relative temperature to outside.

My hope is to get a hold of x10 hardware that controls a heater module, so Jarvis can communicate with the module in a room and only turn on the heater when it decides, rather than the heater kicking on by itself.

I’m also hoping to figure out how to use an IR (infrared) blaster to send commands to my Air Conditioner in the summer, but that’s down the road a bit.

Another neat feature I think would be fun to have is a series of sensors that monitor movement, if I’ve “logged out” of the apartment (for example, I leave for work) and the apartment is in “away” mode, if movement is detected, Jarvis can send me a tweet, instant message and email telling me which zone (or room of the apartment) that movement has been detected. At some point, I’d like to get cameras that will snap a picture when movement is detected and send it to me, along with an audible alarm, letting the person know the apartment is in “away” mode and that all of their activity will be noted and monitored.

Of course, the first step in this project is to really get hands on with the hardware that I will need, so it may be awhile before I can actually build my first sensor and once I get  it built, I will just duplicate the process a few times to create my network of sensors.

More to come on this

Thanks for reading!