Home Automation Series: Temperature Sensors


The heart and soul of my home automation and HVAC controls are room temperatures. Having a single zone HVAC unit means that the temperature is controlled in one place (usually near the central return). My house was built in 2016, and makes use of the idea that when a bedroom door is closed, the air return can occur under the door. That idea is….well, terrible.

With HVAC units you have registers (the vent that blows air into a room) and returns (it removes air from the room). Our house is unique because it has a second master suite, which has its own air return but has no temperature control and very weak air pressure from the unit. We’ll come back to this in a bit.

If you have a register in a room and it’s blowing air and the door closes you do what’s calling “blowing up” the room. Like a balloon. You are putting more air than you are removing into a room. Now, if you don’t have enough air blowing into a room and you have a return sucking air out you actually get the exact opposite issue. You create a negative pressure issue. When the unit is trying to pull air out of the room but there isn’t enough air from the unit, you start pulling air in from outside.

I mention this because right now in our house we have four bedrooms and two common areas. Two of the bedrooms are controlled by a single vent off the unit. I recently added an air return to my bedroom to help balance the system and attempt to get rid of the build up of air. So, that second master bedroom. The floor vents provide very little air, and I mean, VERY little air. So little its barely detectable by placing your hand over the vent. But, the room has a fully operational air return, which runs straight into the system. In the winter time, that room is very cold and in the the summer very hot.

The issue is, the air return pulls in whatever temperature the air is and sends it to the HVAC for recirculation. The issue is, if we want the house warm, but that room is cold. the house struggles to warm up because we’re sending cold air.

Wow, quite the intro. haha.

So, how will I correct this? By using Shelly H&T Sensors to monitor temperatures in each room, I will be able to tell which room needs more or less air. The two rooms that are controlled by a single vent duct from the unit will need a “jumper duct” to allow better air transfer.

Jump Ducts | Building America Solution Center
A jumper duct lets air from one side of a wall or door easily pass back to the unit.

The Shell H&T sensors have an Open RestAPI, which will make direct automation very easy!

Once per hour my code will query the sensors to get Temperature and Humidity readings. Once the readings are complete, determine which rooms have temperatures that are out of scope for the overall house temperature.

Once we’ve determined which rooms are too cold or hot, we’ll adjust the dampers accordingly and push air.

When the dampers have been adjusted, the room temperature should raise or lower pretty quickly since we’re driving a lot of air to that room. When a room has been marked as being too cold or hot, we’ll check in every 15 minutes after the dampers are adjusted to see how the temperatures is coming. If we’ve checked-in twice and still haven’t seen the temperature come into scope, a push notification will sent to me alerting me.

I haven’t yet added to jumper ducts, and I don’t have the sensors yet. I’ve ordered two of the sensors so that I can begin the tracking of temperatures in my room and one of our other bedrooms.

Thanks for reading!

Dan

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!
-Dan

Home Automation Project


For as long as I can remember, I’ve always thought the idea of having automated controls was pretty cool. This became especially pronounced after watching the Iron Man movies. The idea of have something like Jarvis in control things was really cool and I really wanted to create something like it.

In 2011, I started watching a guy on YouTube who had taken a MacMini and wrote a bunch of AppleScripts to create what he was calling Jarvis. He was sharing his ideas and features and for the first time I thought it might be possible to create such a thing without needing to spend a ton of money to buy it.

I originally borrowed his Library.scpt file and used many of it’s pre-defined functions in my code. This worked well until many of things it used were disconnected by their vendor, like Google Latitude, and Yahoo Weather’s API. I spent a long time writing AppleScript to do stuff like, answer questions using Wolfram Alpha and check my Calendar for events, which was cool. But it wasn’t “useful” to me as much as I wanted it to be. I stopped writing AppleScript somewhere around 2015 and the project sat idle for the next 5 years, occasionally I would poke at it.

Fast forward to 2019, when I started learning Python. I had known about Python for a long time but was hesitant to learn it because of the learning curve. My learning style is very different than other peoples, I learn by doing. My first foray into Python was a project for work, a utility that would read over files from one of our products and build a database of objects and cross-reference several data points (both dynamically and statically). After a year of working on that project, it had received many positive reviews and was adopted into a new product. Not bad for a first go, eh?

With this new found Python knowledge, it reignited the idea of “Jarvis”. Could I create such a thing with Python? There are so many videos on YouTube where people have created really simple single function “bots” and have called them “Jarvis”, stuff like, “Call me Dan” and the bot responds, “Hi, Dan”. Don’t get me wrong, if you’ve never written code before, that’s a big accomplishment. I wanted something much more advanced.

I started writing a bunch of different functions to do stuff like collect weather data and send tweets, which again were somewhat useful in the grand scheme of things. After sometime I decided I’d use those as parts of a bigger picture, and started focusing on what I needed/wanted this thing to do when done.

I knew it needed to:

  • Be aware of external temperature data
  • Be able to detect temperature data from multiple rooms in the house
  • Be able to adjust both the thermostat and the various dampers in the house to better balance temperature
  • Notify me of things like unusually high humidity in a room, or room temperature that will not adjust.
  • Automatically control lights (both internal and external), either by voice command or time of day.

Now, much of this is already possible with Google Assistant, Amazon Alexa or Siri, but I don’t want to be bound by what the limitations are for those. I want to be able to build in fail-overs for things. Like, if a room temperature won’t adjust, close all other dampers by some small percentage for a set time and turn the fan on, forcing more air into that room, and thus more air out of that room. I don’t know that I could have that kind of custom workflow with the others.

With all that being said, how will this work?
I’ve built a docker container that will run Python + Flask for the front-end. This way, I can have a TV with system data displayed, room temperatures, damper percentage, outdoor temperature, thermostat schedule and some other bits of data. Within this docker container will be several pieces, the first being a scheduler. The scheduler will automatically trigger several operations, like collecting all temperature data once an hour, or doing a systems check and sending me a push notification if somethings wrong.

Second, will be the vocal side, I haven’t yet decided how I want to go about communicating by voice, but there is code to handle that. I’ve thought about having a bluetooth that I wear, but that seems tedious. I’ll revisit that a bit more in the future.

Third, a Rest API. Why have a Rest API on this? Integrations. One of the things I thought about was the ability to have “outside” things integrate into my system. Things like purpose built Raspberry Pi’s that can either be collecting data or pulling data from the system and doing something. The primary purpose here is HVAC damper control. There will be a couple of Raspberry Pi’s around the house with equipment wired to dampers in our HVAC ducting, when the main system I’ve written needs to check temperatures in a room and adjust the damper, it will send a POST command to the appropriate Pi to adjust the damper, and the damper will make the change and return data points about damper position among other things. The main system can then note the change and it will now have in a database, the damper value.
Another piece to this is having this entire system on its own private network that is on battery backup.

Thanks for reading.. More to come.

-Dan

Farewell 2020…


2020 has gotten a pretty bad reputation. It’s the year the pandemic ruled the world and lockdowns occurred. However, something I think a lot of people don’t see is that, 2020 gave us the ability to grow closer to our family and learn to adapt and overcome. But many people won’t see it that way, they’ll see the negative side before they see the benefits. They’ll see that their ‘right’ to go into a restaurant and eat was taken away, or the their ‘right’ to be in a large group of people was taken away.

What’s interesting to me is everybody seems concerned with their ‘rights’ but not so much about ensuring the people around them are healthy and don’t die. They’d rather enjoy themselves than be safe.

I’m hopeful as we move into a new year, people become more open minded and see benefits before negativity.

Hello 2021. Let’s rock this thing!

Starting over.


Previous attempts have not worked as I would have wanted them to. So, it’s time for a “reboot” if you will.

What does this reboot consist of? Well, quite simply dedication. I haven’t dedicated myself to losing weight. It has gone to far, I’m 342lbs. Three Hundred and Forty Pounds. It’s embarrassing to say, and it’s a hard thing to come to terms with. Things that I used to be able to do with the greatest of ease, I’m finding gets me winded and it takes me a few minutes to catch my breath..

I don’t eat destructively or anything, I eat pretty modestly, I think. But the main issue is, I sit at my job, and I sit at home. I do get outside and work in the yard and garden. Obviously not enough to really get a calorie burn.

How will I change this? On my days off I have a membership at Planet Fitness, which 10 dollars a month isn’t bad. They have a 30 minute circuit, which is like a full body workout. I will hit the circuit 3 days a week and then when I get off work I will have to get into a groove of working out in the gym at work. For the time, I’m going to stick to cardio in the gym at work. I just need to get my body conditioned to be active.

When all else fails. Try, Try Again.

View my starting pictures